shaka-player 3.3.5 → 4.0.2
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/.github/config.yml +1 -0
- package/.github/workflows/demo-version-index.yaml +8 -0
- package/.github/workflows/release-please.yaml +18 -2
- package/.github/workflows/sync-labels.yaml +33 -0
- package/.github/workflows/update-issues.yaml +29 -0
- package/.github/workflows/validate-pr-title.yaml +35 -0
- package/AUTHORS +1 -0
- package/CHANGELOG.md +215 -41
- package/CONTRIBUTORS +1 -0
- package/README.md +14 -11
- package/app-engine/demo-version-index/README.md +3 -3
- package/app-engine/demo-version-index/app.yaml +27 -1
- package/app-engine/demo-version-index/generate.py +164 -0
- package/app-engine/demo-version-index/main.py +4 -155
- package/app-engine/demo-version-index/requirements.txt +0 -1
- package/build/checkversion.py +1 -1
- package/build/compiler.py +1 -1
- package/build/misspellings.txt +1 -0
- package/build/shaka-lab.yaml +0 -2
- package/build/types/polyfill +0 -3
- package/demo/common/asset.js +17 -1
- package/demo/common/assets.js +29 -0
- package/demo/common/message_ids.js +6 -3
- package/demo/config.js +10 -11
- package/demo/custom.js +39 -0
- package/demo/demo.less +0 -1
- package/demo/demo_utils.js +0 -1
- package/demo/locales/en.json +6 -3
- package/demo/locales/source.json +22 -10
- package/demo/main.js +9 -6
- package/demo/search.js +2 -1
- package/dist/controls.css +3 -3
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +71 -64
- package/dist/demo.compiled.debug.map +3 -3
- package/dist/demo.compiled.js +71 -64
- package/dist/demo.compiled.map +3 -3
- package/dist/demo.css +1 -1
- package/dist/demo.css.map +1 -1
- package/dist/deps.js +17 -20
- package/dist/locales.js +33 -31
- package/dist/receiver.compiled.debug.js +32 -28
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +32 -28
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.d.ts +311 -314
- package/dist/shaka-player.compiled.debug.d.ts +311 -314
- package/dist/shaka-player.compiled.debug.externs.js +126 -126
- package/dist/shaka-player.compiled.debug.js +430 -484
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +126 -126
- package/dist/shaka-player.compiled.js +829 -845
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +357 -358
- package/dist/shaka-player.ui.debug.d.ts +357 -358
- package/dist/shaka-player.ui.debug.externs.js +134 -126
- package/dist/shaka-player.ui.debug.js +489 -541
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +134 -126
- package/dist/shaka-player.ui.js +988 -1000
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/config.md +0 -2
- package/docs/tutorials/drm-config.md +5 -0
- package/docs/tutorials/fairplay.md +7 -22
- package/docs/tutorials/faq.md +0 -11
- package/docs/tutorials/index.json +2 -8
- package/docs/tutorials/plugins.md +1 -3
- package/docs/tutorials/upgrade.md +85 -11
- package/externs/polyfill.js +15 -0
- package/externs/shaka/manifest.js +5 -1
- package/externs/shaka/net.js +12 -0
- package/externs/shaka/offline.js +5 -1
- package/externs/shaka/player.js +39 -21
- package/externs/shaka/text.js +12 -12
- package/externs/sourcebuffer.js +15 -0
- package/lib/abr/simple_abr_manager.js +2 -1
- package/lib/ads/client_side_ad.js +13 -2
- package/lib/ads/client_side_ad_manager.js +22 -4
- package/lib/cast/cast_utils.js +0 -1
- package/lib/dash/content_protection.js +85 -5
- package/lib/dash/dash_parser.js +1 -0
- package/lib/hls/hls_parser.js +390 -747
- package/lib/hls/manifest_text_parser.js +2 -3
- package/lib/media/drm_engine.js +105 -37
- package/lib/media/gap_jumping_controller.js +10 -45
- package/lib/media/media_source_engine.js +150 -30
- package/lib/media/playhead.js +2 -5
- package/lib/media/presentation_timeline.js +1 -2
- package/lib/media/segment_index.js +13 -46
- package/lib/media/segment_reference.js +47 -1
- package/lib/media/streaming_engine.js +28 -11
- package/lib/media/time_ranges_utils.js +4 -9
- package/lib/net/networking_engine.js +3 -0
- package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
- package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
- package/lib/offline/manifest_converter.js +1 -0
- package/lib/offline/storage.js +8 -41
- package/lib/player.js +17 -201
- package/lib/polyfill/media_capabilities.js +12 -6
- package/lib/polyfill/mediasource.js +0 -28
- package/lib/polyfill/patchedmediakeys_nop.js +2 -0
- package/lib/polyfill/patchedmediakeys_webkit.js +2 -0
- package/lib/text/cue.js +0 -6
- package/lib/text/lrc_text_parser.js +8 -0
- package/lib/text/mp4_ttml_parser.js +8 -0
- package/lib/text/mp4_vtt_parser.js +8 -0
- package/lib/text/sbv_text_parser.js +8 -0
- package/lib/text/simple_text_displayer.js +1 -7
- package/lib/text/srt_text_parser.js +8 -0
- package/lib/text/ssa_text_parser.js +8 -0
- package/lib/text/text_engine.js +19 -3
- package/lib/text/ttml_text_parser.js +8 -0
- package/lib/text/ui_text_displayer.js +1 -7
- package/lib/text/vtt_text_parser.js +27 -5
- package/lib/text/web_vtt_generator.js +1 -7
- package/lib/util/error.js +9 -13
- package/lib/util/fairplay_utils.js +109 -0
- package/lib/util/functional.js +0 -42
- package/lib/util/mime_utils.js +16 -5
- package/lib/util/platform.js +45 -0
- package/lib/util/player_configuration.js +17 -6
- package/lib/util/pssh.js +23 -4
- package/lib/util/stream_utils.js +92 -22
- package/lib/util/uint8array_utils.js +0 -16
- package/lib/util/xml_utils.js +1 -1
- package/package.json +5 -2
- package/roadmap.md +19 -19
- package/shaka-player.uncompiled.js +0 -3
- package/test/dash/dash_parser_content_protection_unit.js +44 -0
- package/test/dash/dash_parser_segment_template_unit.js +3 -4
- package/test/demo/demo_unit.js +2 -1
- package/test/hls/hls_live_unit.js +155 -230
- package/test/hls/hls_parser_unit.js +515 -432
- package/test/media/drm_engine_unit.js +86 -120
- package/test/media/media_source_engine_integration.js +25 -3
- package/test/media/media_source_engine_unit.js +3 -2
- package/test/media/playhead_unit.js +27 -191
- package/test/media/segment_index_unit.js +15 -25
- package/test/media/streaming_engine_integration.js +2 -39
- package/test/media/streaming_engine_unit.js +3 -2
- package/test/media/time_ranges_utils_unit.js +0 -5
- package/test/offline/manifest_convert_unit.js +34 -4
- package/test/offline/offline_manifest_parser_unit.js +1 -0
- package/test/offline/storage_integration.js +5 -4
- package/test/player_external.js +0 -6
- package/test/player_integration.js +16 -0
- package/test/player_unit.js +26 -0
- package/test/test/util/fake_media_source_engine.js +11 -4
- package/test/test/util/manifest_generator.js +3 -1
- package/test/test/util/manifest_parser_util.js +4 -1
- package/test/test/util/offline_utils.js +1 -0
- package/test/test/util/streaming_engine_util.js +1 -0
- package/test/test/util/test_scheme.js +24 -1
- package/test/test/util/util.js +4 -4
- package/test/text/cue_integration.js +2 -2
- package/test/text/lrc_text_parser_unit.js +6 -7
- package/test/text/mp4_ttml_parser_unit.js +6 -4
- package/test/text/mp4_vtt_parser_unit.js +6 -5
- package/test/text/sbv_text_parser_unit.js +5 -6
- package/test/text/srt_text_parser_unit.js +5 -6
- package/test/text/ssa_text_parser_unit.js +17 -29
- package/test/text/text_engine_unit.js +45 -5
- package/test/text/ttml_text_parser_unit.js +77 -77
- package/test/text/vtt_text_parser_unit.js +116 -59
- package/test/ui/ui_integration.js +0 -16
- package/test/ui/ui_unit.js +27 -0
- package/test/util/cmcd_manager_unit.js +3 -0
- package/test/util/stream_utils_unit.js +23 -7
- package/ui/controls.js +65 -40
- package/ui/fullscreen_button.js +26 -6
- package/ui/less/containers.less +4 -4
- package/ui/less/general.less +1 -1
- package/ui/less/range_elements.less +1 -0
- package/ui/locales/en.json +1 -0
- package/ui/locales/source.json +5 -0
- package/ui/resolution_selection.js +31 -33
- package/ui/ui.js +0 -17
- package/.github/pull_request_template.md +0 -10
- package/docs/tutorials/upgrade-v2-5.md +0 -441
- package/docs/tutorials/upgrade-v3.md +0 -38
- package/lib/polyfill/mathround.js +0 -49
- package/lib/polyfill/patchedmediakeys_apple.js +0 -744
- package/lib/polyfill/patchedmediakeys_ms.js +0 -698
- package/test/util/functional_unit.js +0 -82
|
@@ -68,7 +68,7 @@ shaka.dash.ContentProtection = class {
|
|
|
68
68
|
|
|
69
69
|
if (parsedNonCenc.length) {
|
|
70
70
|
drmInfos = ContentProtection.convertElements_(
|
|
71
|
-
defaultInit, parsedNonCenc, keySystemsByURI);
|
|
71
|
+
defaultInit, parsedNonCenc, keySystemsByURI, keyIds);
|
|
72
72
|
|
|
73
73
|
// If there are no drmInfos after parsing, then add a dummy entry.
|
|
74
74
|
// This may be removed in parseKeyIds.
|
|
@@ -180,6 +180,27 @@ shaka.dash.ContentProtection = class {
|
|
|
180
180
|
return '';
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Gets a ClearKey license URL from a content protection element
|
|
185
|
+
* containing a custom `clearkey::Laurl` element
|
|
186
|
+
*
|
|
187
|
+
* @param {shaka.dash.ContentProtection.Element} element
|
|
188
|
+
* @return {string}
|
|
189
|
+
*/
|
|
190
|
+
static getClearKeyLicenseUrl(element) {
|
|
191
|
+
const clearKeyLaurlNode = shaka.util.XmlUtils.findChildNS(
|
|
192
|
+
element.node, shaka.dash.ContentProtection.ClearKeyNamespaceUri_,
|
|
193
|
+
'Laurl',
|
|
194
|
+
);
|
|
195
|
+
if (clearKeyLaurlNode &&
|
|
196
|
+
clearKeyLaurlNode.getAttribute('Lic_type') === 'EME-1.0') {
|
|
197
|
+
if (clearKeyLaurlNode.textContent) {
|
|
198
|
+
return clearKeyLaurlNode.textContent;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return '';
|
|
202
|
+
}
|
|
203
|
+
|
|
183
204
|
/**
|
|
184
205
|
* Parses an Array buffer starting at byteOffset for PlayReady Object Records.
|
|
185
206
|
* Each PRO Record is preceded by its PlayReady Record type and length in
|
|
@@ -335,7 +356,41 @@ shaka.dash.ContentProtection = class {
|
|
|
335
356
|
0x9a, 0x04, 0xf0, 0x79, 0x98, 0x40, 0x42, 0x86,
|
|
336
357
|
0xab, 0x92, 0xe6, 0x5b, 0xe0, 0x88, 0x5f, 0x95,
|
|
337
358
|
]);
|
|
338
|
-
const
|
|
359
|
+
const keyIds = new Set();
|
|
360
|
+
const psshVersion = 0;
|
|
361
|
+
const pssh =
|
|
362
|
+
shaka.util.Pssh.createPssh(data, systemId, keyIds, psshVersion);
|
|
363
|
+
return [
|
|
364
|
+
{
|
|
365
|
+
initData: pssh,
|
|
366
|
+
initDataType: 'cenc',
|
|
367
|
+
keyId: element.keyId,
|
|
368
|
+
},
|
|
369
|
+
];
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Creates ClearKey initData from Default_KID value retrieved from previously
|
|
374
|
+
* parsed ContentProtection tag.
|
|
375
|
+
* @param {shaka.dash.ContentProtection.Element} element
|
|
376
|
+
* @param {!Set.<string>} keyIds
|
|
377
|
+
* @return {?Array.<shaka.extern.InitDataOverride>}
|
|
378
|
+
* @private
|
|
379
|
+
*/
|
|
380
|
+
static getInitDataClearKey_(element, keyIds) {
|
|
381
|
+
if (keyIds.size == 0) {
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const systemId = new Uint8Array([
|
|
386
|
+
0x10, 0x77, 0xef, 0xec, 0xc0, 0xb2, 0x4d, 0x02,
|
|
387
|
+
0xac, 0xe3, 0x3c, 0x1e, 0x52, 0xe2, 0xfb, 0x4b,
|
|
388
|
+
]);
|
|
389
|
+
const data = new Uint8Array([]);
|
|
390
|
+
const psshVersion = 1;
|
|
391
|
+
const pssh =
|
|
392
|
+
shaka.util.Pssh.createPssh(data, systemId, keyIds, psshVersion);
|
|
393
|
+
|
|
339
394
|
return [
|
|
340
395
|
{
|
|
341
396
|
initData: pssh,
|
|
@@ -351,10 +406,11 @@ shaka.dash.ContentProtection = class {
|
|
|
351
406
|
* @param {Array.<shaka.extern.InitDataOverride>} defaultInit
|
|
352
407
|
* @param {!Array.<shaka.dash.ContentProtection.Element>} elements
|
|
353
408
|
* @param {!Object.<string, string>} keySystemsByURI
|
|
409
|
+
* @param {!Set.<string>} keyIds
|
|
354
410
|
* @return {!Array.<shaka.extern.DrmInfo>}
|
|
355
411
|
* @private
|
|
356
412
|
*/
|
|
357
|
-
static convertElements_(defaultInit, elements, keySystemsByURI) {
|
|
413
|
+
static convertElements_(defaultInit, elements, keySystemsByURI, keyIds) {
|
|
358
414
|
const ContentProtection = shaka.dash.ContentProtection;
|
|
359
415
|
const ManifestParserUtils = shaka.util.ManifestParserUtils;
|
|
360
416
|
const licenseUrlParsers = ContentProtection.licenseUrlParsers_;
|
|
@@ -370,7 +426,14 @@ shaka.dash.ContentProtection = class {
|
|
|
370
426
|
'Init data must be null or non-empty.');
|
|
371
427
|
|
|
372
428
|
const proInitData = ContentProtection.getInitDataFromPro_(element);
|
|
373
|
-
|
|
429
|
+
let clearKeyInitData = null;
|
|
430
|
+
if (element.schemeUri ===
|
|
431
|
+
shaka.dash.ContentProtection.ClearKeySchemeUri_) {
|
|
432
|
+
clearKeyInitData =
|
|
433
|
+
ContentProtection.getInitDataClearKey_(element, keyIds);
|
|
434
|
+
}
|
|
435
|
+
const initData = element.init || defaultInit || proInitData ||
|
|
436
|
+
clearKeyInitData;
|
|
374
437
|
const info = ManifestParserUtils.createDrmInfo(keySystem, initData);
|
|
375
438
|
const licenseParser = licenseUrlParsers.get(keySystem);
|
|
376
439
|
if (licenseParser) {
|
|
@@ -562,7 +625,9 @@ shaka.dash.ContentProtection.licenseUrlParsers_ = new Map()
|
|
|
562
625
|
.set('com.microsoft.playready.software',
|
|
563
626
|
shaka.dash.ContentProtection.getPlayReadyLicenseUrl)
|
|
564
627
|
.set('com.microsoft.playready.hardware',
|
|
565
|
-
shaka.dash.ContentProtection.getPlayReadyLicenseUrl)
|
|
628
|
+
shaka.dash.ContentProtection.getPlayReadyLicenseUrl)
|
|
629
|
+
.set('org.w3.clearkey',
|
|
630
|
+
shaka.dash.ContentProtection.getClearKeyLicenseUrl);
|
|
566
631
|
|
|
567
632
|
/**
|
|
568
633
|
* @const {string}
|
|
@@ -577,3 +642,18 @@ shaka.dash.ContentProtection.MP4Protection_ =
|
|
|
577
642
|
* @private
|
|
578
643
|
*/
|
|
579
644
|
shaka.dash.ContentProtection.CencNamespaceUri_ = 'urn:mpeg:cenc:2013';
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* @const {string}
|
|
648
|
+
* @private
|
|
649
|
+
*/
|
|
650
|
+
shaka.dash.ContentProtection.ClearKeyNamespaceUri_ =
|
|
651
|
+
'http://dashif.org/guidelines/clearKey';
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* @const {string}
|
|
656
|
+
* @private
|
|
657
|
+
*/
|
|
658
|
+
shaka.dash.ContentProtection.ClearKeySchemeUri_ =
|
|
659
|
+
'urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e';
|
package/lib/dash/dash_parser.js
CHANGED
|
@@ -498,6 +498,7 @@ shaka.dash.DashParser = class {
|
|
|
498
498
|
imageStreams: this.periodCombiner_.getImageStreams(),
|
|
499
499
|
offlineSessionIds: [],
|
|
500
500
|
minBufferTime: minBufferTime || 0,
|
|
501
|
+
sequenceMode: false,
|
|
501
502
|
};
|
|
502
503
|
|
|
503
504
|
// We only need to do clock sync when we're using presentation start
|