google / google/ExoPlayer

Possible to use FLAG_ALLOW_NON_IDR_KEYFRAMES with DefaultMediaSourceFactory for HLS?

Open
#9,395 2 comments 0 reactions 1 assignee Claimed by @marcbaechinger View on GitHub
enhancement
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

I'm porting code from 2.11, which used to set `FLAG_ALLOW_NON_IDR_KEYFRAMES` flag for both HLS and progressive media sources. I'm trying to translate that into the new `MediaItem` system. In particular, whether it's possible to use `DefaultMediaSourceFactory`.

AFAIK, I could provide a reconfigured `DefaultExtractorsFactory` to `DefaultMediaSourceFactory` constructor to cover the progress media. But I don't see a way to set the flag `FLAG_ALLOW_NON_IDR_KEYFRAMES` for HLS streams. Is this possible?

Note, the equivalent code in 2.11 looked like the following:
```
DefaultHlsExtractorFactory hlsExtractorFactory = new DefaultHlsExtractorFactory(
DefaultTsPayloadReaderFactory.FLAG_ALLOW_NON_IDR_KEYFRAMES, true);
return new HlsMediaSource.Factory(dataSourceFactory)
.setExtractorFactory(hlsExtractorFactory)
.setDrmSessionManager(drmSessionManager)
.createMediaSource(uri);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.