B4A Library ExoPlayer - MediaPlayer / VideoView Alternative

Status
Not open for further replies.

sule

Member
Licensed User
1. Are you sure that the IDE is configured to use this SDK (under Tools - Configure Paths)?
2. Try to delete build tools 23.0.1 and 23.0.3.
yes it is configured corectly and i have one more error with http, okhttp ,httputils2 and okhttputils
 

sule

Member
Licensed User
Which android.jar did you specify in the IDE -> Configure Paths?
It should be from platform 23 or 24

Based on
https://developer.android.com/refer...ce.html#onTaskRemoved(android.content.Intent)
it should be api 14 or higher.

I suggest to use the most up-to-date android.jar
Which android.jar did you specify in the IDE -> Configure Paths?
It should be from platform 23 or 24

Based on
https://developer.android.com/refer...ce.html#onTaskRemoved(android.content.Intent)
it should be api 14 or higher.

I suggest to use the most up-to-date android.jar
 

DonManfred

Expert
Licensed User
If you get the same error then you are still using a reference to one of the old http libs (or classes or services)...

you need to uncheck http lib and you need to uncheck httputils2 lib.
If you are using a httputils2service in your project you need to remove this too.

In fact you need to remove all old http libs and replace them with okHTTP and okhttputils2

If that does not help: Try to reproduce the problem in a small project.
start with a NEW thread in the questions forum uploading your problematic project and the error
 

victormedranop

Well-Known Member
Licensed User
Audio Issue. I have testes Ffmpeg library and have video and audio, but cant manage size of the screen.
right now trying with Exoplayer, but got video no audio.

how can I debug this library, the functions ready, error, complete works.
but need more information.

in the image is the codification of the stream.

Victor Medrano
 

Attachments

Last edited:

Erel

Administrator
Staff member
Licensed User
Add the attached class.

Usage example:
B4X:
Sub Process_Globals
   Private player1 As SimpleExoPlayer
   Private playerEx As ExoPlayerExtra
End Sub

Sub Globals
   Private SimpleExoPlayerView1 As SimpleExoPlayerView
   Private Button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
   If FirstTime Then
     player1.Initialize("player")
     Dim sources As List
     sources.Initialize
     sources.Add(player1.CreateDashSource("http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,source,id,as&ip=0.0.0.0&ipbits=0&expire=19000000000&signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E&key=ik0"))
     sources.Add(player1.CreateHLSSource("https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8"))
     sources.Add(player1.CreateUriSource("http://html5demos.com/assets/dizzy.mp4"))
     player1.Prepare(player1.CreateListSource(sources))
     
   End If
   Activity.LoadLayout("1")
   SimpleExoPlayerView1.Player = player1
   player1.Play
   playerEx.Initialize(player1)
End Sub

Sub Button1_Click
   playerEx.CurrentWindowIndex = (playerEx.CurrentWindowIndex + 1) Mod playerEx.WindowCount
End Sub
 

Attachments

Syd Wright

Well-Known Member
Licensed User
You should use SDK build tools v23+.
Is there really no way to make your Exoplayer library work with earlier SDK Build tools? Also, according to many sources on the Internet, Exoplayer should work with Android API 9+ (not 14+). So why the need for all these very high B4A, Java 7 (not 6) and Tools versions?
 

Erel

Administrator
Staff member
Licensed User
So why the need for all these very high B4A, Java 7 (not 6) and Tools versions?
I'm not sure whether you are serious or not... Java 7 was released at 2011.

Exoplayer should work with Android API 9+ (not 14+)

https://google.github.io/ExoPlayer/guide.html

Is there really no way to make your Exoplayer library work with earlier SDK Build tools?
Older build tools are not supported by the native library.
I guess that it is time to upgrade from Windows XP to Windows 7+ if you want to use the latest Android libraries and features.
 

Syd Wright

Well-Known Member
Licensed User
Thank you. I found debate about the minimum SDK version here: https://github.com/google/ExoPlayer/issues/8 and other places. In the past I had a problem with VB6 software and Java-7. That is why this XP machine still has Java 6. Also I love XP and it is not riddled with Microsoft spyware, like in particular Windows-10! I also still sometimes use VB6 which sometimes gives problems on my Windows-7 (especially when using older third-party modules).
I suppose I am old-fashioned; that is what you get when aged 62+ :)

Pity ExoPlayer does not support rtsp streaming. I bought Moster67's Vitamio-5 video library for that reason, which works very well. Do you have any tricks up your sleeve to make Exoplayer have the same abilities as Vitamio-5?
 

zura

New Member
Licensed User
i am getting an error:

Generating R file. Error
invalid resource directory name: C:\Users\user\Documents\Basic4Android\exo.04\Objects\bin\extra\res1\res/values-b+sr+Latn
 

Licht2002

Member
Licensed User
Hello, i get an Error....

..... Suppressed: java.lang.ClassNotFoundException: com.google.android.exoplayer2.upstream.DefaultBandwidthMeter .....

I use the Test-File from Post 1..... with "android-25\android.jar" and "jdk1.8.0_112\bin\javac.exe"...

B4X:
LogCat connected to: B4A-Bridge: samsung SM-G900F
--------- beginning of main
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/exoplayer2/upstream/DefaultBandwidthMeter;
    at anywheresoftware.b4a.objects.SimpleExoPlayerWrapper.Initialize(SimpleExoPlayerWrapper.java:73)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:753)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:343)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at b4a.ExoPlayer.main.afterFirstLayout(main.java:102)
    at b4a.ExoPlayer.main.access$000(main.java:17)
    at b4a.ExoPlayer.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7224)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.exoplayer2.upstream.DefaultBandwidthMeter" on path: DexPathList[[zip file "/data/app/b4a.ExoPlayer-2/base.apk"],nativeLibraryDirectories=[/data/app/b4a.ExoPlayer-2/lib/arm, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 17 more
    Suppressed: java.lang.ClassNotFoundException: com.google.android.exoplayer2.upstream.DefaultBandwidthMeter
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 18 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/exoplayer2/source/dash/DashMediaSource;
    at anywheresoftware.b4a.objects.SimpleExoPlayerWrapper.CreateDashSource(SimpleExoPlayerWrapper.java:174)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at b4a.ExoPlayer.main.afterFirstLayout(main.java:108)
    at b4a.ExoPlayer.main.access$000(main.java:17)
    at b4a.ExoPlayer.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7224)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.exoplayer2.source.dash.DashMediaSource" on path: DexPathList[[zip file "/data/app/b4a.ExoPlayer-2/base.apk"],nativeLibraryDirectories=[/data/app/b4a.ExoPlayer-2/lib/arm, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 18 more
    Suppressed: java.lang.ClassNotFoundException: com.google.android.exoplayer2.source.dash.DashMediaSource
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 19 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
** Activity (main) Pause, UserClosed = true **
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/exoplayer2/upstream/DefaultBandwidthMeter;
    at anywheresoftware.b4a.objects.SimpleExoPlayerWrapper.Initialize(SimpleExoPlayerWrapper.java:73)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:753)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:343)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at b4a.ExoPlayer.main.afterFirstLayout(main.java:102)
    at b4a.ExoPlayer.main.access$000(main.java:17)
    at b4a.ExoPlayer.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7224)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.exoplayer2.upstream.DefaultBandwidthMeter" on path: DexPathList[[zip file "/data/app/b4a.ExoPlayer-2/base.apk"],nativeLibraryDirectories=[/data/app/b4a.ExoPlayer-2/lib/arm, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 17 more
    Suppressed: java.lang.ClassNotFoundException: com.google.android.exoplayer2.upstream.DefaultBandwidthMeter
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 18 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/exoplayer2/source/dash/DashMediaSource;
    at anywheresoftware.b4a.objects.SimpleExoPlayerWrapper.CreateDashSource(SimpleExoPlayerWrapper.java:174)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at b4a.ExoPlayer.main.afterFirstLayout(main.java:108)
    at b4a.ExoPlayer.main.access$000(main.java:17)
    at b4a.ExoPlayer.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7224)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.exoplayer2.source.dash.DashMediaSource" on path: DexPathList[[zip file "/data/app/b4a.ExoPlayer-2/base.apk"],nativeLibraryDirectories=[/data/app/b4a.ExoPlayer-2/lib/arm, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 18 more
    Suppressed: java.lang.ClassNotFoundException: com.google.android.exoplayer2.source.dash.DashMediaSource
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 19 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
** Activity (main) Pause, UserClosed = true **
Do i something wrong?

Thx Tom
 

Attachments

Status
Not open for further replies.
Top