shaka-player 3.1.1 → 3.1.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 +7 -2
- package/CHANGELOG.md +199 -0
- package/CONTRIBUTORS +9 -3
- package/build/generateExterns.js +1 -1
- package/build/misspellings.txt +1 -0
- package/build/shakaBuildHelpers.py +6 -5
- package/build/subprocessWindowsPatch.py +103 -0
- package/demo/common/assets.js +1 -1
- package/dist/controls.css +2 -2
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +1 -1
- package/dist/demo.compiled.js +1 -1
- package/dist/deps.js +7 -7
- package/dist/locales.js +35 -33
- package/dist/receiver.compiled.debug.js +1 -1
- package/dist/receiver.compiled.js +1 -1
- package/dist/shaka-player.compiled.d.ts +171 -3
- package/dist/shaka-player.compiled.debug.d.ts +171 -3
- package/dist/shaka-player.compiled.debug.externs.js +179 -1
- package/dist/shaka-player.compiled.debug.js +365 -344
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +179 -1
- package/dist/shaka-player.compiled.js +806 -798
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +171 -3
- package/dist/shaka-player.ui.debug.d.ts +171 -3
- package/dist/shaka-player.ui.debug.externs.js +181 -3
- package/dist/shaka-player.ui.debug.js +458 -435
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +181 -3
- package/dist/shaka-player.ui.js +927 -918
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/fairplay.md +1 -1
- package/docs/tutorials/faq.md +14 -0
- package/docs/tutorials/index.json +2 -2
- package/docs/tutorials/upgrade-v3.md +38 -0
- package/docs/tutorials/upgrade.md +3 -3
- package/externs/ima.js +4 -0
- package/externs/shaka/ads.js +2 -0
- package/externs/shaka/player.js +6 -0
- package/externs/shaka/text.js +10 -0
- package/karma.conf.js +1 -0
- package/lib/ads/ad_manager.js +29 -11
- package/lib/ads/client_side_ad_manager.js +76 -86
- package/lib/ads/server_side_ad_manager.js +26 -11
- package/lib/cast/cast_proxy.js +3 -2
- package/lib/cast/cast_receiver.js +2 -1
- package/lib/cast/cast_sender.js +2 -2
- package/lib/cea/sei_processor.js +24 -17
- package/lib/dash/dash_parser.js +100 -5
- package/lib/dash/segment_list.js +1 -1
- package/lib/dash/segment_template.js +7 -4
- package/lib/hls/hls_parser.js +44 -17
- package/lib/media/closed_caption_parser.js +3 -1
- package/lib/media/content_workarounds.js +12 -0
- package/lib/media/drm_engine.js +20 -1
- package/lib/media/gap_jumping_controller.js +8 -4
- package/lib/media/media_source_engine.js +1 -2
- package/lib/media/playhead.js +1 -1
- package/lib/media/presentation_timeline.js +3 -1
- package/lib/media/segment_reference.js +8 -0
- package/lib/media/streaming_engine.js +28 -19
- package/lib/net/networking_engine.js +2 -1
- package/lib/player.js +108 -54
- package/lib/polyfill/encryption_scheme.js +2 -0
- package/lib/polyfill/fullscreen.js +2 -0
- package/lib/polyfill/mathround.js +2 -0
- package/lib/polyfill/media_capabilities.js +76 -22
- package/lib/polyfill/mediasource.js +8 -0
- package/lib/polyfill/orientation.js +3 -1
- package/lib/polyfill/patchedmediakeys_apple.js +6 -4
- package/lib/polyfill/patchedmediakeys_ms.js +6 -4
- package/lib/polyfill/patchedmediakeys_nop.js +2 -0
- package/lib/polyfill/patchedmediakeys_webkit.js +6 -4
- package/lib/polyfill/pip_webkit.js +2 -0
- package/lib/polyfill/storage_estimate.js +2 -0
- package/lib/polyfill/video_play_promise.js +2 -0
- package/lib/polyfill/videoplaybackquality.js +2 -0
- package/lib/polyfill/vttcue.js +2 -0
- package/lib/text/cue.js +17 -0
- package/lib/text/mp4_ttml_parser.js +3 -0
- package/lib/text/text_engine.js +14 -2
- package/lib/text/ttml_text_parser.js +135 -87
- package/lib/text/ui_text_displayer.js +233 -83
- package/lib/text/vtt_text_parser.js +4 -2
- package/lib/util/fake_event.js +53 -7
- package/lib/util/mp4_box_parsers.js +1 -1
- package/lib/util/periods.js +111 -35
- package/lib/util/platform.js +13 -1
- package/lib/util/stream_utils.js +79 -10
- package/lib/util/xml_utils.js +19 -0
- package/package.json +2 -2
- package/test/cast/cast_proxy_unit.js +12 -6
- package/test/cast/cast_receiver_integration.js +1 -1
- package/test/cast/cast_utils_unit.js +1 -1
- package/test/cea/mp4_cea_parser_unit.js +26 -0
- package/test/dash/dash_parser_live_unit.js +1 -0
- package/test/dash/dash_parser_manifest_unit.js +220 -2
- package/test/dash/dash_parser_segment_template_unit.js +3 -3
- package/test/hls/hls_parser_unit.js +5 -1
- package/test/media/closed_caption_parser_unit.js +20 -0
- package/test/media/drm_engine_unit.js +56 -0
- package/test/media/playhead_unit.js +27 -1
- package/test/media/presentation_timeline_unit.js +19 -0
- package/test/media/streaming_engine_integration.js +2 -1
- package/test/media/streaming_engine_unit.js +148 -3
- package/test/player_integration.js +38 -0
- package/test/player_unit.js +101 -0
- package/test/test/assets/3675/chunk-stream0-00001.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00002.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00003.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00004.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00005.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00006.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00007.m4s +0 -0
- package/test/test/assets/3675/dash_0.mpd +30 -0
- package/test/test/assets/3675/dash_1.mpd +30 -0
- package/test/test/assets/3675/dash_2.mpd +30 -0
- package/test/test/assets/3675/dash_3.mpd +30 -0
- package/test/test/assets/3675/dash_4.mpd +30 -0
- package/test/test/assets/3675/dash_5.mpd +26 -0
- package/test/test/assets/3675/init-stream0.m4s +0 -0
- package/test/test/assets/empty_caption_video_init.mp4 +0 -0
- package/test/test/assets/empty_caption_video_segment.mp4 +0 -0
- package/test/test/util/fake_ad_manager.js +4 -1
- package/test/test/util/simple_fakes.js +5 -3
- package/test/test/util/ttml_utils.js +81 -0
- package/test/text/mp4_ttml_parser_unit.js +11 -18
- package/test/text/ttml_text_parser_unit.js +542 -220
- package/test/text/ui_text_displayer_unit.js +95 -18
- package/test/text/vtt_text_parser_unit.js +17 -1
- package/test/ui/localization_unit.js +15 -14
- package/test/ui/text_displayer_layout_unit.js +52 -1
- package/test/util/mp4_box_parsers_unit.js +28 -0
- package/test/util/periods_unit.js +190 -2
- package/test/util/stream_utils_unit.js +59 -2
- package/ui/airplay_button.js +5 -0
- package/ui/big_play_button.js +10 -0
- package/ui/cast_button.js +2 -3
- package/ui/controls.js +8 -6
- package/ui/less/buttons.less +0 -4
- package/ui/less/containers.less +10 -5
- package/ui/locales/en.json +1 -0
- package/ui/locales/ru.json +6 -6
- package/ui/locales/source.json +4 -0
- package/ui/localization.js +28 -51
- package/ui/pip_button.js +2 -3
- package/ui/play_button.js +10 -10
- package/ui/small_play_button.js +12 -0
- package/ui/text_selection.js +1 -0
- package/docs/tutorials/upgrade-v2-4.md +0 -481
|
@@ -32,9 +32,9 @@ shaka.offline = {};
|
|
|
32
32
|
/** @const */
|
|
33
33
|
shaka.text = {};
|
|
34
34
|
/** @const */
|
|
35
|
-
shaka.util = {};
|
|
36
|
-
/** @const */
|
|
37
35
|
shaka.ui = {};
|
|
36
|
+
/** @const */
|
|
37
|
+
shaka.util = {};
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* @summary Create an Event work-alike object based on the provided dictionary.
|
|
@@ -44,7 +44,7 @@ shaka.ui = {};
|
|
|
44
44
|
shaka.util.FakeEvent = class {
|
|
45
45
|
/**
|
|
46
46
|
* @param {string} type
|
|
47
|
-
* @param {Object
|
|
47
|
+
* @param {Map.<string, Object>=} dict
|
|
48
48
|
*/
|
|
49
49
|
constructor(type, dict) {}
|
|
50
50
|
};
|
|
@@ -891,6 +891,10 @@ shaka.text.Cue.prototype.id;
|
|
|
891
891
|
* @override
|
|
892
892
|
*/
|
|
893
893
|
shaka.text.Cue.prototype.nestedCues;
|
|
894
|
+
/**
|
|
895
|
+
* @override
|
|
896
|
+
*/
|
|
897
|
+
shaka.text.Cue.prototype.isContainer;
|
|
894
898
|
/**
|
|
895
899
|
* @override
|
|
896
900
|
*/
|
|
@@ -2823,6 +2827,7 @@ shaka.ads.ServerSideAd = class {
|
|
|
2823
2827
|
/**
|
|
2824
2828
|
* A class responsible for ad-related interactions.
|
|
2825
2829
|
* @implements {shaka.extern.IAdManager}
|
|
2830
|
+
* @implements {shaka.util.IReleasable}
|
|
2826
2831
|
*/
|
|
2827
2832
|
shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
|
|
2828
2833
|
/** */
|
|
@@ -2835,6 +2840,10 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
|
|
|
2835
2840
|
* @override
|
|
2836
2841
|
*/
|
|
2837
2842
|
initClientSide(adContainer, video) {}
|
|
2843
|
+
/**
|
|
2844
|
+
* @override
|
|
2845
|
+
*/
|
|
2846
|
+
release() {}
|
|
2838
2847
|
/**
|
|
2839
2848
|
* @override
|
|
2840
2849
|
*/
|
|
@@ -3473,6 +3482,175 @@ shaka.polyfill = class {
|
|
|
3473
3482
|
*/
|
|
3474
3483
|
static register(polyfill, priority) {}
|
|
3475
3484
|
};
|
|
3485
|
+
/**
|
|
3486
|
+
* @summary A polyfill to add support for EncryptionScheme queries in EME.
|
|
3487
|
+
* @see https://wicg.github.io/encrypted-media-encryption-scheme/
|
|
3488
|
+
* @see https://github.com/w3c/encrypted-media/pull/457
|
|
3489
|
+
* @see https://github.com/google/eme-encryption-scheme-polyfill
|
|
3490
|
+
*/
|
|
3491
|
+
shaka.polyfill.EncryptionScheme = class {
|
|
3492
|
+
/**
|
|
3493
|
+
* Install the polyfill if needed.
|
|
3494
|
+
* @suppress {missingRequire}
|
|
3495
|
+
*/
|
|
3496
|
+
static install() {}
|
|
3497
|
+
};
|
|
3498
|
+
/**
|
|
3499
|
+
* @summary A polyfill to unify fullscreen APIs across browsers.
|
|
3500
|
+
* Many browsers have prefixed fullscreen methods on Element and document.
|
|
3501
|
+
* See {@link https://mzl.la/2K0xcHo Using fullscreen mode} on MDN for more
|
|
3502
|
+
* information.
|
|
3503
|
+
*/
|
|
3504
|
+
shaka.polyfill.Fullscreen = class {
|
|
3505
|
+
/**
|
|
3506
|
+
* Install the polyfill if needed.
|
|
3507
|
+
*/
|
|
3508
|
+
static install() {}
|
|
3509
|
+
};
|
|
3510
|
+
/**
|
|
3511
|
+
* @summary A polyfill to patch math round bug on some browsers.
|
|
3512
|
+
* @see https://stackoverflow.com/q/12830742
|
|
3513
|
+
*/
|
|
3514
|
+
shaka.polyfill.MathRound = class {
|
|
3515
|
+
/**
|
|
3516
|
+
* Install the polyfill if needed.
|
|
3517
|
+
*/
|
|
3518
|
+
static install() {}
|
|
3519
|
+
};
|
|
3520
|
+
/**
|
|
3521
|
+
* @summary A polyfill to provide navigator.mediaCapabilities on all browsers.
|
|
3522
|
+
* This is necessary for Tizen 3, Xbox One and possibly others we have yet to
|
|
3523
|
+
* discover.
|
|
3524
|
+
*/
|
|
3525
|
+
shaka.polyfill.MediaCapabilities = class {
|
|
3526
|
+
/**
|
|
3527
|
+
* Install the polyfill if needed.
|
|
3528
|
+
* @suppress {const}
|
|
3529
|
+
*/
|
|
3530
|
+
static install() {}
|
|
3531
|
+
};
|
|
3532
|
+
/**
|
|
3533
|
+
* A copy of the MediaCapabilities instance, to prevent Safari from
|
|
3534
|
+
* garbage-collecting the polyfilled method on it. We make it public and export
|
|
3535
|
+
* it to ensure that it is not stripped out by the compiler.
|
|
3536
|
+
* @type {MediaCapabilities}
|
|
3537
|
+
*/
|
|
3538
|
+
shaka.polyfill.MediaCapabilities.originalMcap;
|
|
3539
|
+
/**
|
|
3540
|
+
* @summary A polyfill to patch MSE bugs.
|
|
3541
|
+
*/
|
|
3542
|
+
shaka.polyfill.MediaSource = class {
|
|
3543
|
+
/**
|
|
3544
|
+
* Install the polyfill if needed.
|
|
3545
|
+
*/
|
|
3546
|
+
static install() {}
|
|
3547
|
+
};
|
|
3548
|
+
/**
|
|
3549
|
+
* @summary A polyfill for systems that do not implement screen.orientation.
|
|
3550
|
+
* For now, this only handles systems that implement the deprecated
|
|
3551
|
+
* window.orientation feature... e.g. iPad.
|
|
3552
|
+
*/
|
|
3553
|
+
shaka.polyfill.Orientation = class {
|
|
3554
|
+
/**
|
|
3555
|
+
* Install the polyfill if needed.
|
|
3556
|
+
*/
|
|
3557
|
+
static install() {}
|
|
3558
|
+
};
|
|
3559
|
+
/**
|
|
3560
|
+
* @summary A polyfill to implement modern, standardized EME on top of Apple's
|
|
3561
|
+
* prefixed EME in Safari.
|
|
3562
|
+
*/
|
|
3563
|
+
shaka.polyfill.PatchedMediaKeysApple = class {
|
|
3564
|
+
/**
|
|
3565
|
+
* Installs the polyfill if needed.
|
|
3566
|
+
*/
|
|
3567
|
+
static install() {}
|
|
3568
|
+
};
|
|
3569
|
+
/**
|
|
3570
|
+
* @summary A polyfill to implement
|
|
3571
|
+
* {@link https://bit.ly/EmeMar15 EME draft 12 March 2015}
|
|
3572
|
+
* on top of ms-prefixed
|
|
3573
|
+
* {@link https://www.w3.org/TR/2014/WD-encrypted-media-20140218/ EME v20140218}
|
|
3574
|
+
*/
|
|
3575
|
+
shaka.polyfill.PatchedMediaKeysMs = class {
|
|
3576
|
+
/**
|
|
3577
|
+
* Installs the polyfill if needed.
|
|
3578
|
+
*/
|
|
3579
|
+
static install() {}
|
|
3580
|
+
};
|
|
3581
|
+
/**
|
|
3582
|
+
* @summary A polyfill to stub out
|
|
3583
|
+
* {@link https://bit.ly/EmeMar15 EME draft 12 March 2015} on browsers without
|
|
3584
|
+
* EME.
|
|
3585
|
+
* All methods will fail.
|
|
3586
|
+
*/
|
|
3587
|
+
shaka.polyfill.PatchedMediaKeysNop = class {
|
|
3588
|
+
/**
|
|
3589
|
+
* Installs the polyfill if needed.
|
|
3590
|
+
*/
|
|
3591
|
+
static install() {}
|
|
3592
|
+
};
|
|
3593
|
+
/**
|
|
3594
|
+
* @summary A polyfill to implement
|
|
3595
|
+
* {@link https://bit.ly/EmeMar15 EME draft 12 March 2015} on top of
|
|
3596
|
+
* webkit-prefixed {@link https://bit.ly/Eme01b EME v0.1b}.
|
|
3597
|
+
*/
|
|
3598
|
+
shaka.polyfill.PatchedMediaKeysWebkit = class {
|
|
3599
|
+
/**
|
|
3600
|
+
* Installs the polyfill if needed.
|
|
3601
|
+
*/
|
|
3602
|
+
static install() {}
|
|
3603
|
+
};
|
|
3604
|
+
/**
|
|
3605
|
+
* @summary A polyfill to provide PiP support in Safari.
|
|
3606
|
+
* Note that Safari only supports PiP on video elements, not audio.
|
|
3607
|
+
*/
|
|
3608
|
+
shaka.polyfill.PiPWebkit = class {
|
|
3609
|
+
/**
|
|
3610
|
+
* Install the polyfill if needed.
|
|
3611
|
+
*/
|
|
3612
|
+
static install() {}
|
|
3613
|
+
};
|
|
3614
|
+
/**
|
|
3615
|
+
* @summary A polyfill to provide navigator.storage.estimate in old
|
|
3616
|
+
* webkit browsers.
|
|
3617
|
+
* See: https://developers.google.com/web/updates/2017/08/estimating-available-storage-space#the-present
|
|
3618
|
+
*/
|
|
3619
|
+
shaka.polyfill.StorageEstimate = class {
|
|
3620
|
+
/**
|
|
3621
|
+
* Install the polyfill if needed.
|
|
3622
|
+
*/
|
|
3623
|
+
static install() {}
|
|
3624
|
+
};
|
|
3625
|
+
/**
|
|
3626
|
+
* @summary A polyfill to silence the play() Promise in HTML5 video.
|
|
3627
|
+
*/
|
|
3628
|
+
shaka.polyfill.VideoPlayPromise = class {
|
|
3629
|
+
/**
|
|
3630
|
+
* Install the polyfill if needed.
|
|
3631
|
+
*/
|
|
3632
|
+
static install() {}
|
|
3633
|
+
};
|
|
3634
|
+
/**
|
|
3635
|
+
* @summary A polyfill to provide MSE VideoPlaybackQuality metrics.
|
|
3636
|
+
* Many browsers do not yet provide this API, and Chrome currently provides
|
|
3637
|
+
* similar data through individual prefixed attributes on HTMLVideoElement.
|
|
3638
|
+
*/
|
|
3639
|
+
shaka.polyfill.VideoPlaybackQuality = class {
|
|
3640
|
+
/**
|
|
3641
|
+
* Install the polyfill if needed.
|
|
3642
|
+
*/
|
|
3643
|
+
static install() {}
|
|
3644
|
+
};
|
|
3645
|
+
/**
|
|
3646
|
+
* @summary A polyfill to provide VTTCue.
|
|
3647
|
+
*/
|
|
3648
|
+
shaka.polyfill.VTTCue = class {
|
|
3649
|
+
/**
|
|
3650
|
+
* Install the polyfill if needed.
|
|
3651
|
+
*/
|
|
3652
|
+
static install() {}
|
|
3653
|
+
};
|
|
3476
3654
|
/**
|
|
3477
3655
|
* LRC file format: https://en.wikipedia.org/wiki/LRC_(file_format)
|
|
3478
3656
|
* @implements {shaka.extern.TextParser}
|