mirror of
https://github.com/samsonjs/media.git
synced 2026-04-17 13:15:47 +00:00
Remove usages of deprecated CacheDataSourceFactory
PiperOrigin-RevId: 307684243
This commit is contained in:
parent
4abaaf138c
commit
6f2891e5c4
2 changed files with 5 additions and 8 deletions
|
|
@ -52,7 +52,7 @@ public final class CacheDataSourceFactory implements DataSource.Factory {
|
|||
cache,
|
||||
upstreamFactory,
|
||||
new FileDataSource.Factory(),
|
||||
new CacheDataSinkFactory(cache, CacheDataSink.DEFAULT_FRAGMENT_SIZE),
|
||||
new CacheDataSink.Factory().setCache(cache),
|
||||
flags,
|
||||
/* eventListener= */ null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,9 @@ import com.google.android.exoplayer2.source.dash.manifest.DashManifest;
|
|||
import com.google.android.exoplayer2.source.dash.manifest.Representation;
|
||||
import com.google.android.exoplayer2.source.dash.offline.DashDownloader;
|
||||
import com.google.android.exoplayer2.testutil.HostActivity;
|
||||
import com.google.android.exoplayer2.upstream.DataSource;
|
||||
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
|
||||
import com.google.android.exoplayer2.upstream.DummyDataSource;
|
||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory;
|
||||
import com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor;
|
||||
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
|
|
@ -56,8 +55,8 @@ public final class DashDownloadTest {
|
|||
private DashTestRunner testRunner;
|
||||
private File tempFolder;
|
||||
private SimpleCache cache;
|
||||
private DefaultHttpDataSourceFactory httpDataSourceFactory;
|
||||
private CacheDataSourceFactory offlineDataSourceFactory;
|
||||
private DataSource.Factory httpDataSourceFactory;
|
||||
private DataSource.Factory offlineDataSourceFactory;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
@ -71,9 +70,7 @@ public final class DashDownloadTest {
|
|||
tempFolder = Util.createTempDirectory(testRule.getActivity(), "ExoPlayerTest");
|
||||
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
|
||||
httpDataSourceFactory = new DefaultHttpDataSourceFactory("ExoPlayer", null);
|
||||
offlineDataSourceFactory =
|
||||
new CacheDataSourceFactory(
|
||||
cache, DummyDataSource.FACTORY, CacheDataSource.FLAG_BLOCK_ON_CACHE);
|
||||
offlineDataSourceFactory = new CacheDataSource.Factory().setCache(cache);
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
|||
Loading…
Reference in a new issue