Skip to content

Commit

Permalink
Add support for HLS videos caching on android (#4272)
Browse files Browse the repository at this point in the history
* Add support for HLS videos caching on android
  • Loading branch information
IslamRustamov authored Nov 15, 2024
1 parent de81829 commit d277c5e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1161,8 +1161,14 @@ private MediaSource buildMediaSource(Uri uri, String overrideExtension, DrmSessi
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:
Expand Down

0 comments on commit d277c5e

Please sign in to comment.