-
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
Is there a way to download metadata (duration) for all MediaItems in a playlist? #7978
Comments
I just found this: |
Yes, it's the intended default behaviour to prepare lazily. You can change this by setting
in this case all media items are prepared as soon as you add them to the playlist. As soon as an media source that is created for an item has preparation completed, a Like you mentioned, lazy preparation is enabled by default because this would cause an initial burst of network requests. If your playlist is short that may be acceptable for your app. |
:) We just cross posted. That should work though. That's not a known limitation. That would be a bug if not working. I'll look into that :) |
Thanks for the fast answer!!! Much appreciated. I will have another look into the Issue I am having with the progressive source. |
I created a playlist with 4 items. With the default configuration the first two items are prepared initially (the media is quite short that's why the second item is prepared as well). But then it waits until playback advances to prepare the third and fourth item. The third item is prepared after about 69 seconds:
When setting
The logs (printed by If you see a different behaviour, can you add the |
I was able to reproduce my observed behaviour in the plain ExoPlayer with the these two
And Duration is only available shortly before switching to the next source. Here is the log you requested, hope that helps. 🙂 |
Seems like my media was too short and my sample was misleading. Sorry about this. You are right. For progressive media sources, the first real media period needs to be prepared. This does not happen at the preparation time of the source. Only adaptive media have the duration available immediately at source preparation. I'm sorry for any inconvenience caused. We have issue #4727 which covers this limitation already. It is marked as an enhancement for this. Like the comment here in the |
Thanks @marcbaechinger, this helped me out a lot. The workaround propposed in the issue might work for us as well. 👍 |
Searched documentation and issues
StackOverflow, Issues, Documentation, Blog
Question
When loading/playing a playlist using the new playlist api introduced in 2.12.0, only data for the first item is loaded up until a few seconds before the transition to the next item happens.
Window.durationMs
from the second item staysC.TIME_UNSET
until this point.While this is perfectly fine for most applications, I do need the duration of all
MediaItem
s in the playlist upon loading.This leads me to the question if there is any way to configure the loading behaviour of a playlist to include the duration (manifest?) of all items right at the beginning?
The text was updated successfully, but these errors were encountered: