mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
DASH: Stop interpreting main track role as SELECTION_FLAG_DEFAULT
The `main` role distinguishes a track from an `alternate`, but unlike `SELECTION_FLAG_DEFAULT` it doesn't imply the track should be selected unless user preferences state otherwise. e.g. in the case of a text track, the player shouldn't enable subtitle rendering just because a `main` text track is present in the manifest. The `main`/`alternate` distinction is still available through `Format.roleFlags` and the `ROLE_FLAG_MAIN` and `ROLE_FLAG_ALTERNATE` values. This behaviour was originally [added in 2.2.0](7f967f3057), however at the time the `C.RoleFlags` IntDef did not exist. The IntDef was [added in 2.10.0](a86a9137be). PiperOrigin-RevId: 418937747
This commit is contained in:
parent
47f4d90515
commit
5370332fcc
4 changed files with 4 additions and 3 deletions
|
|
@ -59,6 +59,7 @@
|
||||||
* DASH:
|
* DASH:
|
||||||
* Support the `forced-subtitle` track role
|
* Support the `forced-subtitle` track role
|
||||||
([#9727](https://github.com/google/ExoPlayer/issues/9727)).
|
([#9727](https://github.com/google/ExoPlayer/issues/9727)).
|
||||||
|
* Stop interpreting the `main` track role as `C.SELECTION_FLAG_DEFAULT`.
|
||||||
* HLS:
|
* HLS:
|
||||||
* Use chunkless preparation by default to improve start up time. If your
|
* Use chunkless preparation by default to improve start up time. If your
|
||||||
renditions contain muxed closed-caption tracks that are *not* declared
|
renditions contain muxed closed-caption tracks that are *not* declared
|
||||||
|
|
|
||||||
|
|
@ -1472,8 +1472,6 @@ public class DashManifestParser extends DefaultHandler
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case "main":
|
|
||||||
return C.SELECTION_FLAG_DEFAULT;
|
|
||||||
case "forced_subtitle":
|
case "forced_subtitle":
|
||||||
// Support both hyphen and underscore (https://github.com/google/ExoPlayer/issues/9727).
|
// Support both hyphen and underscore (https://github.com/google/ExoPlayer/issues/9727).
|
||||||
case "forced-subtitle":
|
case "forced-subtitle":
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,8 @@ public class DashManifestParserTest {
|
||||||
assertThat(format.containerMimeType).isEqualTo(MimeTypes.APPLICATION_RAWCC);
|
assertThat(format.containerMimeType).isEqualTo(MimeTypes.APPLICATION_RAWCC);
|
||||||
assertThat(format.sampleMimeType).isEqualTo(MimeTypes.APPLICATION_CEA608);
|
assertThat(format.sampleMimeType).isEqualTo(MimeTypes.APPLICATION_CEA608);
|
||||||
assertThat(format.codecs).isEqualTo("cea608");
|
assertThat(format.codecs).isEqualTo("cea608");
|
||||||
assertThat(format.roleFlags).isEqualTo(C.ROLE_FLAG_SUBTITLE);
|
assertThat(format.roleFlags).isEqualTo(C.ROLE_FLAG_SUBTITLE | C.ROLE_FLAG_MAIN);
|
||||||
|
assertThat(format.selectionFlags).isEqualTo(0);
|
||||||
assertThat(adaptationSets.get(0).type).isEqualTo(C.TRACK_TYPE_TEXT);
|
assertThat(adaptationSets.get(0).type).isEqualTo(C.TRACK_TYPE_TEXT);
|
||||||
|
|
||||||
format = adaptationSets.get(1).representations.get(0).format;
|
format = adaptationSets.get(1).representations.get(0).format;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
</SegmentTemplate>
|
</SegmentTemplate>
|
||||||
<AdaptationSet id="0" mimeType="application/x-rawcc" subsegmentAlignment="true">
|
<AdaptationSet id="0" mimeType="application/x-rawcc" subsegmentAlignment="true">
|
||||||
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="subtitle"/>
|
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="subtitle"/>
|
||||||
|
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
|
||||||
<Representation id="0" codecs="cea608" bandwidth="16">
|
<Representation id="0" codecs="cea608" bandwidth="16">
|
||||||
<BaseURL>https://test.com/0</BaseURL>
|
<BaseURL>https://test.com/0</BaseURL>
|
||||||
</Representation>
|
</Representation>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue