mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 09:33:33 +00:00
Tried to generalize cacheDataSourceFactory to use cache for items already listened to and items already downloaded
This commit is contained in:
parent
741a28f264
commit
8bf8fab1be
1 changed files with 2 additions and 3 deletions
|
|
@ -96,12 +96,11 @@ public class MultiPlayer implements Playback {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
setSimpleCache(context);
|
setSimpleCache(context);
|
||||||
|
|
||||||
// Create a read-only cache data source factory using the download cache.
|
|
||||||
DataSource.Factory cacheDataSourceFactory = new CacheDataSource.Factory()
|
DataSource.Factory cacheDataSourceFactory = new CacheDataSource.Factory()
|
||||||
.setCache(simpleCache)
|
.setCache(simpleCache)
|
||||||
.setCache(DownloadUtil.getDownloadCache(context))
|
.setCache(DownloadUtil.getDownloadCache(context))
|
||||||
.setUpstreamDataSourceFactory(DownloadUtil.getHttpDataSourceFactory(context))
|
.setUpstreamDataSourceFactory(DownloadUtil.getHttpDataSourceFactory(context));
|
||||||
.setCacheWriteDataSinkFactory(null); // Disable writing.
|
// .setCacheWriteDataSinkFactory(null); // Disable writing.
|
||||||
|
|
||||||
AudioAttributes audioAttributes = new AudioAttributes.Builder()
|
AudioAttributes audioAttributes = new AudioAttributes.Builder()
|
||||||
.setUsage(C.USAGE_MEDIA)
|
.setUsage(C.USAGE_MEDIA)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue