Skip to content
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

Support lazy preparation in ConcatenatingMediaSource for long playlists #3972

Closed
Khang-NT opened this issue Mar 10, 2018 · 5 comments
Closed
Assignees

Comments

@Khang-NT
Copy link
Contributor

Change request

I found this class is very useful DynamicConcatenatingMediaSource.DeferredTimeline, I think it is reusable, just like DeferredMediaPeriod class. Please make it public.

I need to use DeferredTimeline to create a class called DeferredMediaSource: https://gist.github.com/Khang-NT/985e12e1d73454a79a989165c9bd13fa . This class solves my problem when using DynamicConcatenatingMediaSource, because DynamicConcatenatingMediaSource prepare all child media source immediately, for instance, I have a playlist contains 100 DASH media, DynamicConcatenatingMediaSource will prepare/download 100 manifest file, but I just need to prepare current playing item, and prepare the next position for pre-buffering (similar with #3400)

Version of ExoPlayer being used

2.7.0

@tonihei
Copy link
Collaborator

tonihei commented Mar 12, 2018

I think we can do this as it will also clean up some of the code in the already long DynamicConcatenatingMediaSource class.

More generally, the problem you are trying to solve is actually a useful feature especially for long playlists of DASH, HLS or SmoothStreaming media items where all manifests are downloaded immediately. The downside of not downloading the manifests is that the duration of the item stays unknown until you are beginning to play it. I think it would still be helpful to provide that as an option in the constructor of the DynamicConcatenatingMediaSource (which defaults to immediate child preparation). Assuming we would add such a feature, would you still need access to the DeferredTimeline class? Or would it be enough to leave it internal in this case?

@Khang-NT
Copy link
Contributor Author

The problem above is my only use case of DeferredTimeline. It would be nice if DynamicConcatenatingMediaSource supports to solve that problem officially, then keep DeferredTimeline class as internal up to your design.

@Khang-NT
Copy link
Contributor Author

DynamicConcatenatingMediaSource is deprecated from 2.8.0. @tonihei, Does it support "lazy preparing" now?

@tonihei
Copy link
Collaborator

tonihei commented May 21, 2018

Not yet, sorry. It has just been merged with the existing ConcatenatingMediaSource because they had an almost identical feature set.

@tonihei tonihei changed the title Expose DynamicConcatenatingMediaSource.DeferredTimeline class Support lazy preparation in ConcatenatingMediaSource for long playlists Jun 1, 2018
ojw28 pushed a commit that referenced this issue Jun 5, 2018
This adds an optional parameter to ConcatenatingMediaSource to prepare
child sources only lazily when are needed. This is helpful for long playlists
of media sources with manifests to prevent a lot of simultaneous manifest
loads.

Issue:#3972

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198855676
@tonihei
Copy link
Collaborator

tonihei commented Jun 21, 2018

Now available with the commit referenced above.

@tonihei tonihei closed this as completed Jun 21, 2018
@google google locked and limited conversation to collaborators Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants