diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 1246d9fdbc..06b1658c5f 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -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: