Open cy41 opened 2 years ago
You are right that CacheUtil
has been replaced with CacheWriter
with 2.12.0 (see release notes). As far as I know this is a drop-in replacement that offers the same API or at least the same functionality. Let me know if you see issues with that.
I think the partial preloading you are doing still needs to be done programmatically even with the DownloadService
and the components that are used by the service. You don't want to create notifications telling the user that some parts are downloaded. That's something you want to do under the hood as you do it already. The DownloadService
is used to provide offline functionality rather then technical caching to improve performance when starting a stream.
You are right that
CacheUtil
has been replaced withCacheWriter
with 2.12.0 (see release notes). As far as I know this is a drop-in replacement that offers the same API or at least the same functionality. Let me know if you see issues with that.I think the partial preloading you are doing still needs to be done programmatically even with the
DownloadService
and the components that are used by the service. You don't want to create notifications telling the user that some parts are downloaded. That's something you want to do under the hood as you do it already. TheDownloadService
is used to provide offline functionality rather then technical caching to improve performance when starting a stream.
Thanks for your reply! My App is a auto play video app, like tiktok. And it run on some low performance device; The device limits the maximum amount of writes the app can write to disk. So my scenes is play current video, and preload next video a little data. And this device limit app can not use Service. I found DownloadManager has some great api to manage preload, but I don't know how to use it like use CacheWriter.
I don't understand how using the DownloadManager
would help with the limited writes on disc on these devices. Under the hood, the DownloadManager
is using CahceWriter
as well. So directly using ther CacheWriter
is not an issue I think.
Background
In my project, I use ExoPlayer with version 2.11.8 . In this version, I use CacheUtil cache some range data to improve first frame time. sample code like this:
In this month, I upgrade ExoPlayer version to 2.15.0 . The "CacheUtil" was removed, I replace it with "CacheWriter". And In other withe, I found a high-level API "DownloadManager", but I don't know how to use it in my project to implement preload or download some range data.