File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/player/helper Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import com .google .android .exoplayer2 .source .dash .DashMediaSource ;
1010import com .google .android .exoplayer2 .source .dash .DefaultDashChunkSource ;
1111import com .google .android .exoplayer2 .source .hls .HlsMediaSource ;
12+ import com .google .android .exoplayer2 .source .hls .DefaultHlsExtractorFactory ;
1213import com .google .android .exoplayer2 .source .hls .playlist .DefaultHlsPlaylistTracker ;
1314import com .google .android .exoplayer2 .source .smoothstreaming .DefaultSsChunkSource ;
1415import com .google .android .exoplayer2 .source .smoothstreaming .SsMediaSource ;
16+ import com .google .android .exoplayer2 .extractor .ts .DefaultTsPayloadReaderFactory ;
1517import com .google .android .exoplayer2 .upstream .DataSource ;
1618import com .google .android .exoplayer2 .upstream .DefaultDataSource ;
1719import com .google .android .exoplayer2 .upstream .DefaultHttpDataSource ;
@@ -183,7 +185,9 @@ public DashMediaSource.Factory getYoutubeDashMediaSourceFactory() {
183185 public HlsMediaSource .Factory getYoutubeHlsMediaSourceFactory () {
184186 cacheDataSourceFactoryBuilder .setUpstreamDataSourceFactory (
185187 getYoutubeHttpDataSourceFactory (false , false ));
186- return new HlsMediaSource .Factory (cacheDataSourceFactoryBuilder .build ());
188+ final int payloadReaderFlags = DefaultTsPayloadReaderFactory .FLAG_DETECT_ACCESS_UNITS ;
189+ return new HlsMediaSource .Factory (cacheDataSourceFactoryBuilder .build ())
190+ .setExtractorFactory (new DefaultHlsExtractorFactory (payloadReaderFlags , true ));
187191 }
188192
189193 public ProgressiveMediaSource .Factory getYoutubeProgressiveMediaSourceFactory () {
You can’t perform that action at this time.
0 commit comments