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

Provide cache-aware adaptive track selection #6471

Open
gb103 opened this issue Sep 25, 2019 · 3 comments
Open

Provide cache-aware adaptive track selection #6471

gb103 opened this issue Sep 25, 2019 · 3 comments
Assignees

Comments

@gb103
Copy link

gb103 commented Sep 25, 2019

[REQUIRED] Searched documentation and issues

Looked into release notes and into the issue list in Github

[REQUIRED] Question

While exoplayer is in process of HLS streaming with cache enabled, Due to its adaptive streaming property it caches different quality of chunks based on network condition.
So my question is, if a song is completely cached but in different quality of chunks, is it possible to restrict the player that it should play from cache only, whatever the quality of chunk is present in the cache, irrespective of Network condition.

A full bug report captured from the device

This not about bug, but a functionality support which I need to implement in my use case.

Link to test content

For any HLS media content

@tonihei
Copy link
Collaborator

tonihei commented Sep 25, 2019

That happens automatically when you create your MediaSource with DownloadHelper.createMediaSource. Alternatively, you can do the same manually by passing in the DownloadRequest.streamKeys to MediaSource.Factory.setStreamKeys.

@gb103
Copy link
Author

gb103 commented Sep 26, 2019

@tonihei but I do not have information which quality of segments are cached e.g.
Let's say MASTER file contains 4 quality index files : index_0, index_1, index_2, index_3
and Based on network fluctuations, a user who adopted for AUTO quality mode in streaming, his streaming goes like this for a media which have around 10 segments in its streaming file. -

index_0 -> segment1_0 -> segment2_0 -> segment3_0 -> index_2 ->segment3_2 ->segment4_2 -> segment5_2 ->index_3 -> segment5_3 -> segment6_3 -> segment7_3 -> segment8_3 -> segment8_0 -> segment9_0 -> segment10_0

So Now in cache enabled case, complete song is cached but in different quality, Now I want that if user play this song again it should be played by same set of segments from cache only (no network call should be made even his network is better now ) irrespective of current network conditions.

@tonihei
Copy link
Collaborator

tonihei commented Sep 26, 2019

Thanks for the clarification. The approach mentioned above only makes sense when used with a download cache where you explicitly selected a certain quality for downloading.

Unfortunately, you problem can't be solved out-of-the-box. You may be able to implement that yourself using a custom TrackSelection implementation where you only allow to select tracks that are cached, but we should also look into providing such an option in our default implementation. Marking as an enhancement.

@tonihei tonihei changed the title Feasibility regarding to play the media chunks from cache only if chunks are of different different qualities ? Provide cache-aware adaptive track selection Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants