ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

How to pre-cache HLS adaptive stream?

Open Aryan-dvlp2 opened this issue 3 years ago • 0 comments

I am trying to pre-cache/pre-buffer HLS videos to my app. I used CacheWriter to cache the (.mp4) file, But it was not able to cache segments of HLS video. Basically, I have only URL of the master playlist file which has media playlists of different qualities, and that each media playlist has segments (.ts).

So, I have to cache the master playlist and any one media playlist and then some segments and play the cached media to Exoplayer. how can I cache these? I also visited https://github.com/google/ExoPlayer/issues/9337 But this does not have any example to do so.

This is how I cached .mp4 by CacheWriter

    CacheWriter cacheWriter = new CacheWriter( mCacheDataSource,
                        dataSpec,
                        null,
                        progressListener);

    cacheWriter.cache();

Aryan-dvlp2 avatar Sep 19 '22 07:09 Aryan-dvlp2