danikula/AndroidVideoCache

Cache HLS, Dash or SmoothStreaming?

nano92 opened this issue · 11 comments

Hello, I was wondering if I can implement your library to cache HLS videos. Since it is written in the description that it can add caching support to ExoPlayer, I wanted to know if it was possible. thanks!

@nano92 ExoPlayer hasn't native support for caching direct links. That is why you can use AndroidVideoCache for ExoPlayer. But ExoPlayer has great native support for HLS, SmoothStreaming, Dash. There is no reason to implement it in AndroidVideoCache.

I was trying to cache a HLS video using your library but it can't seem to work. I have implemented the ExoPlayer on my application to play videos. Maybe I'm using wrong your library. Have you tried to cache HLS videos being played by ExoPlayer?

It is impossible to use library for any adaptive streaming technology. You can use it only for direct links on video file. For adaptive streaming use ExoPlayer.

I cannot cache HLS video with ExoPlayer, I was hoping to use your library for that purpose

It is totally impossible.

Oh well, thank you!

AndroidVideoCache is pretty simple. It downloads video file from direct link and saves it as file on a disc. Any streaming protocol is more complex than 'file on internet'. Streaming servers divides file on chunks with different quality , describes them in special metadata and provides these chunks depends on internet channel. Obviously it is possible to implement caching (exoPlayer can) but it will has complex implementation. But I wanna keep my library as simple as possible. The second reason why I don't want implement caching for streaming is that has beean already implemented by Google in exoPlayer.

ojw28 commented

It's worth noting that ExoPlayer does now provide support for caching "file on internet" type media.

@ojw28 can you provide proof link?

ojw28 commented

Support was added in google/ExoPlayer@bd7be1b.
If you hook a CacheDataSource into the DataSource request chain it should "just work".

There's ongoing work/improvements being made to ExoPlayer's caching layer in general:
https://github.com/google/ExoPlayer/commits/dev-v2/library/src/main/java/com/google/android/exoplayer2/upstream/cache

@ojw28 really good news. Thanks. I think it should be mentioned in README.md