Android Question How to create a RTMP Datasource for Exoplayer?

KZero

Active Member
Licensed User
Thanks for updating the library

there is no player.createRTMPsource property
 

Erel

Administrator
Staff member
Licensed User
1. Download the attached zip and copy the two files to the additional libraries folder. It is a compilation of: https://github.com/ant-media/LibRtmp-Client-for-Android
2. Add these two lines:
B4X:
#AdditionalJar: rtmp-client-3.0.0.aar
#AdditionalJar: rtmp.jar
3. You can play RTMP streams with:
B4X:
player1.CreateUriSource("rtmp://live-fs.wmncdn.net/mbctv1/live1.stream")
 

Attachments

Alberto Iglesias

Well-Known Member
Licensed User
1. Download the attached zip and copy the two files to the additional libraries folder. It is a compilation of: https://github.com/ant-media/LibRtmp-Client-for-Android
2. Add these two lines:
B4X:
#AdditionalJar: rtmp-client-3.0.0.aar
#AdditionalJar: rtmp.jar
3. You can play RTMP streams with:
B4X:
player1.CreateUriSource("rtmp://live-fs.wmncdn.net/mbctv1/live1.stream")
After the update on ExoPlayer for 1.2.0, this should be work right? Or need to do some procedure?


upload_2019-7-8_12-9-18.png
 

Alberto Iglesias

Well-Known Member
Licensed User
B4X:
Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
        player1.Initialize("player")
        Dim sources As List
        sources.Initialize
        ' sources.Add(player1.CreateUriSource("https://html5demos.com/assets/dizzy.mp4"))
       
        sources.Add(player1.CreateUriSource("rtmp://live-fs.wmncdn.net/mbctv1/live1.stream"))
        player1.Prepare(player1.CreateListSource(sources))
       
    End If
    Activity.LoadLayout("1")
    SimpleExoPlayerView1.Player = player1
    player1.Play
End Sub

and the LOG
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Lnet/butterflytv/rtmp_client/RtmpClient;
at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:59)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:257)
at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:934)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:381)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "net.butterflytv.rtmp_client.RtmpClient" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/b4a.example-CJad3Zim7-KPxRLs6cIgRQ==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-CJad3Zim7-KPxRLs6cIgRQ==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 8 more
java.lang.NoClassDefFoundError: Failed resolution of: Lnet/butterflytv/rtmp_client/RtmpClient;
at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:59)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:257)
at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:934)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:381)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "net.butterflytv.rtmp_client.RtmpClient" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/b4a.example-CJad3Zim7-KPxRLs6cIgRQ==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-CJad3Zim7-KPxRLs6cIgRQ==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 8 more
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
 
Top