本文整理了Java中com.google.android.exoplayer2.util.Util.createTempDirectory()
方法的一些代码示例,展示了Util.createTempDirectory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.createTempDirectory()
方法的具体详情如下:
包路径:com.google.android.exoplayer2.util.Util
类名称:Util
方法名:createTempDirectory
[英]Creates an empty directory in the directory returned by Context#getCacheDir().
[中]在上下文#getCacheDir()返回的目录中创建空目录。
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
cacheDir = Util.createTempDirectory(RuntimeEnvironment.application, "ExoPlayerTest");
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
when(cache.addListener(anyString(), any(Cache.Listener.class))).thenReturn(new TreeSet<>());
tracker = new CachedRegionTracker(cache, CACHE_KEY, CHUNK_INDEX);
cacheDir = Util.createTempDirectory(RuntimeEnvironment.application, "ExoPlayerTest");
index = new CachedContentIndex(cacheDir);
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
tempFolder = Util.createTempDirectory(RuntimeEnvironment.application, "ExoPlayerTest");
file = new File(tempFolder, "atomicFile");
atomicFile = new AtomicFile(file);
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
tempFolder = Util.createTempDirectory(RuntimeEnvironment.application, "ExoPlayerTest");
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
cacheDir =
Util.createTempDirectory(InstrumentationRegistry.getTargetContext(), "ExoPlayerTest");
index = new CachedContentIndex(cacheDir);
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
mockCache.init();
tempFolder = Util.createTempDirectory(RuntimeEnvironment.application, "ExoPlayerTest");
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
cacheDir =
Util.createTempDirectory(InstrumentationRegistry.getTargetContext(), "ExoPlayerTest");
index = new CachedContentIndex(cacheDir);
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
testDataUri = Uri.parse("test_data");
fixedCacheKey = CacheUtil.generateKey(testDataUri);
expectedCacheKey = fixedCacheKey;
cacheKeyFactory = dataSpec -> CACHE_KEY_PREFIX + "." + CacheUtil.generateKey(dataSpec.uri);
tempFolder = Util.createTempDirectory(RuntimeEnvironment.application, "ExoPlayerTest");
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
dummyMainThread = new DummyMainThread();
Context context = RuntimeEnvironment.application;
tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
File cacheFolder = new File(tempFolder, "cache");
cacheFolder.mkdir();
cache = new SimpleCache(cacheFolder, new NoOpCacheEvictor());
MockitoAnnotations.initMocks(this);
fakeDataSet =
new FakeDataSet()
.setData(TEST_MPD_URI, TEST_MPD)
.setRandomData("audio_init_data", 10)
.setRandomData("audio_segment_1", 4)
.setRandomData("audio_segment_2", 5)
.setRandomData("audio_segment_3", 6)
.setRandomData("text_segment_1", 1)
.setRandomData("text_segment_2", 2)
.setRandomData("text_segment_3", 3);
fakeStreamKey1 = new StreamKey(0, 0, 0);
fakeStreamKey2 = new StreamKey(0, 1, 0);
actionFile = new File(tempFolder, "actionFile");
createDownloadManager();
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
tempFolder = Util.createTempDirectory(RuntimeEnvironment.application, "ExoPlayerTest");
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
fakeDataSet =
new FakeDataSet()
.setData(MASTER_PLAYLIST_URI, MASTER_PLAYLIST_DATA)
.setData(MEDIA_PLAYLIST_1_URI, MEDIA_PLAYLIST_DATA)
.setRandomData(MEDIA_PLAYLIST_1_DIR + "fileSequence0.ts", 10)
.setRandomData(MEDIA_PLAYLIST_1_DIR + "fileSequence1.ts", 11)
.setRandomData(MEDIA_PLAYLIST_1_DIR + "fileSequence2.ts", 12)
.setData(MEDIA_PLAYLIST_2_URI, MEDIA_PLAYLIST_DATA)
.setRandomData(MEDIA_PLAYLIST_2_DIR + "fileSequence0.ts", 13)
.setRandomData(MEDIA_PLAYLIST_2_DIR + "fileSequence1.ts", 14)
.setRandomData(MEDIA_PLAYLIST_2_DIR + "fileSequence2.ts", 15);
}
代码示例来源:origin: google/ExoPlayer
@Before
public void setUp() throws Exception {
testRunner =
new DashTestRunner(TAG, testRule.getActivity(), getInstrumentation())
.setManifestUrl(DashTestData.H264_MANIFEST)
.setFullPlaybackNoSeeking(true)
.setCanIncludeAdditionalVideoFormats(false)
.setAudioVideoFormats(
DashTestData.AAC_AUDIO_REPRESENTATION_ID, DashTestData.H264_CDD_FIXED);
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);
}
代码示例来源:origin: google/ExoPlayer
dummyMainThread = new DummyMainThread();
context = RuntimeEnvironment.application;
tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
内容来源于网络,如有侵权,请联系作者删除!