B4A Library addoMedia3 - AndroidX Media3 Exoplayer Wrapper

This library is wrapper for the new AndroidX Media3 Library which is based on Exoplayer You can still use my previous wrapper.
Since from now on the new updates and releases will be Published to AndroidX Media3 Library. so i migrate the whole wrapper to the new codebase.

Version 1.00 required aar.
Additional AAR 1.0.1

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
  • Media3PlayerView
  • ResizeMode [FIT|FIXED_HEIGHT|FIXED_WIDTH]
  • UseController default is true
  • ShowBuffering [NEVER|PLAYING|ALWAYS] default is NEVER
  • ControllerTimeout default is 5000
Events :
  • Player_Ready
  • Player_Error
  • Player_Complete
  • IDLE
  • Buffering
i might add new feature Related to FFmpeg Decoder in future Release.
Library and Example attached. Don't forget to download the required media3 aars, have a good day.
 

Attachments

  • addoMedia3-Lib.zip
    22.6 KB · Views: 104
Last edited:

Almora

Active Member
Licensed User
Longtime User
... with package name com.google.android.exoplayer2, will soon be discontinued, so to continue receiving updates, you will need to migrate to Media3 ExoPlayer.

 
Last edited:

Enxix

Member
Hello, The bookstore is appreciated. I was using the previous wrapper and I really like it a lot.
The only thing I see (and it is in almost all libraries is that we cannot instantiate the exoplayer2 object) this is so that if in the future we want to extend your library through javaobject or reflection , it will be easier for us.
Could you add the request?
 

Sjuanj

Member
Hello, thanks for sharing this library.
I have some dash links that are encrypted with drm, I have the keyid and the key, but I don't know how I could get into this library.
I know that exoplayer works with these links because I know some apks that work well.
Here it says how to do it with exoplayer: https://github.com/google/ExoPlayer/issues/3201

Can someone guide me how I could do it with b4a?
Thank you
 

Enxix

Member
Hello, The bookstore is appreciated. I was using the previous wrapper and I really like it a lot.
The only thing I see (and it is in almost all libraries is that we cannot instantiate the exoplayer2 object) this is so that if in the future we want to extend your library through javaobject or reflection , it will be easier for us.
Could you add the request?
Sorry to be pushy but I use your library and I would like you to modify it to be able to access the Exoplayer object. that you must have it with @Hide set, that's why I can't access it
 

Addo

Well-Known Member
Licensed User
Hello, thanks for sharing this library.
I have some dash links that are encrypted with drm, I have the keyid and the key, but I don't know how I could get into this library.
I know that exoplayer works with these links because I know some apks that work well.
Here it says how to do it with exoplayer: https://github.com/google/ExoPlayer/issues/3201

Can someone guide me how I could do it with b4a?
Thank you
what kind of solution you are referring to ?
 

Sjuanj

Member
what kind of solution you are referring to ?
Thanks for the reply

I am using google translator, I hope it is understood well.

Dash files (*.mpd) may have drm ( digital rights management ) protection. There are several types: widevine (Netflix, Disney+, Amazon Prime Video...), or clearkey (dazn, movistar+...).

With very few lines of code it can be implemented in exoplayer with android studio, I suppose it wouldn't be very difficult to do it in b4a, because I already told you that there is very little code to put on it. That would make our apks very attractive...

I leave you the link of an apk that works with clearkey so you can see how easy it is (at least it seems so to me, but my knowledge of creating a b4a library is very limited)


Thanks for your time.
 

nedium

Member
Licensed User
hello @Addo

I have been following your work for a long time, I wanted to know if the previous library (Exoplayer 2.18.5 Streams Player), will cease to exist and I must migrate everything to this new library.

It is to know if I should migrate everything, since this library is better and has better functions, (It does not cost me anything to migrate)

thanks for your time.
 
Last edited:

Addo

Well-Known Member
Licensed User
hello @Addo

I have been following your work for a long time, I wanted to know if the previous library (Exoplayer 2.18.5 Streams Player), will cease to exist and I must migrate everything to this new library.

It is to know if I should migrate everything, since this library is better and has better functions, (It does not cost me anything to migrate)

thanks for your time.
This library will be the future library for Exoplayer. I put in consideration to add ffmpeg to it in next release. I am just not available as before due to some circumstances in real life. How ever i will be back soon to release even more libraries. Although will take reading meta data into consideration.
 

nedium

Member
Licensed User
This library will be the future library for Exoplayer. I put in consideration to add ffmpeg to it in next release. I am just not available as before due to some circumstances in real life. How ever i will be back soon to release even more libraries. Although will take reading meta data into consideration.
Hello, thank you very much for answering.
Considering that in the future it will be the exoplayer library, I will update to this version.
I hope to see you here soon and that everything goes well.
Thank you very much for your time and work. good day
 

nedium

Member
Licensed User
Hello

Error: androidx.media3.datasource.HttpDataSource$HttpDataSourceException: javax.net.ssl.SSLPeerUnverifiedException: Hostname NAMEHOST not verified:
or
Error: androidx.media3.datasource.HttpDataSource$HttpDataSourceException: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Is there a way to bypass the certificate validation? or accept it
 
Last edited:
Top