Android Question How to create a RTMP Datasource for Exoplayer?

Discussion in 'Android Questions' started by DonManfred, Oct 13, 2017.

  1. DonManfred

    DonManfred Expert Licensed User

    KZero likes this.
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. DonManfred

    DonManfred Expert Licensed User

    Are you sure?
    The old aar is >900kb while the one you suggest is only about 3kb


    Snap7.png
     
  4. KZero

    KZero Active Member Licensed User

    Attached Files:

  5. Erel

    Erel Administrator Staff Member Licensed User

    KZero likes this.
  6. KZero

    KZero Active Member Licensed User

    Thanks for updating the library

    there is no player.createRTMPsource property
     
  7. Erel

    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:
    Code:
    #AdditionalJar: rtmp-client-3.0.0.aar
    #AdditionalJar: rtmp.jar
    3. You can play RTMP streams with:
    Code:
    player1.CreateUriSource("rtmp://live-fs.wmncdn.net/mbctv1/live1.stream")
     

    Attached Files:

    KZero likes this.
  8. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    Hello @DonManfred , do you have any example working with rtmp protocol?

    Can you share here?

    Thank you

    Alberto Iglesias
     
  9. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    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
     
  10. DonManfred

    DonManfred Expert Licensed User

    Please post Error as TEXT instead of uploading an image!

    Best is to upload a small project which shows the issue.

    Away from that you should have created a new thread for YOUR Issue. Posting to existing threads is a mistake.
     
  11. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    Code:
    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 **
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice