Add support for HLS videos caching on android (#4272)

* Add support for HLS videos caching on android
This commit is contained in:
Islam 2024-11-15 23:18:25 +03:00 committed by GitHub
parent de81829d73
commit d277c5e946
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1161,8 +1161,14 @@ public class ReactExoplayerView extends FrameLayout implements
throw new IllegalStateException("HLS is not enabled!");
}
DataSource.Factory dataSourceFactory = mediaDataSourceFactory;
if (useCache) {
dataSourceFactory = RNVSimpleCache.INSTANCE.getCacheFactory(buildHttpDataSourceFactory(true));
}
mediaSourceFactory = new HlsMediaSource.Factory(
mediaDataSourceFactory
dataSourceFactory
).setAllowChunklessPreparation(source.getTextTracksAllowChunklessPreparation());
break;
case CONTENT_TYPE_OTHER: