Skip to content

feat(DASH): Remove multiTypeVariantsAllowed config and add support for it on all browsers #8858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8fde7b3
feat(DASH): Remove multiTypeVariantsAllowed config and add support fo…
avelad Jul 9, 2025
4538a0c
Merge branch 'main' into multiTypeVariantsAllowed
avelad Jul 10, 2025
75b664b
feat(DASH): Remove multiTypeVariantsAllowed config and add support fo…
avelad Jul 10, 2025
0d6e62c
Merge branch 'main' into multiTypeVariantsAllowed
avelad Jul 10, 2025
8eb7b70
Merge branch 'main' into multiTypeVariantsAllowed
avelad Jul 10, 2025
19c7a6b
feat(DASH): Remove multiTypeVariantsAllowed config and add support fo…
avelad Jul 10, 2025
ec2f4f3
feat(DASH): Remove multiTypeVariantsAllowed config and add support fo…
avelad Jul 11, 2025
49071c7
Merge branch 'main' into multiTypeVariantsAllowed
avelad Jul 11, 2025
3d6331b
Merge branch 'main' into multiTypeVariantsAllowed
avelad Jul 11, 2025
06a230f
feat(DASH): Remove multiTypeVariantsAllowed config and add support f…
avelad Jul 11, 2025
d49bf59
feat(DASH): Remove multiTypeVariantsAllowed config and add support f…
avelad Jul 11, 2025
dea0681
Add integration test
avelad Jul 11, 2025
5c6d581
Fix lint
avelad Jul 11, 2025
be12489
fix
avelad Jul 11, 2025
4b22212
Update
avelad Jul 11, 2025
3b5c9e0
Move crossboundary code to streaming engine
avelad Jul 11, 2025
b838e7d
More updates
avelad Jul 11, 2025
74d958a
fix lint
avelad Jul 11, 2025
79cb055
Add a new case
avelad Jul 11, 2025
e650ed0
Rename to crossBoundaryEventManager_
avelad Jul 14, 2025
69639b9
Add comment
avelad Jul 14, 2025
5d84433
Fix some tests
avelad Jul 14, 2025
81f8aba
Fix lint
avelad Jul 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions demo/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ shakaDemo.Config = class {
'manifest.dash.ignoreEmptyAdaptationSet')
.addBoolInput_('Ignore DASH maxSegmentDuration',
'manifest.dash.ignoreMaxSegmentDuration')
.addBoolInput_('Allow DASH multi type variants',
'manifest.dash.multiTypeVariantsAllowed')
.addTextInput_('Clock Sync URI', 'manifest.dash.clockSyncUri')
.addBoolInput_('Ignore Min Buffer Time',
'manifest.dash.ignoreMinBufferTime')
Expand Down
12 changes: 0 additions & 12 deletions externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,6 @@ shaka.extern.xml.Node;
* manifestPreprocessor: function(!Element),
* manifestPreprocessorTXml: function(!shaka.extern.xml.Node),
* sequenceMode: boolean,
* multiTypeVariantsAllowed: boolean,
* useStreamOnceInPeriodFlattening: boolean,
* enableFastSwitching: boolean
* }}
Expand Down Expand Up @@ -1457,17 +1456,6 @@ shaka.extern.xml.Node;
* "sequence mode" (ignoring their internal timestamps).
* <br>
* Defaults to <code>false</code>.
* @property {boolean} multiTypeVariantsAllowed
* If true, the manifest parser will create variants that have multiple
* mimeTypes or codecs for video or for audio if there is no other choice.
* Meant for content where some periods are only available in one mimeType or
* codec, and other periods are only available in a different mimeType or
* codec. For example, a stream with baked-in ads where the audio codec does
* not match the main content.
* Might result in undesirable behavior if mediaSource.codecSwitchingStrategy
* is not set to SMOOTH.
* <br>
* Defaults to true if SMOOTH codec switching is supported, RELOAD overwise.
* @property {boolean} useStreamOnceInPeriodFlattening
* If period combiner is used, this option ensures every stream is used
* only once in period flattening. It speeds up underlying algorithm
Expand Down
1 change: 1 addition & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ module.exports = (config) => {
{pattern: 'test/test/assets/clear-encrypted-hls/*', included: false},
{pattern: 'test/test/assets/dash-multi-codec/*', included: false},
{pattern: 'test/test/assets/dash-multi-codec-ec3/*', included: false},
{pattern: 'test/test/assets/dash-multitype-variant/*', included: false},
{pattern: 'test/test/assets/3675/*', included: false},
{pattern: 'test/test/assets/7401/*', included: false},
{pattern: 'test/test/assets/6339/*', included: false},
Expand Down
4 changes: 0 additions & 4 deletions lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ goog.require('shaka.dash.SegmentBase');
goog.require('shaka.dash.SegmentList');
goog.require('shaka.dash.SegmentTemplate');
goog.require('shaka.log');
goog.require('shaka.media.Capabilities');
goog.require('shaka.media.ManifestParser');
goog.require('shaka.media.PresentationTimeline');
goog.require('shaka.media.SegmentIndex');
Expand Down Expand Up @@ -238,9 +237,6 @@ shaka.dash.DashParser = class {
}

if (this.periodCombiner_) {
this.periodCombiner_.setAllowMultiTypeVariants(
this.config_.dash.multiTypeVariantsAllowed &&
shaka.media.Capabilities.isChangeTypeSupported());
this.periodCombiner_.setUseStreamOnce(
this.config_.dash.useStreamOnceInPeriodFlattening);
}
Expand Down
7 changes: 7 additions & 0 deletions lib/device/abstract_device.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,13 @@ shaka.device.AbstractDevice = class {
return keySystem === 'com.apple.fps';
}

/**
* @override
*/
supportsContainerChangeType() {
return true;
}

/**
* @override
*/
Expand Down
7 changes: 7 additions & 0 deletions lib/device/apple_browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ shaka.device.AppleBrowser = class extends shaka.device.AbstractDevice {
return true;
}

/**
* @override
*/
supportsContainerChangeType() {
return false;
}

/**
* @return {boolean}
* @private
Expand Down
5 changes: 5 additions & 0 deletions lib/device/i_device.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ shaka.device.IDevice = class {
*/
supportsCbcsWithoutEncryptionSchemeSupport() {}

/**
* @return {boolean}
*/
supportsContainerChangeType() {}

/**
* Returns true if the platform needs to wait for the encrypted event in order
* to initialize CDM correctly.
Expand Down
7 changes: 7 additions & 0 deletions lib/device/webkit_stb.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ shaka.device.WebKitSTB = class extends shaka.device.AbstractDevice {
return !this.isSkyQ_.value();
}

/**
* @override
*/
supportsContainerChangeType() {
return false;
}

/**
* @return {boolean}
* @private
Expand Down
4 changes: 1 addition & 3 deletions lib/media/media_source_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ goog.require('goog.asserts');
goog.require('shaka.log');
goog.require('shaka.config.CodecSwitchingStrategy');
goog.require('shaka.device.DeviceFactory');
goog.require('shaka.device.IDevice');
goog.require('shaka.media.Capabilities');
goog.require('shaka.media.ContentWorkarounds');
goog.require('shaka.media.ClosedCaptionParser');
Expand Down Expand Up @@ -2377,8 +2376,7 @@ shaka.media.MediaSourceEngine = class {
needTransmux = true;
} else if (!needTransmux && mimeType != currentBasicType) {
const device = shaka.device.DeviceFactory.getDevice();
needTransmux = device.getBrowserEngine() ===
shaka.device.IDevice.BrowserEngine.WEBKIT &&
needTransmux = !device.supportsContainerChangeType() &&
shaka.util.MimeUtils.RAW_FORMATS.includes(mimeType);
}
const TransmuxerEngine = shaka.transmuxer.TransmuxerEngine;
Expand Down
Loading
Loading