shaka-player 3.3.4 → 4.0.0
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/workflows/build-and-test.yaml +0 -1
- package/.github/workflows/demo-version-index.yaml +8 -0
- package/.github/workflows/release-please.yaml +23 -2
- package/.github/workflows/selenium-lab-tests.yaml +0 -1
- 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 +198 -32
- package/CONTRIBUTORS +1 -0
- package/README.md +10 -7
- 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/README.md +2 -2
- package/build/compiler.py +1 -1
- package/build/generateTsDefs.py +0 -2
- package/build/shaka-lab.yaml +0 -2
- package/build/test.py +7 -1
- package/build/types/core +0 -1
- 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_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 +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 +16 -20
- package/dist/locales.js +31 -29
- 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 +78 -83
- package/dist/shaka-player.compiled.debug.d.ts +78 -83
- package/dist/shaka-player.compiled.debug.externs.js +126 -126
- package/dist/shaka-player.compiled.debug.js +426 -483
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +126 -126
- package/dist/shaka-player.compiled.js +838 -856
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +80 -83
- package/dist/shaka-player.ui.debug.d.ts +80 -83
- package/dist/shaka-player.ui.debug.externs.js +134 -126
- package/dist/shaka-player.ui.debug.js +488 -543
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +134 -126
- package/dist/shaka-player.ui.js +980 -994
- 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 +83 -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 -32
- package/externs/shaka/text.js +12 -12
- package/externs/sourcebuffer.js +15 -0
- 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 -1
- package/lib/hls/hls_parser.js +378 -743
- package/lib/hls/manifest_text_parser.js +2 -3
- package/lib/media/drm_engine.js +102 -53
- package/lib/media/gap_jumping_controller.js +10 -45
- package/lib/media/media_source_engine.js +87 -15
- 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 +29 -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 +100 -132
- 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 +24 -2
- 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 +2 -0
- package/lib/util/platform.js +45 -0
- package/lib/util/player_configuration.js +12 -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 +1 -1
- package/roadmap.md +19 -19
- package/shaka-player.uncompiled.js +0 -3
- package/test/cast/cast_utils_unit.js +1 -0
- package/test/dash/dash_parser_content_protection_unit.js +44 -0
- package/test/dash/dash_parser_manifest_unit.js +0 -24
- 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 +99 -220
- 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 +26 -3
- package/test/media/media_source_engine_unit.js +7 -6
- package/test/media/playhead_unit.js +27 -191
- package/test/media/segment_index_unit.js +15 -25
- package/test/media/streaming_engine_integration.js +4 -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 +55 -57
- 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 +3 -3
- 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/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/lib/util/mutex.js +0 -52
- package/test/util/functional_unit.js +0 -82
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
goog.provide('shaka.util.Uint8ArrayUtils');
|
|
8
8
|
|
|
9
|
-
goog.require('shaka.Deprecate');
|
|
10
9
|
goog.require('shaka.util.BufferUtils');
|
|
11
10
|
goog.require('shaka.util.StringUtils');
|
|
12
11
|
|
|
@@ -17,21 +16,6 @@ goog.require('shaka.util.StringUtils');
|
|
|
17
16
|
* @export
|
|
18
17
|
*/
|
|
19
18
|
shaka.util.Uint8ArrayUtils = class {
|
|
20
|
-
/**
|
|
21
|
-
* Compare two Uint8Arrays for equality.
|
|
22
|
-
* @param {Uint8Array} arr1
|
|
23
|
-
* @param {Uint8Array} arr2
|
|
24
|
-
* @return {boolean}
|
|
25
|
-
* @deprecated
|
|
26
|
-
* @export
|
|
27
|
-
*/
|
|
28
|
-
static equal(arr1, arr2) {
|
|
29
|
-
shaka.Deprecate.deprecateFeature(4,
|
|
30
|
-
'shaka.util.Uint8ArrayUtils.equal',
|
|
31
|
-
'Please use shaka.util.BufferUtils.equal instead.');
|
|
32
|
-
return shaka.util.BufferUtils.equal(arr1, arr2);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
19
|
/**
|
|
36
20
|
* Convert a buffer to a base64 string. The output will be standard
|
|
37
21
|
* alphabet as opposed to base64url safe alphabet.
|
package/lib/util/xml_utils.js
CHANGED
package/package.json
CHANGED
package/roadmap.md
CHANGED
|
@@ -9,41 +9,41 @@ 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
|
-
- Support containerless formats
|
|
13
|
-
https://github.com/shaka-project/shaka-player/issues/2337
|
|
14
12
|
- Preload API
|
|
15
13
|
https://github.com/shaka-project/shaka-player/issues/880
|
|
16
|
-
- Codec-switching and order preference
|
|
17
|
-
https://github.com/shaka-project/shaka-player/issues/1528
|
|
18
|
-
https://github.com/shaka-project/shaka-player/issues/2179
|
|
19
14
|
|
|
20
15
|
Candidate features for future release cycles:
|
|
21
|
-
- HLS interstitial support
|
|
22
|
-
https://github.com/shaka-project/shaka-player/issues/3364
|
|
23
|
-
- Support ID3 tags in mp4
|
|
24
|
-
https://github.com/shaka-project/shaka-player/issues/3351
|
|
25
|
-
- MSE support for FairPlay
|
|
26
|
-
https://github.com/shaka-project/shaka-player/issues/3346
|
|
27
|
-
- Smaller, more modular binary
|
|
28
16
|
- Official TypeScript defs, generated from source
|
|
29
17
|
https://github.com/shaka-project/shaka-player/issues/1030
|
|
30
|
-
-
|
|
31
|
-
https://github.com/shaka-project/shaka-player/issues/
|
|
32
|
-
- Integration with Google Video ML/Cloud AI
|
|
33
|
-
|
|
34
|
-
v3.3 - 2021 Q3 or Q4
|
|
18
|
+
- Codec-switching
|
|
19
|
+
https://github.com/shaka-project/shaka-player/issues/1528
|
|
35
20
|
- Background fetch for offline storage
|
|
36
21
|
https://github.com/shaka-project/shaka-player/issues/879
|
|
37
|
-
-
|
|
38
|
-
https://github.com/shaka-project/shaka-player/issues/
|
|
22
|
+
- Support ID3 tags in mp4
|
|
23
|
+
https://github.com/shaka-project/shaka-player/issues/3351
|
|
24
|
+
- Smaller, more modular binary
|
|
25
|
+
|
|
26
|
+
v3.4 - 2022 Q1 or Q2
|
|
27
|
+
- MSE support for FairPlay
|
|
28
|
+
https://github.com/shaka-project/shaka-player/issues/3346
|
|
29
|
+
- Support containerless formats
|
|
30
|
+
https://github.com/shaka-project/shaka-player/issues/2337
|
|
39
31
|
|
|
40
32
|
=====
|
|
41
33
|
|
|
34
|
+
v3.3 - 2022 Q1
|
|
35
|
+
- Common Media Client Data (CMCD) logging support
|
|
36
|
+
https://github.com/shaka-project/shaka-player/issues/3619
|
|
37
|
+
- Non-linear IMA CS ads
|
|
38
|
+
https://github.com/shaka-project/shaka-player/pull/3639
|
|
39
|
+
|
|
42
40
|
v3.2 - 2021 Q3
|
|
43
41
|
- MediaCapabilities to make performance-based decisions
|
|
44
42
|
https://github.com/shaka-project/shaka-player/issues/1391
|
|
45
43
|
- Configurable key-system priority
|
|
46
44
|
https://github.com/shaka-project/shaka-player/issues/3002
|
|
45
|
+
- Codec order preferences
|
|
46
|
+
https://github.com/shaka-project/shaka-player/issues/2179
|
|
47
47
|
|
|
48
48
|
v3.1 - 2021 Q2
|
|
49
49
|
- Low-latency live (LL-HLS, LL-DASH)
|
|
@@ -35,12 +35,9 @@ goog.require('shaka.offline.indexeddb.StorageMechanism');
|
|
|
35
35
|
goog.require('shaka.polyfill.Aria');
|
|
36
36
|
goog.require('shaka.polyfill.EncryptionScheme');
|
|
37
37
|
goog.require('shaka.polyfill.Fullscreen');
|
|
38
|
-
goog.require('shaka.polyfill.MathRound');
|
|
39
38
|
goog.require('shaka.polyfill.MediaSource');
|
|
40
39
|
goog.require('shaka.polyfill.MediaCapabilities');
|
|
41
40
|
goog.require('shaka.polyfill.Orientation');
|
|
42
|
-
goog.require('shaka.polyfill.PatchedMediaKeysApple');
|
|
43
|
-
goog.require('shaka.polyfill.PatchedMediaKeysMs');
|
|
44
41
|
goog.require('shaka.polyfill.PatchedMediaKeysNop');
|
|
45
42
|
goog.require('shaka.polyfill.PatchedMediaKeysWebkit');
|
|
46
43
|
goog.require('shaka.polyfill.PiPWebkit');
|
|
@@ -805,6 +805,50 @@ describe('DashParser ContentProtection', () => {
|
|
|
805
805
|
});
|
|
806
806
|
});
|
|
807
807
|
|
|
808
|
+
describe('getClearKeyLicenseUrl', () => {
|
|
809
|
+
it('valid clearkey:Laurl node', () => {
|
|
810
|
+
const input = {
|
|
811
|
+
init: null,
|
|
812
|
+
keyId: null,
|
|
813
|
+
schemeUri: '',
|
|
814
|
+
node: strToXml([
|
|
815
|
+
'<test xmlns:clearkey="http://dashif.org/guidelines/clearKey">',
|
|
816
|
+
' <clearkey:Laurl ',
|
|
817
|
+
' Lic_type="EME-1.0">www.example.com</clearkey:Laurl>',
|
|
818
|
+
'</test>',
|
|
819
|
+
].join('\n')),
|
|
820
|
+
};
|
|
821
|
+
const actual = ContentProtection.getClearKeyLicenseUrl(input);
|
|
822
|
+
expect(actual).toBe('www.example.com');
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
it('clearkey:Laurl without license url', () => {
|
|
826
|
+
const input = {
|
|
827
|
+
init: null,
|
|
828
|
+
keyId: null,
|
|
829
|
+
schemeUri: '',
|
|
830
|
+
node: strToXml([
|
|
831
|
+
'<test xmlns:clearkey="http://dashif.org/guidelines/clearKey">',
|
|
832
|
+
' <clearkey:Laurl Lic_type="EME-1.0"></clearkey:Laurl>',
|
|
833
|
+
'</test>',
|
|
834
|
+
].join('\n')),
|
|
835
|
+
};
|
|
836
|
+
const actual = ContentProtection.getClearKeyLicenseUrl(input);
|
|
837
|
+
expect(actual).toBe('');
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
it('no clearkey:Laurl node', () => {
|
|
841
|
+
const input = {
|
|
842
|
+
init: null,
|
|
843
|
+
keyId: null,
|
|
844
|
+
schemeUri: '',
|
|
845
|
+
node: strToXml('<test></test>'),
|
|
846
|
+
};
|
|
847
|
+
const actual = ContentProtection.getClearKeyLicenseUrl(input);
|
|
848
|
+
expect(actual).toBe('');
|
|
849
|
+
});
|
|
850
|
+
});
|
|
851
|
+
|
|
808
852
|
describe('getPlayReadyLicenseURL', () => {
|
|
809
853
|
it('mspro', () => {
|
|
810
854
|
const laurl = [
|
|
@@ -447,30 +447,6 @@ describe('DashParser Manifest', () => {
|
|
|
447
447
|
expect(stream.closedCaptions).toEqual(expectedClosedCaptions);
|
|
448
448
|
});
|
|
449
449
|
|
|
450
|
-
it('Detects E-AC3 JOC content by SupplementalProperty', async () => {
|
|
451
|
-
const idUri = 'tag:dolby.com,2018:dash:EC3_ExtensionType:2018';
|
|
452
|
-
const source = [
|
|
453
|
-
'<MPD>',
|
|
454
|
-
' <Period duration="PT30M">',
|
|
455
|
-
' <AdaptationSet mimeType="audio/mp4" lang="\u2603">',
|
|
456
|
-
' <Representation bandwidth="500">',
|
|
457
|
-
' <SupplementalProperty schemeIdUri="' + idUri + '" value="JOC"/>',
|
|
458
|
-
' <BaseURL>http://example.com</BaseURL>',
|
|
459
|
-
' <SegmentTemplate media="2.mp4" duration="1" />',
|
|
460
|
-
' </Representation>',
|
|
461
|
-
' </AdaptationSet>',
|
|
462
|
-
' </Period>',
|
|
463
|
-
'</MPD>',
|
|
464
|
-
].join('\n');
|
|
465
|
-
|
|
466
|
-
fakeNetEngine.setResponseText('dummy://foo', source);
|
|
467
|
-
|
|
468
|
-
/** @type {shaka.extern.Manifest} */
|
|
469
|
-
const manifest = await parser.start('dummy://foo', playerInterface);
|
|
470
|
-
const stream = manifest.variants[0].audio;
|
|
471
|
-
expect(stream.mimeType).toBe('audio/eac3-joc');
|
|
472
|
-
});
|
|
473
|
-
|
|
474
450
|
it('Detects spatial audio', async () => {
|
|
475
451
|
const idUri = 'tag:dolby.com,2018:dash:EC3_ExtensionType:2018';
|
|
476
452
|
const source = [
|
|
@@ -106,9 +106,8 @@ describe('DashParser SegmentTemplate', () => {
|
|
|
106
106
|
's2.mp4', 50, 60, baseUri);
|
|
107
107
|
expectedRef2.timestampOffset = -10;
|
|
108
108
|
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
const ref2 = iterator.seek(55);
|
|
109
|
+
const ref1 = stream.segmentIndex.getIteratorForTime(45).next().value;
|
|
110
|
+
const ref2 = stream.segmentIndex.getIteratorForTime(55).next().value;
|
|
112
111
|
expect(ref1).toEqual(expectedRef1);
|
|
113
112
|
expect(ref2).toEqual(expectedRef2);
|
|
114
113
|
});
|
|
@@ -445,7 +444,7 @@ describe('DashParser SegmentTemplate', () => {
|
|
|
445
444
|
await variants[2].video.createSegmentIndex();
|
|
446
445
|
|
|
447
446
|
const getRefAt = (stream, time) => {
|
|
448
|
-
return stream.segmentIndex
|
|
447
|
+
return stream.segmentIndex.getIteratorForTime(time).next().value;
|
|
449
448
|
};
|
|
450
449
|
|
|
451
450
|
expect(getRefAt(variants[0].video, 0)).toEqual(
|
package/test/demo/demo_unit.js
CHANGED
|
@@ -93,7 +93,8 @@ describe('Demo', () => {
|
|
|
93
93
|
.add('preferredVariantRole')
|
|
94
94
|
.add('playRangeStart')
|
|
95
95
|
.add('playRangeEnd')
|
|
96
|
-
.add('manifest.dash.keySystemsByURI')
|
|
96
|
+
.add('manifest.dash.keySystemsByURI')
|
|
97
|
+
.add('manifest.hls.mediaPlaylistFullMimeType');
|
|
97
98
|
|
|
98
99
|
/**
|
|
99
100
|
* @param {!Object} section
|