-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to lazy load media source for a playlist in ExoPlayer? #7087
Comments
If you are using the I'm not quite sure what your use case is. It may be the above is not enough. You may also want to look into the ResolvingDataSource which allows you to wait with setting up the end point on a data source level. |
Are there any examples regarding this feature? |
Also, ResolvingDataSource only resolves the DataSpec lazily not the MediaSource itself. |
Can you explain you r use case a little bit? If resolving data source is not sufficient, I reckon that the type of the MediaSource can change between being added to the playlist and starting to play? So you don't know whether it is an adaptive stream (eg. DASH/HSL) or a progressive stream? Like in your steps above the type of MediaSource is not known until step "The app created the media source"? |
So basically I only have basic data about each media in the playlist. F.ex id, title, thumbnails, etc. I don't know anything about the type of the stream until the streaming data is loaded. I would like to load the streaming data lazily upon previous/next. |
In this case I don't think there is something which helps you out of the box. You can look into creating your own Of course you can also only just rely on the |
Thanks for the info. Do you know what apps like YouTube, Spotify does? |
I don't think they have such a requirement because they know beforehand what type of media source to use. They just populate a playlist with a MediaSource of a certain type and a uri. |
Closing due to inactivity. Please reopen if required. |
When filing a question:
[REQUIRED] Searched documentation and issues
[REQUIRED] Question
I would like to lazily load media sources for a playlist. When the user clicks previous/next, then I will call the API to retrieve the streaming URI for the previous/next video in the playlist.
For example:
The text was updated successfully, but these errors were encountered: