fix(android): disable caching on local asset files (#4304)

This commit is contained in:
Olivier Bouillet
2024-12-01 13:29:24 +01:00
committed by GitHub
parent 569a79c510
commit 63c592f7cd
6 changed files with 24 additions and 2 deletions

View File

@@ -747,7 +747,7 @@ public class ReactExoplayerView extends FrameLayout implements
// Initialize core configuration and listeners
initializePlayerCore(self);
}
if (source.getBufferConfig().getCacheSize() > 0) {
if (!source.isLocalAssetFile() && !source.isAsset() && source.getBufferConfig().getCacheSize() > 0) {
RNVSimpleCache.INSTANCE.setSimpleCache(
this.getContext(),
source.getBufferConfig().getCacheSize()
@@ -1186,7 +1186,7 @@ public class ReactExoplayerView extends FrameLayout implements
DataSource.Factory assetDataSourceFactory = DataSourceUtil.buildAssetDataSourceFactory(themedReactContext, uri);
mediaSourceFactory = new ProgressiveMediaSource.Factory(assetDataSourceFactory);
} catch (Exception e) {
throw new IllegalStateException("cannot open input file" + uri);
throw new IllegalStateException("cannot open input file:" + uri);
}
} else if ("file".equals(uri.getScheme()) ||
!useCache) {