Skip to content

Commit

Permalink
feat(DASH): Add manifest.dash.enableFastSwitching config (#6500)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Apr 29, 2024
1 parent 57cb6ad commit 2fc0c93
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion demo/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ shakaDemo.Config = class {
.addBoolInput_('Use stream once in period flattening',
'manifest.dash.useStreamOnceInPeriodFlattening')
.addNumberInput_('override the Update period of dash manifest',
'manifest.dash.updatePeriod');
'manifest.dash.updatePeriod')
.addBoolInput_('Enable fast switching',
'manifest.dash.enableFastSwitching');
}

/** @private */
Expand Down
6 changes: 5 additions & 1 deletion externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,8 @@ shaka.extern.xml.Node;
* enableAudioGroups: boolean,
* multiTypeVariantsAllowed: boolean,
* useStreamOnceInPeriodFlattening: boolean,
* updatePeriod: number
* updatePeriod: number,
* enableFastSwitching: boolean
* }}
*
* @property {string} clockSyncUri
Expand Down Expand Up @@ -995,6 +996,9 @@ shaka.extern.xml.Node;
* manifest less frequently. if you update the value during for a dynamic
* manifest, it will directly trigger a new download of the manifest
* Defaults to <code>-1</code>.
* @property {boolean} enableFastSwitching
* If false, disables fast switching track recognition.
* Defaults to <code>true</code>.
* @exportDoc
*/
shaka.extern.DashManifestConfiguration;
Expand Down
3 changes: 2 additions & 1 deletion lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,8 @@ shaka.dash.DashParser = class {
} else if (schemeId == colourPrimariesScheme ||
schemeId == matrixCoefficientsScheme) {
continue;
} else if (schemeId == 'urn:mpeg:dash:ssr:2023') {
} else if (schemeId == 'urn:mpeg:dash:ssr:2023' &&
this.config_.dash.enableFastSwitching) {
isFastSwitching = true;
} else {
unrecognizedEssentialProperty = true;
Expand Down
1 change: 1 addition & 0 deletions lib/util/player_configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ shaka.util.PlayerConfiguration = class {
multiTypeVariantsAllowed,
useStreamOnceInPeriodFlattening: false,
updatePeriod: -1,
enableFastSwitching: true,
},
hls: {
ignoreTextStreamFailures: false,
Expand Down

0 comments on commit 2fc0c93

Please sign in to comment.