Skip to content

Commit bf26c3f

Browse files
authored
feat(DASH): Remove multiTypeVariantsAllowed config and add support for it on all browsers (#8858)
1 parent ff34d1c commit bf26c3f

22 files changed

+221
-116
lines changed

demo/config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ shakaDemo.Config = class {
251251
'manifest.dash.ignoreEmptyAdaptationSet')
252252
.addBoolInput_('Ignore DASH maxSegmentDuration',
253253
'manifest.dash.ignoreMaxSegmentDuration')
254-
.addBoolInput_('Allow DASH multi type variants',
255-
'manifest.dash.multiTypeVariantsAllowed')
256254
.addTextInput_('Clock Sync URI', 'manifest.dash.clockSyncUri')
257255
.addBoolInput_('Ignore Min Buffer Time',
258256
'manifest.dash.ignoreMinBufferTime')

externs/shaka/player.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,6 @@ shaka.extern.xml.Node;
13851385
* manifestPreprocessor: function(!Element),
13861386
* manifestPreprocessorTXml: function(!shaka.extern.xml.Node),
13871387
* sequenceMode: boolean,
1388-
* multiTypeVariantsAllowed: boolean,
13891388
* useStreamOnceInPeriodFlattening: boolean,
13901389
* enableFastSwitching: boolean
13911390
* }}
@@ -1457,17 +1456,6 @@ shaka.extern.xml.Node;
14571456
* "sequence mode" (ignoring their internal timestamps).
14581457
* <br>
14591458
* Defaults to <code>false</code>.
1460-
* @property {boolean} multiTypeVariantsAllowed
1461-
* If true, the manifest parser will create variants that have multiple
1462-
* mimeTypes or codecs for video or for audio if there is no other choice.
1463-
* Meant for content where some periods are only available in one mimeType or
1464-
* codec, and other periods are only available in a different mimeType or
1465-
* codec. For example, a stream with baked-in ads where the audio codec does
1466-
* not match the main content.
1467-
* Might result in undesirable behavior if mediaSource.codecSwitchingStrategy
1468-
* is not set to SMOOTH.
1469-
* <br>
1470-
* Defaults to true if SMOOTH codec switching is supported, RELOAD overwise.
14711459
* @property {boolean} useStreamOnceInPeriodFlattening
14721460
* If period combiner is used, this option ensures every stream is used
14731461
* only once in period flattening. It speeds up underlying algorithm

karma.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ module.exports = (config) => {
256256
{pattern: 'test/test/assets/clear-encrypted-hls/*', included: false},
257257
{pattern: 'test/test/assets/dash-multi-codec/*', included: false},
258258
{pattern: 'test/test/assets/dash-multi-codec-ec3/*', included: false},
259+
{pattern: 'test/test/assets/dash-multitype-variant/*', included: false},
259260
{pattern: 'test/test/assets/3675/*', included: false},
260261
{pattern: 'test/test/assets/7401/*', included: false},
261262
{pattern: 'test/test/assets/6339/*', included: false},

lib/dash/dash_parser.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ goog.require('shaka.dash.SegmentBase');
1616
goog.require('shaka.dash.SegmentList');
1717
goog.require('shaka.dash.SegmentTemplate');
1818
goog.require('shaka.log');
19-
goog.require('shaka.media.Capabilities');
2019
goog.require('shaka.media.ManifestParser');
2120
goog.require('shaka.media.PresentationTimeline');
2221
goog.require('shaka.media.SegmentIndex');
@@ -238,9 +237,6 @@ shaka.dash.DashParser = class {
238237
}
239238

240239
if (this.periodCombiner_) {
241-
this.periodCombiner_.setAllowMultiTypeVariants(
242-
this.config_.dash.multiTypeVariantsAllowed &&
243-
shaka.media.Capabilities.isChangeTypeSupported());
244240
this.periodCombiner_.setUseStreamOnce(
245241
this.config_.dash.useStreamOnceInPeriodFlattening);
246242
}

lib/device/abstract_device.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,13 @@ shaka.device.AbstractDevice = class {
321321
return keySystem === 'com.apple.fps';
322322
}
323323

324+
/**
325+
* @override
326+
*/
327+
supportsContainerChangeType() {
328+
return true;
329+
}
330+
324331
/**
325332
* @override
326333
*/

lib/device/apple_browser.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ shaka.device.AppleBrowser = class extends shaka.device.AbstractDevice {
126126
return true;
127127
}
128128

129+
/**
130+
* @override
131+
*/
132+
supportsContainerChangeType() {
133+
return false;
134+
}
135+
129136
/**
130137
* @return {boolean}
131138
* @private

lib/device/i_device.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ shaka.device.IDevice = class {
230230
*/
231231
supportsCbcsWithoutEncryptionSchemeSupport() {}
232232

233+
/**
234+
* @return {boolean}
235+
*/
236+
supportsContainerChangeType() {}
237+
233238
/**
234239
* Returns true if the platform needs to wait for the encrypted event in order
235240
* to initialize CDM correctly.

lib/device/webkit_stb.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ shaka.device.WebKitSTB = class extends shaka.device.AbstractDevice {
113113
return !this.isSkyQ_.value();
114114
}
115115

116+
/**
117+
* @override
118+
*/
119+
supportsContainerChangeType() {
120+
return false;
121+
}
122+
116123
/**
117124
* @return {boolean}
118125
* @private

lib/media/media_source_engine.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ goog.require('goog.asserts');
1010
goog.require('shaka.log');
1111
goog.require('shaka.config.CodecSwitchingStrategy');
1212
goog.require('shaka.device.DeviceFactory');
13-
goog.require('shaka.device.IDevice');
1413
goog.require('shaka.media.Capabilities');
1514
goog.require('shaka.media.ContentWorkarounds');
1615
goog.require('shaka.media.ClosedCaptionParser');
@@ -2377,8 +2376,7 @@ shaka.media.MediaSourceEngine = class {
23772376
needTransmux = true;
23782377
} else if (!needTransmux && mimeType != currentBasicType) {
23792378
const device = shaka.device.DeviceFactory.getDevice();
2380-
needTransmux = device.getBrowserEngine() ===
2381-
shaka.device.IDevice.BrowserEngine.WEBKIT &&
2379+
needTransmux = !device.supportsContainerChangeType() &&
23822380
shaka.util.MimeUtils.RAW_FORMATS.includes(mimeType);
23832381
}
23842382
const TransmuxerEngine = shaka.transmuxer.TransmuxerEngine;

0 commit comments

Comments
 (0)