chore: rework bufferConfig to make it more generic and reduce ReactExoplayerView code size (#3739)

This commit is contained in:
Olivier Bouillet
2024-05-06 22:04:40 +02:00
committed by GitHub
parent e05da4e9fe
commit 8eb31e82c7
4 changed files with 104 additions and 70 deletions

View File

@@ -15,7 +15,7 @@ object RNVSimpleCache {
var cacheDataSourceFactory: DataSource.Factory? = null
fun setSimpleCache(context: Context, cacheSize: Int, factory: HttpDataSource.Factory) {
if (cacheDataSourceFactory != null || cacheSize == 0) return
if (cacheDataSourceFactory != null || cacheSize <= 0) return
simpleCache = SimpleCache(
File(context.cacheDir, "RNVCache"),
LeastRecentlyUsedCacheEvictor(