B4A Library Exoplayer 2.18.5 Streams Player

Hi, This is Based on the Wrapper of Erel .
I was in need to use the latest Exoplayer for only one purpose is to play RTMP Streams.
also this Exoplayer Replaces deprecated playerview with StyledPlayerView.

You need this Additional Following AArs to be located in your Additional Libraries Folder in order to use this library.

Version 1.40 required aar.

Additional AAR 2.18.2

Version 1.50 required aar.
Additional AAR 2.18.3

Version 1.60 required aar.
Additional AAR 2.18.4

Version 1.70 required aar.
Additional AAR 2.18.5

Functionality :
  • CreateUriSource
  • CreateSmoothStreamingSource
  • CreateHLSSource
  • CreateDashSource
  • CreateFileSource
  • CreateRtspStreamingSource
  • CreateRtmpStreamingSource
  • CreateUdpStreamingSource
  • CreateListSource
  • setReapeatMode
  • getIsPlaying
  • Prepare
  • Play
  • Pause
  • Release
  • getPosition
  • setPosition
  • getDuration
  • getVolume
  • setVolume
  • getCurrentMediaItemIndex
  • GetvideoFormatwidth
  • GetvideoFormatHeight
  • GetAudioTracksLanguages
  • GetVideoTrackSubtitles
  • preferedAudioLanguage
  • preferedtextLanguage
  • EnableSubtitles


  • SPlayerView
  • UseController default is true
  • ShowBuffering [NEVER|PLAYING|ALWAYS] default is NEVER
  • ControllerTimeout default is 5000
I may Extends More functionality in the future .

Requires Appcompat Library

Example is included.

Events :

  • Player_Ready
  • Player_Error
  • Player_Complete
  • IDLE
  • Buffering
Update Version 1.40
  • FFMPEG Extension is Supported
  • FFmpegavailabe << to check weather ffmpeg is available or not.
  • FFMPEG Initialize Choice during initialization Prefer To use FFMPEGAUDIO Decoding only for now
  • player.Initialize("player", UseFFmpeg as boolean, FFMPEGAUDIO As boolean, FFmpegVideo As Boolean)
Updated Version 1.50
Upgrade to latest exoplayer 2.18.3

Change Log

Updated Version 1.60
  • Upgraded to the latest ExoPlayer 2.18.4 > Change Log
  • Fixed GetvideoFormatwidth, GetvideoFormatHeight when playing media without video it will return -1 if the media doesn't have video.
  • Added Stop method to stop the player.
Updated Version 1.70
  • Upgraded to the latest ExoPlayer 2.18.5
  • Added IDLE EVENT and Buffering Event.
download additional aar to use the latest exoplayer fixes.


  • addoexo-1.40.zip
    22 KB · Views: 174
  • addoexo-1.50.zip
    22 KB · Views: 107
  • addoexo-1.60.zip
    22 KB · Views: 117
  • addoexo-1.70.zip
    22.1 KB · Views: 205
Last edited:


Active Member
Licensed User
Longtime User
Thanks for library,
i need something additional, try add rtmp viewer on layout
i got error on load layout:

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 351)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.pokerlap.pantalla.main._activity_create(main.java:351)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
    at com.pokerlap.pantalla.main.afterFirstLayout(main.java:105)
    at com.pokerlap.pantalla.main.access$000(main.java:17)
    at com.pokerlap.pantalla.main$WaitForLayout.run(main.java:83)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8669)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 15 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/content/res/ResourcesCompat;
    at com.google.android.exoplayer2.ui.StyledPlayerControlView.<init>(StyledPlayerControlView.java:501)
    at com.google.android.exoplayer2.ui.StyledPlayerView.<init>(StyledPlayerView.java:452)
    at com.google.android.exoplayer2.ui.StyledPlayerView.<init>(StyledPlayerView.java:268)
    at com.google.android.exoplayer2.ui.StyledPlayerView.<init>(StyledPlayerView.java:264)
    at com.addo.exoaars.addoexowrapper._initialize(addoexowrapper.java:68)
    ... 18 more
Caused by: java.lang.ClassNotFoundException: androidx.core.content.res.ResourcesCompat
    ... 23 more
*** Service (starter) Create ***
** Service (starter) Destroy (ignored)**


Well-Known Member
Licensed User
Will see about that, but the error indicates that you are missing resourcescompat class which shouldn't be happened the latest b4x android sdk.
Can you attach a sample project to try to reproduce the problem


Active Member
Licensed User
Longtime User
I reinstall B4A with resources updated
but not succes
Thanks for advance
Can you publis a Example project, thanks for yout time.


  • Pantalla.zip
    9.2 KB · Views: 165


Active Member
I reinstall B4A with resources updated
but not succes
Thanks for advance
Can you publis a Example project, thanks for yout time.
I second this, please a small demo file would be great. Want to test if this, but I think I miss ExoRtmpPlayer1.Player .


Active Member
Licensed User

Is it possible to incorporate UDP playback?

Maybe as such.....
  • PlayUDP(videoURL As String)

    e.g.: PlayUDP("udp://@")