Excellent tutorial! Thank you! How do we add our own remote URL as the data source for the videos?
@ddjermanovic Can you please help with this when you get a chance? Thank you - much appreciated! :]
Hi @iknowzo, Thank you. Iโm glad you like it. :]
Iโm not sure what you mean by โour own remote URLโ. In the tutorial, videos are fetched from Cloudinary, and weโre are explicitly creating a URL to the videos in the MainActivity
s createVideoUrl
method, which you can check out if you download materials for the project.
That URL is passed to the MediaPlayerImpl
class which a wrapper around ExoPlayer implementation. In the play
method of the MediaPlayerImpl
media source is created like this:
val mediaSource = ExtractorMediaSource.Factory(DefaultDataSourceFactory(context, userAgent))
.setExtractorsFactory(DefaultExtractorsFactory())
.createMediaSource(Uri.parse(url))
createMediaSource
method is used for setting the URL from which videos are fetched. You can specify here any remote URL that contains video.
I hope this answers your question. :]
This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!