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


DesignerProperties

  • SPlayerView
  • ResizeMode [FIT|FIXED_HEIGHT|FIXED_WIDTH]
  • 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)
  • FFMPEG AUDIO AND VIDEO Decoder
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.
 

Attachments

  • addoexo-1.40.zip
    22 KB · Views: 444
  • addoexo-1.50.zip
    22 KB · Views: 326
  • addoexo-1.60.zip
    22 KB · Views: 365
  • addoexo-1.70.zip
    22.1 KB · Views: 682
Last edited:

Addo

Well-Known Member
Licensed User
Longtime User
Do it more than one time, stream1, stream2, stream1, stream2... and sooner or later should give you an error... at least, here happens (with mi9tpro, x86emulator and a generic android 8.0 device).
Will give it a deep look probably your case implies that something is happening between the stream and the player during reading the stream or the server that holds the stream have some limitations hard to say now probably i can take more deep look in the morning will see.
 

Addo

Well-Known Member
Licensed User
Longtime User
Do it more than one time, stream1, stream2, stream1, stream2... and sooner or later should give you an error... at least, here happens (with mi9tpro, x86emulator and a generic android 8.0 device).
Now I am 100% sure that the issue lies to the server that you are keep requesting those media From, AS I SAID IT IS A LIMITATION OF THE SERVER THAT HOLDS YOUR MEDIA. it does not related to EXOPLAYER or even the wrapper. just tried with other streams on my own server and it does work normally even with the bad design button clicks. please next time post an issue related to the wrapper or even the exoplayer itself so we can avoid this kind of confusion. Your example with Different Videos From YouTube. those links in the example will expire sooner or later so try with other streams..
 

Attachments

  • ExoPlayerTest.zip
    13.5 KB · Views: 275
Last edited:

Zero7

Member
Now I am 100% sure that the issue lies to the server that you are keep requesting those media From, AS I SAID IT IS A LIMITATION OF THE SERVER THAT HOLDS YOUR MEDIA. it does not related to EXOPLAYER or even the wrapper. just tried with other streams on my own server and it does work normally even with the bad design button clicks. please next time post an issue related to the wrapper or even the exoplayer itself so we can avoid this kind of confusion. Your example with Different Videos From YouTube. those links in the example will expire sooner or later so try with other streams..
I don't want to contradict what you said about the server, but this is already tested and works just fine. I did a test in Android x86 emulator with Dream Player IPTV app with the links I sent to you in the project and others more to test, and is works ALWAYS, even changing fast from one channel to another. The Dream Player IPTV is using ExoPlayer as video engine. That's told me that the problem is NOT in the server.

You cannot fix it, that's no a problem, you're doing it for free for all of us... thank you for this and to try to fix it anyway. I will not disturb you more with this.

PS: Your project works ALWAYS with these kind of links and with the type of stream type.
 

Addo

Well-Known Member
Licensed User
Longtime User
I don't want to contradict what you said about the server, but this is already tested and works just fine. I did a test in Android x86 emulator with Dream Player IPTV app with the links I sent to you in the project and others more to test, and is works ALWAYS, even changing fast from one channel to another. The Dream Player IPTV is using ExoPlayer as video engine. That's told me that the problem is NOT in the server.

You cannot fix it, that's no a problem, you're doing it for free for all of us... thank you for this and to try to fix it anyway. I will not disturb you more with this.

PS: Your project works ALWAYS with these kind of links and with the type of stream type.
I will repeat myself again.THIS IS NOT AN ISSUE WITH Exoplayer or even related to the Wrapper now you claim that what you so called an issue is now WORKING, There is nothing to be fixed here neither for Exoplayer source or even for the Wrapper, with that being said the issue lies in your server that holds your media and its limitations to handle requests thats why when put a sleep or even wait for is always plays those media..and lastly next comments should be related to a valuable issues related to the Wrapper, not a discussion about what you so called unable of fixing some illusion that you face.
 

Enxix

Member
Hello, I want to add one more functionality to the library through javaobject but when I do it gives me an error.
I want to know how I get the instance of the exoplayer that you are using.

java.lang.RuntimeException: Method: setLoadControl not found in: com.addo.exoplayerwrapper.SPlayer

obviously om.addo.exoplayerwrapper.SPlayer is not the class I want to instantiate but the one of the exoplayer. You understand me?
 

nedium

Active Member
Licensed User
Longtime User
Hello @PassionDEV,

I wanted to ask if there is a way to get the meta data that can be obtained by any url that can be played (name, image and current stream, or whatever data it might have).
As always thank you very much for your time.

example
 

amer bashar

Member
Licensed User
Please is there any way to change the buffer value? I have to start playing the stream faster therefor it must be less buffer size
I tried this on exoplayer and it didn`t helped
thank you
 

RobertG ChuriónR

Member
Licensed User
Sorry for writing until now, but I would appreciate if you could help me find a way to display the video in mp2v format, the mp2a audio works fine but it does not display the mp2v video, how could I do it? Thank you very much for your kind attention.
 

20353841

Member
Licensed User
Longtime User
B4X:
Player.GetAudioTracksLanguages
Player.GetVideoTrackSubtitles
The language output using the above code is inaccurate.

I try this code:
B4X:
Dim jo As JavaObject = Player
Dim TrackGroups As JavaObject = jo.GetFieldJO("player").RunMethod("getCurrentTrackGroups", Null)
For i = 0 To TrackGroups.GetField("length") - 1
    Dim TrackGroup As JavaObject = TrackGroups.RunMethod("get", Array(i))
    For j = 0 To TrackGroup.GetField("length") - 1
        Dim Format As JavaObject = TrackGroup.RunMethodJO("getFormat", Array(j))
        Log(Format)
        Log(Format.GetField("label") & ":" & Format.GetField("sampleMimeType")) '音轨和字幕语言名称
        Log(Format.GetField("id") )
    Next
Next
This can output the correct language name.but how can i "setPreferredTextLanguage" by label language or trackID?
 

Addo

Well-Known Member
Licensed User
Longtime User
How to rotate video to 90/270/180?
Will add this feature in the next release of addomedia3 exoplayer. You should use it as it will have the future updates.

 

20353841

Member
Licensed User
Longtime User
Will add this feature in the next release of addomedia3 exoplayer. You should use it as it will have the future updates.

Wow, thank you very much. Your library is very powerful, and we look forward to the next version also being able to select audio tracks and subtitles by index.
 

Addo

Well-Known Member
Licensed User
Longtime User
Wow, thank you very much. Your library is very powerful, and we look forward to the next version also being able to select audio tracks and subtitles by index.
Lib Updated.
 
Top