shaka-player 4.2.3 → 4.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTHORS +2 -0
- package/CHANGELOG.md +39 -0
- package/CONTRIBUTORS +2 -0
- package/demo/index.html +1 -1
- package/dist/demo.compiled.debug.js +64 -64
- package/dist/demo.compiled.debug.map +2 -2
- package/dist/demo.compiled.js +64 -64
- package/dist/demo.compiled.map +2 -2
- package/dist/deps.js +5 -4
- package/dist/locales.js +32 -32
- package/dist/receiver.compiled.debug.js +12 -12
- package/dist/receiver.compiled.debug.map +2 -2
- package/dist/receiver.compiled.js +12 -12
- package/dist/receiver.compiled.map +2 -2
- package/dist/shaka-player.compiled.d.ts +15 -1
- package/dist/shaka-player.compiled.debug.d.ts +15 -1
- package/dist/shaka-player.compiled.debug.externs.js +95 -80
- package/dist/shaka-player.compiled.debug.js +583 -573
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +95 -80
- package/dist/shaka-player.compiled.js +823 -820
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +15 -1
- package/dist/shaka-player.ui.debug.d.ts +15 -1
- package/dist/shaka-player.ui.debug.externs.js +95 -80
- package/dist/shaka-player.ui.debug.js +612 -602
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +95 -80
- package/dist/shaka-player.ui.js +963 -960
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/ui.md +7 -7
- package/docs/tutorials/welcome.md +2 -2
- package/externs/mux.js +3 -0
- package/externs/shaka/player.js +2 -1
- package/lib/cast/cast_proxy.js +2 -1
- package/lib/cast/cast_receiver.js +19 -5
- package/lib/cast/cast_sender.js +2 -1
- package/lib/cast/cast_utils.js +16 -6
- package/lib/cea/cea708_window.js +2 -2
- package/lib/dash/segment_template.js +1 -1
- package/lib/hls/hls_parser.js +21 -4
- package/lib/media/content_workarounds.js +12 -0
- package/lib/media/media_source_engine.js +6 -0
- package/lib/media/playhead.js +23 -1
- package/lib/media/streaming_engine.js +3 -12
- package/lib/media/transmuxer.js +6 -0
- package/lib/player.js +24 -11
- package/lib/polyfill/abort_controller.js +143 -0
- package/lib/polyfill/media_capabilities.js +59 -9
- package/lib/text/ttml_text_parser.js +32 -7
- package/lib/text/ui_text_displayer.js +22 -5
- package/lib/util/manifest_parser_utils.js +4 -0
- package/lib/util/platform.js +9 -1
- package/lib/util/player_configuration.js +10 -3
- package/lib/util/stream_utils.js +30 -10
- package/package.json +1 -1
- package/roadmap.md +24 -6
- package/shaka-player.uncompiled.js +1 -0
- package/test/cast/cast_receiver_integration.js +97 -16
- package/test/cast/cast_receiver_unit.js +17 -12
- package/test/cast/cast_utils_unit.js +1 -0
- package/test/dash/dash_parser_manifest_unit.js +1 -0
- package/test/hls/hls_parser_unit.js +1 -0
- package/test/media/drm_engine_unit.js +11 -1
- package/test/media/media_source_engine_integration.js +108 -1
- package/test/media/playhead_unit.js +41 -0
- package/test/media/streaming_engine_integration.js +13 -0
- package/test/media/streaming_engine_unit.js +36 -23
- package/test/player_unit.js +87 -0
- package/test/polyfill/media_capabilities_unit.js +261 -0
- package/test/test/util/simple_fakes.js +3 -0
- package/test/test/util/stream_generator.js +212 -8
- package/test/test/util/test_scheme.js +3 -2
- package/test/test/util/util.js +3 -2
- package/test/text/mp4_ttml_parser_unit.js +6 -4
- package/test/text/ttml_text_parser_unit.js +119 -86
- package/test/text/ui_text_displayer_unit.js +76 -0
- package/test/ui/text_displayer_layout_unit.js +14 -0
- package/test/util/stream_utils_unit.js +18 -0
- package/test/util/xml_utils_unit.js +6 -1
- package/ui/controls.js +49 -37
- package/ui/settings_menu.js +11 -2
|
@@ -8,6 +8,7 @@ goog.provide('shaka.polyfill.MediaCapabilities');
|
|
|
8
8
|
|
|
9
9
|
goog.require('shaka.log');
|
|
10
10
|
goog.require('shaka.polyfill');
|
|
11
|
+
goog.require('shaka.util.Error');
|
|
11
12
|
goog.require('shaka.util.Platform');
|
|
12
13
|
|
|
13
14
|
|
|
@@ -96,37 +97,48 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
96
97
|
return res;
|
|
97
98
|
}
|
|
98
99
|
|
|
100
|
+
const videoConfig = mediaDecodingConfig['video'];
|
|
101
|
+
const audioConfig = mediaDecodingConfig['audio'];
|
|
102
|
+
|
|
99
103
|
if (mediaDecodingConfig.type == 'media-source') {
|
|
100
104
|
if (!shaka.util.Platform.supportsMediaSource()) {
|
|
101
105
|
return res;
|
|
102
106
|
}
|
|
103
107
|
// Use 'MediaSource.isTypeSupported' to check if the stream is supported.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
108
|
+
// Cast platforms will additionally check canDisplayType(), which
|
|
109
|
+
// accepts extended MIME type parameters.
|
|
110
|
+
// See: https://github.com/shaka-project/shaka-player/issues/4726
|
|
111
|
+
if (videoConfig) {
|
|
112
|
+
let isSupported;
|
|
113
|
+
if (shaka.util.Platform.isChromecast()) {
|
|
114
|
+
isSupported =
|
|
115
|
+
shaka.polyfill.MediaCapabilities.canCastDisplayType_(videoConfig);
|
|
116
|
+
} else {
|
|
117
|
+
isSupported = MediaSource.isTypeSupported(videoConfig.contentType);
|
|
118
|
+
}
|
|
107
119
|
if (!isSupported) {
|
|
108
120
|
return res;
|
|
109
121
|
}
|
|
110
122
|
}
|
|
111
123
|
|
|
112
|
-
if (
|
|
113
|
-
const contentType =
|
|
124
|
+
if (audioConfig) {
|
|
125
|
+
const contentType = audioConfig.contentType;
|
|
114
126
|
const isSupported = MediaSource.isTypeSupported(contentType);
|
|
115
127
|
if (!isSupported) {
|
|
116
128
|
return res;
|
|
117
129
|
}
|
|
118
130
|
}
|
|
119
131
|
} else if (mediaDecodingConfig.type == 'file') {
|
|
120
|
-
if (
|
|
121
|
-
const contentType =
|
|
132
|
+
if (videoConfig) {
|
|
133
|
+
const contentType = videoConfig.contentType;
|
|
122
134
|
const isSupported = shaka.util.Platform.supportsMediaType(contentType);
|
|
123
135
|
if (!isSupported) {
|
|
124
136
|
return res;
|
|
125
137
|
}
|
|
126
138
|
}
|
|
127
139
|
|
|
128
|
-
if (
|
|
129
|
-
const contentType =
|
|
140
|
+
if (audioConfig) {
|
|
141
|
+
const contentType = audioConfig.contentType;
|
|
130
142
|
const isSupported = shaka.util.Platform.supportsMediaType(contentType);
|
|
131
143
|
if (!isSupported) {
|
|
132
144
|
return res;
|
|
@@ -201,6 +213,44 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
201
213
|
|
|
202
214
|
return res;
|
|
203
215
|
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Checks if the given media parameters of the video or audio streams are
|
|
219
|
+
* supported by the Cast platform.
|
|
220
|
+
* @param {!VideoConfiguration} videoConfig The 'video' field of the
|
|
221
|
+
* MediaDecodingConfiguration.
|
|
222
|
+
* @return {boolean} `true` when the stream can be displayed on a Cast device.
|
|
223
|
+
* @private
|
|
224
|
+
*/
|
|
225
|
+
static canCastDisplayType_(videoConfig) {
|
|
226
|
+
if (!(window.cast)) {
|
|
227
|
+
shaka.log.error('Expected cast namespace to be available!');
|
|
228
|
+
throw new shaka.util.Error(
|
|
229
|
+
shaka.util.Error.Severity.CRITICAL,
|
|
230
|
+
shaka.util.Error.Category.CAST,
|
|
231
|
+
shaka.util.Error.Code.CAST_API_UNAVAILABLE);
|
|
232
|
+
} else if (!(cast.__platform__ && cast.__platform__.canDisplayType)) {
|
|
233
|
+
shaka.log.warning('Expected cast APIs to be available! Falling back to ' +
|
|
234
|
+
'MediaSource.isTypeSupported() for type support.');
|
|
235
|
+
return MediaSource.isTypeSupported(videoConfig.contentType);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
let displayType = videoConfig.contentType;
|
|
239
|
+
if (videoConfig.width && videoConfig.height) {
|
|
240
|
+
displayType +=
|
|
241
|
+
`; width=${videoConfig.width}; height=${videoConfig.height}`;
|
|
242
|
+
}
|
|
243
|
+
if (videoConfig.framerate) {
|
|
244
|
+
displayType += `; framerate=${videoConfig.framerate}`;
|
|
245
|
+
}
|
|
246
|
+
if (videoConfig.transferFunction === 'pq') {
|
|
247
|
+
// A "PQ" transfer function indicates this is an HDR-capable stream;
|
|
248
|
+
// "smpte2084" is the published standard. We need to inform the platform
|
|
249
|
+
// this query is specifically for HDR.
|
|
250
|
+
displayType += '; eotf=smpte2084';
|
|
251
|
+
}
|
|
252
|
+
return cast.__platform__.canDisplayType(displayType);
|
|
253
|
+
}
|
|
204
254
|
};
|
|
205
255
|
|
|
206
256
|
/**
|
|
@@ -136,7 +136,7 @@ shaka.text.TtmlTextParser = class {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
const cue = TtmlTextParser.parseCue_(
|
|
139
|
-
body, time
|
|
139
|
+
body, time, rateInfo, metadataElements, styles,
|
|
140
140
|
regionElements, cueRegions, whitespaceTrim,
|
|
141
141
|
cellResolutionInfo, /* parentCueElement= */ null,
|
|
142
142
|
/* isContent= */ false);
|
|
@@ -157,7 +157,7 @@ shaka.text.TtmlTextParser = class {
|
|
|
157
157
|
* Parses a TTML node into a Cue.
|
|
158
158
|
*
|
|
159
159
|
* @param {!Node} cueNode
|
|
160
|
-
* @param {
|
|
160
|
+
* @param {shaka.extern.TextParser.TimeContext} timeContext
|
|
161
161
|
* @param {!shaka.text.TtmlTextParser.RateInfo_} rateInfo
|
|
162
162
|
* @param {!Array.<!Element>} metadataElements
|
|
163
163
|
* @param {!Array.<!Element>} styles
|
|
@@ -171,7 +171,7 @@ shaka.text.TtmlTextParser = class {
|
|
|
171
171
|
* @private
|
|
172
172
|
*/
|
|
173
173
|
static parseCue_(
|
|
174
|
-
cueNode,
|
|
174
|
+
cueNode, timeContext, rateInfo, metadataElements, styles, regionElements,
|
|
175
175
|
cueRegions, whitespaceTrim, cellResolution, parentCueElement, isContent) {
|
|
176
176
|
/** @type {Element} */
|
|
177
177
|
let cueElement;
|
|
@@ -236,7 +236,7 @@ shaka.text.TtmlTextParser = class {
|
|
|
236
236
|
for (const childNode of cueElement.childNodes) {
|
|
237
237
|
const nestedCue = shaka.text.TtmlTextParser.parseCue_(
|
|
238
238
|
childNode,
|
|
239
|
-
|
|
239
|
+
timeContext,
|
|
240
240
|
rateInfo,
|
|
241
241
|
metadataElements,
|
|
242
242
|
styles,
|
|
@@ -293,15 +293,20 @@ shaka.text.TtmlTextParser = class {
|
|
|
293
293
|
if (start == null) {
|
|
294
294
|
start = 0;
|
|
295
295
|
}
|
|
296
|
-
start +=
|
|
296
|
+
start += timeContext.periodStart;
|
|
297
297
|
|
|
298
298
|
// If end is null, that means the duration is effectively infinite.
|
|
299
299
|
if (end == null) {
|
|
300
300
|
end = Infinity;
|
|
301
301
|
} else {
|
|
302
|
-
end +=
|
|
302
|
+
end += timeContext.periodStart;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
+
// Clip times to segment boundaries.
|
|
306
|
+
// https://github.com/shaka-project/shaka-player/issues/4631
|
|
307
|
+
start = Math.max(start, timeContext.segmentStart);
|
|
308
|
+
end = Math.min(end, timeContext.segmentEnd);
|
|
309
|
+
|
|
305
310
|
if (!hasTimeAttributes && nestedCues.length > 0) {
|
|
306
311
|
// If no time is defined for this cue, base the timing information on
|
|
307
312
|
// the time of the nested cues. In the case of multiple nested cues with
|
|
@@ -569,8 +574,28 @@ shaka.text.TtmlTextParser = class {
|
|
|
569
574
|
|
|
570
575
|
const fontFamily = TtmlTextParser.getStyleAttribute_(
|
|
571
576
|
cueElement, region, styles, 'fontFamily', shouldInheritRegionStyles);
|
|
577
|
+
// See https://github.com/sandflow/imscJS/blob/1.1.3/src/main/js/html.js#L1384
|
|
572
578
|
if (fontFamily) {
|
|
573
|
-
|
|
579
|
+
switch (fontFamily) {
|
|
580
|
+
case 'monospaceSerif':
|
|
581
|
+
cue.fontFamily = 'Courier New,Liberation Mono,Courier,monospace';
|
|
582
|
+
break;
|
|
583
|
+
case 'proportionalSansSerif':
|
|
584
|
+
cue.fontFamily = 'Arial,Helvetica,Liberation Sans,sans-serif';
|
|
585
|
+
break;
|
|
586
|
+
case 'sansSerif':
|
|
587
|
+
cue.fontFamily = 'sans-serif';
|
|
588
|
+
break;
|
|
589
|
+
case 'monospaceSansSerif':
|
|
590
|
+
cue.fontFamily = 'Consolas,monospace';
|
|
591
|
+
break;
|
|
592
|
+
case 'proportionalSerif':
|
|
593
|
+
cue.fontFamily = 'serif';
|
|
594
|
+
break;
|
|
595
|
+
default:
|
|
596
|
+
cue.fontFamily = fontFamily;
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
574
599
|
}
|
|
575
600
|
|
|
576
601
|
const fontWeight = TtmlTextParser.getStyleAttribute_(
|
|
@@ -199,6 +199,19 @@ shaka.text.UITextDisplayer = class {
|
|
|
199
199
|
this.isTextVisible_ = on;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
/**
|
|
203
|
+
* @private
|
|
204
|
+
*/
|
|
205
|
+
isElementUnderTextContainer_(elemToCheck) {
|
|
206
|
+
while (elemToCheck != null) {
|
|
207
|
+
if (elemToCheck == this.textContainer_) {
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
elemToCheck = elemToCheck.parentElement;
|
|
211
|
+
}
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
|
|
202
215
|
/**
|
|
203
216
|
* @param {!Array.<!shaka.extern.Cue>} cues
|
|
204
217
|
* @param {!HTMLElement} container
|
|
@@ -260,6 +273,9 @@ shaka.text.UITextDisplayer = class {
|
|
|
260
273
|
cueRegistry = this.currentCuesMap_.get(cue);
|
|
261
274
|
wrapper = cueRegistry.wrapper;
|
|
262
275
|
updateDOM = true;
|
|
276
|
+
} else if (!this.isElementUnderTextContainer_(wrapper)) {
|
|
277
|
+
// We found that the wrapper needs to be in the DOM
|
|
278
|
+
updateDOM = true;
|
|
263
279
|
}
|
|
264
280
|
}
|
|
265
281
|
|
|
@@ -276,6 +292,7 @@ shaka.text.UITextDisplayer = class {
|
|
|
276
292
|
const topCue = parents.pop();
|
|
277
293
|
goog.asserts.assert(topCue == cue, 'Parent cues should be kept in order');
|
|
278
294
|
}
|
|
295
|
+
|
|
279
296
|
if (updateDOM) {
|
|
280
297
|
for (const element of toUproot) {
|
|
281
298
|
// NOTE: Because we uproot shared region elements, too, we might hit an
|
|
@@ -578,7 +595,7 @@ shaka.text.UITextDisplayer = class {
|
|
|
578
595
|
// (for vertical growing left) is aligned at the line.
|
|
579
596
|
// TODO: Implement line alignment with line number.
|
|
580
597
|
// TODO: Implement lineAlignment of 'CENTER'.
|
|
581
|
-
if (cue.line) {
|
|
598
|
+
if (cue.line != null) {
|
|
582
599
|
if (cue.lineInterpretation == Cue.lineInterpretation.PERCENTAGE) {
|
|
583
600
|
// When setting absolute positioning, you need to set x/y/width/height
|
|
584
601
|
// so the element is positioned correctly. Set these as default and
|
|
@@ -591,21 +608,21 @@ shaka.text.UITextDisplayer = class {
|
|
|
591
608
|
if (cue.lineAlign == Cue.lineAlign.START) {
|
|
592
609
|
style.top = cue.line + '%';
|
|
593
610
|
} else if (cue.lineAlign == Cue.lineAlign.END) {
|
|
594
|
-
style.bottom = cue.line + '%';
|
|
611
|
+
style.bottom = (100 - cue.line) + '%';
|
|
595
612
|
}
|
|
596
613
|
} else if (cue.writingMode == Cue.writingMode.VERTICAL_LEFT_TO_RIGHT) {
|
|
597
614
|
style.height = '100%';
|
|
598
615
|
if (cue.lineAlign == Cue.lineAlign.START) {
|
|
599
616
|
style.left = cue.line + '%';
|
|
600
617
|
} else if (cue.lineAlign == Cue.lineAlign.END) {
|
|
601
|
-
style.right = cue.line + '%';
|
|
618
|
+
style.right = (100 - cue.line) + '%';
|
|
602
619
|
}
|
|
603
620
|
} else {
|
|
604
621
|
style.height = '100%';
|
|
605
622
|
if (cue.lineAlign == Cue.lineAlign.START) {
|
|
606
623
|
style.right = cue.line + '%';
|
|
607
624
|
} else if (cue.lineAlign == Cue.lineAlign.END) {
|
|
608
|
-
style.left = cue.line + '%';
|
|
625
|
+
style.left = (100 - cue.line) + '%';
|
|
609
626
|
}
|
|
610
627
|
}
|
|
611
628
|
}
|
|
@@ -615,7 +632,7 @@ shaka.text.UITextDisplayer = class {
|
|
|
615
632
|
|
|
616
633
|
// The position defines the indent of the text container in the
|
|
617
634
|
// direction defined by the writing direction.
|
|
618
|
-
if (cue.position) {
|
|
635
|
+
if (cue.position != null) {
|
|
619
636
|
if (cue.writingMode == Cue.writingMode.HORIZONTAL_TOP_TO_BOTTOM) {
|
|
620
637
|
style.paddingLeft = cue.position;
|
|
621
638
|
} else {
|
|
@@ -168,6 +168,7 @@ shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_ = [
|
|
|
168
168
|
/^hvc/,
|
|
169
169
|
/^vp0?[89]/,
|
|
170
170
|
/^av01/,
|
|
171
|
+
/^dvhe/,
|
|
171
172
|
];
|
|
172
173
|
|
|
173
174
|
|
|
@@ -183,6 +184,9 @@ shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_ = [
|
|
|
183
184
|
/^flac$/,
|
|
184
185
|
/^mp4a/,
|
|
185
186
|
/^[ae]c-3$/,
|
|
187
|
+
/^ac-4$/,
|
|
188
|
+
/^dts[cx]$/, // DTS Surround Sound
|
|
189
|
+
/^[du]dts$/, // DTS Surround Sound
|
|
186
190
|
];
|
|
187
191
|
|
|
188
192
|
|
package/lib/util/platform.js
CHANGED
|
@@ -174,7 +174,7 @@ shaka.util.Platform = class {
|
|
|
174
174
|
* @return {?number} A major version number or null if not Chromium-based.
|
|
175
175
|
*/
|
|
176
176
|
static chromeVersion() {
|
|
177
|
-
if (!shaka.util.Platform.
|
|
177
|
+
if (!shaka.util.Platform.isChrome()) {
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
180
|
|
|
@@ -213,6 +213,7 @@ shaka.util.Platform = class {
|
|
|
213
213
|
return !!navigator.vendor && navigator.vendor.includes('Apple') &&
|
|
214
214
|
!shaka.util.Platform.isTizen() &&
|
|
215
215
|
!shaka.util.Platform.isEOS() &&
|
|
216
|
+
!shaka.util.Platform.isVirginMedia() &&
|
|
216
217
|
!shaka.util.Platform.isPS4() &&
|
|
217
218
|
!shaka.util.Platform.isAmazonFireTV();
|
|
218
219
|
}
|
|
@@ -237,6 +238,13 @@ shaka.util.Platform = class {
|
|
|
237
238
|
return shaka.util.Platform.userAgentContains_('PlayStation 4');
|
|
238
239
|
}
|
|
239
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Check if the current platform is Virgin Media device.
|
|
243
|
+
*/
|
|
244
|
+
static isVirginMedia() {
|
|
245
|
+
return shaka.util.Platform.userAgentContains_('VirginMedia');
|
|
246
|
+
}
|
|
247
|
+
|
|
240
248
|
/**
|
|
241
249
|
* Check if the current platform is Amazon Fire TV.
|
|
242
250
|
* https://developer.amazon.com/docs/fire-tv/identify-amazon-fire-tv-devices.html
|
|
@@ -11,6 +11,7 @@ goog.require('shaka.abr.SimpleAbrManager');
|
|
|
11
11
|
goog.require('shaka.log');
|
|
12
12
|
goog.require('shaka.net.NetworkingEngine');
|
|
13
13
|
goog.require('shaka.util.ConfigUtils');
|
|
14
|
+
goog.require('shaka.util.FairPlayUtils');
|
|
14
15
|
goog.require('shaka.util.LanguageUtils');
|
|
15
16
|
goog.require('shaka.util.ManifestParserUtils');
|
|
16
17
|
goog.require('shaka.util.Platform');
|
|
@@ -67,9 +68,15 @@ shaka.util.PlayerConfiguration = class {
|
|
|
67
68
|
advanced: {}, // key is arbitrary key system ID, value is a record type
|
|
68
69
|
delayLicenseRequestUntilPlayed: false,
|
|
69
70
|
initDataTransform: (initData, initDataType, drmInfo) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
const keySystem = drmInfo.keySystem;
|
|
72
|
+
if (keySystem == 'com.apple.fps.1_0' && initDataType == 'skd') {
|
|
73
|
+
const cert = drmInfo.serverCertificate;
|
|
74
|
+
const contentId =
|
|
75
|
+
shaka.util.FairPlayUtils.defaultGetContentId(initData);
|
|
76
|
+
initData = shaka.util.FairPlayUtils.initDataTransform(
|
|
77
|
+
initData, contentId, cert);
|
|
78
|
+
}
|
|
79
|
+
return initData;
|
|
73
80
|
},
|
|
74
81
|
logLicenseExchange: false,
|
|
75
82
|
updateExpirationTime: 1,
|
package/lib/util/stream_utils.js
CHANGED
|
@@ -438,15 +438,20 @@ shaka.util.StreamUtils = class {
|
|
|
438
438
|
const video = variant.video;
|
|
439
439
|
const ContentType = shaka.util.ManifestParserUtils.ContentType;
|
|
440
440
|
if (video) {
|
|
441
|
-
let videoCodecs =
|
|
441
|
+
let videoCodecs =
|
|
442
|
+
shaka.util.StreamUtils.getCorrectVideoCodecs_(video.codecs);
|
|
442
443
|
// For multiplexed streams. Here we must check the audio of the
|
|
443
444
|
// stream to see if it is compatible.
|
|
444
445
|
if (video.codecs.includes(',')) {
|
|
445
446
|
const allCodecs = video.codecs.split(',');
|
|
446
447
|
videoCodecs = shaka.util.ManifestParserUtils.guessCodecs(
|
|
447
448
|
ContentType.VIDEO, allCodecs);
|
|
448
|
-
|
|
449
|
+
videoCodecs =
|
|
450
|
+
shaka.util.StreamUtils.getCorrectVideoCodecs_(videoCodecs);
|
|
451
|
+
let audioCodecs = shaka.util.ManifestParserUtils.guessCodecs(
|
|
449
452
|
ContentType.AUDIO, allCodecs);
|
|
453
|
+
audioCodecs =
|
|
454
|
+
shaka.util.StreamUtils.getCorrectAudioCodecs_(audioCodecs);
|
|
450
455
|
const audioFullType = shaka.util.MimeUtils.getFullOrConvertedType(
|
|
451
456
|
video.mimeType, audioCodecs, ContentType.AUDIO);
|
|
452
457
|
if (!MediaSource.isTypeSupported(audioFullType)) {
|
|
@@ -566,7 +571,8 @@ shaka.util.StreamUtils = class {
|
|
|
566
571
|
const allCodecs = video.codecs.split(',');
|
|
567
572
|
videoCodecs = shaka.util.ManifestParserUtils.guessCodecs(
|
|
568
573
|
ContentType.VIDEO, allCodecs);
|
|
569
|
-
videoCodecs =
|
|
574
|
+
videoCodecs =
|
|
575
|
+
shaka.util.StreamUtils.getCorrectVideoCodecs_(videoCodecs);
|
|
570
576
|
const audioCodecs = shaka.util.ManifestParserUtils.guessCodecs(
|
|
571
577
|
ContentType.AUDIO, allCodecs);
|
|
572
578
|
|
|
@@ -580,7 +586,7 @@ shaka.util.StreamUtils = class {
|
|
|
580
586
|
spatialRendering: false,
|
|
581
587
|
};
|
|
582
588
|
}
|
|
583
|
-
videoCodecs = shaka.util.StreamUtils.
|
|
589
|
+
videoCodecs = shaka.util.StreamUtils.getCorrectVideoCodecs_(videoCodecs);
|
|
584
590
|
const fullType = shaka.util.MimeUtils.getFullOrConvertedType(
|
|
585
591
|
video.mimeType, videoCodecs, ContentType.VIDEO);
|
|
586
592
|
// VideoConfiguration
|
|
@@ -749,15 +755,29 @@ shaka.util.StreamUtils = class {
|
|
|
749
755
|
|
|
750
756
|
|
|
751
757
|
/**
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
* mediaCapabilities enabled.
|
|
755
|
-
*
|
|
758
|
+
* Generates the correct video codec for MediaDecodingConfiguration and
|
|
759
|
+
* for MediaSource.isTypeSupported.
|
|
756
760
|
* @param {string} codec
|
|
757
761
|
* @return {string}
|
|
762
|
+
* @private
|
|
758
763
|
*/
|
|
759
|
-
static
|
|
760
|
-
if (codec
|
|
764
|
+
static getCorrectVideoCodecs_(codec) {
|
|
765
|
+
if (codec.includes('avc1')) {
|
|
766
|
+
// Convert avc1 codec string from RFC-4281 to RFC-6381 for
|
|
767
|
+
// MediaSource.isTypeSupported
|
|
768
|
+
// Example, convert avc1.66.30 to avc1.42001e (0x42 == 66 and 0x1e == 30)
|
|
769
|
+
const avcdata = codec.split('.');
|
|
770
|
+
if (avcdata.length == 3) {
|
|
771
|
+
let result = avcdata.shift() + '.';
|
|
772
|
+
result += parseInt(avcdata.shift(), 10).toString(16);
|
|
773
|
+
result +=
|
|
774
|
+
('000' + parseInt(avcdata.shift(), 10).toString(16)).slice(-4);
|
|
775
|
+
return result;
|
|
776
|
+
}
|
|
777
|
+
} else if (codec == 'vp9') {
|
|
778
|
+
// MediaCapabilities supports 'vp09...' codecs, but not 'vp9'. Translate
|
|
779
|
+
// vp9 codec strings into 'vp09...', to allow such content to play with
|
|
780
|
+
// mediaCapabilities enabled.
|
|
761
781
|
// This means profile 0, level 4.1, 8-bit color. This supports 1080p @
|
|
762
782
|
// 60Hz. See https://en.wikipedia.org/wiki/VP9#Levels
|
|
763
783
|
//
|
package/package.json
CHANGED
package/roadmap.md
CHANGED
|
@@ -9,28 +9,46 @@ The goals of future milestones are fluid until we begin that development cycle,
|
|
|
9
9
|
so the exact milestone for future features is not pre-determined.
|
|
10
10
|
|
|
11
11
|
Priority features up next:
|
|
12
|
-
-
|
|
13
|
-
https://github.com/shaka-project/shaka-player/
|
|
12
|
+
- HLS improvements
|
|
13
|
+
https://github.com/shaka-project/shaka-player/projects/6
|
|
14
14
|
|
|
15
15
|
Candidate features for future release cycles:
|
|
16
|
+
- Preload API
|
|
17
|
+
https://github.com/shaka-project/shaka-player/issues/880
|
|
16
18
|
- Official TypeScript defs, generated from source
|
|
17
19
|
https://github.com/shaka-project/shaka-player/issues/1030
|
|
18
20
|
- Codec-switching
|
|
19
21
|
https://github.com/shaka-project/shaka-player/issues/1528
|
|
20
22
|
- Background fetch for offline storage
|
|
21
23
|
https://github.com/shaka-project/shaka-player/issues/879
|
|
24
|
+
- Smaller, more modular binary
|
|
25
|
+
|
|
26
|
+
v4.3 - 2022 Q4 / 2023 Q1
|
|
22
27
|
- Support ID3 tags in mp4
|
|
23
28
|
https://github.com/shaka-project/shaka-player/issues/3351
|
|
24
|
-
-
|
|
29
|
+
- Lazy-load HLS playlists on adaptation
|
|
30
|
+
https://github.com/shaka-project/shaka-player/issues/1936
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
=====
|
|
33
|
+
|
|
34
|
+
v4.2 - 2022 Q3
|
|
35
|
+
- Automatic ABR quality restrictions based on size
|
|
36
|
+
https://github.com/shaka-project/shaka-player/issues/2333
|
|
37
|
+
- HLS support for AES-128 encryption
|
|
38
|
+
https://github.com/shaka-project/shaka-player/issues/850
|
|
39
|
+
|
|
40
|
+
v4.1 - 2022 Q2
|
|
41
|
+
- HLS support for EXT-X-GAP
|
|
42
|
+
https://github.com/shaka-project/shaka-player/issues/1308
|
|
43
|
+
- Temporarily disable the active variant after `HTTP_ERROR`
|
|
44
|
+
https://github.com/shaka-project/shaka-player/issues/1542
|
|
45
|
+
|
|
46
|
+
v4.0 - 2022 Q2
|
|
27
47
|
- MSE support for FairPlay
|
|
28
48
|
https://github.com/shaka-project/shaka-player/issues/3346
|
|
29
49
|
- Support containerless formats
|
|
30
50
|
https://github.com/shaka-project/shaka-player/issues/2337
|
|
31
51
|
|
|
32
|
-
=====
|
|
33
|
-
|
|
34
52
|
v3.3 - 2022 Q1
|
|
35
53
|
- Common Media Client Data (CMCD) logging support
|
|
36
54
|
https://github.com/shaka-project/shaka-player/issues/3619
|
|
@@ -32,6 +32,7 @@ goog.require('shaka.offline.OfflineManifestParser');
|
|
|
32
32
|
goog.require('shaka.offline.OfflineScheme');
|
|
33
33
|
goog.require('shaka.offline.Storage');
|
|
34
34
|
goog.require('shaka.offline.indexeddb.StorageMechanism');
|
|
35
|
+
goog.require('shaka.polyfill.AbortController');
|
|
35
36
|
goog.require('shaka.polyfill.Aria');
|
|
36
37
|
goog.require('shaka.polyfill.EncryptionScheme');
|
|
37
38
|
goog.require('shaka.polyfill.Fullscreen');
|