shaka-player 3.0.11 → 3.0.15

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.
Files changed (142) hide show
  1. package/AUTHORS +5 -0
  2. package/CHANGELOG.md +132 -0
  3. package/CONTRIBUTORS +5 -0
  4. package/README.md +3 -0
  5. package/build/apps.py +2 -2
  6. package/build/check.py +2 -2
  7. package/build/conformance.textproto +0 -9
  8. package/build/generateExterns.js +1 -1
  9. package/build/shakaBuildHelpers.py +6 -5
  10. package/build/subprocessWindowsPatch.py +103 -0
  11. package/demo/common/assets.js +1 -1
  12. package/demo/common/message_ids.js +1 -0
  13. package/demo/config.js +2 -1
  14. package/demo/demo.less +4 -0
  15. package/demo/demo_utils.js +1 -0
  16. package/demo/input_container.js +2 -1
  17. package/demo/locales/en.json +1 -0
  18. package/demo/locales/source.json +4 -0
  19. package/dist/controls.css +2 -2
  20. package/dist/controls.css.map +1 -1
  21. package/dist/demo.compiled.debug.js +63 -60
  22. package/dist/demo.compiled.debug.map +3 -3
  23. package/dist/demo.compiled.js +63 -60
  24. package/dist/demo.compiled.map +3 -3
  25. package/dist/demo.css +1 -1
  26. package/dist/demo.css.map +1 -1
  27. package/dist/deps.js +9 -9
  28. package/dist/locales.js +35 -33
  29. package/dist/receiver.compiled.debug.js +59 -56
  30. package/dist/receiver.compiled.debug.map +3 -3
  31. package/dist/receiver.compiled.js +59 -56
  32. package/dist/receiver.compiled.map +3 -3
  33. package/dist/shaka-player.compiled.d.ts +131 -5
  34. package/dist/shaka-player.compiled.debug.d.ts +131 -5
  35. package/dist/shaka-player.compiled.debug.externs.js +142 -8
  36. package/dist/shaka-player.compiled.debug.js +330 -312
  37. package/dist/shaka-player.compiled.debug.map +4 -4
  38. package/dist/shaka-player.compiled.externs.js +142 -8
  39. package/dist/shaka-player.compiled.js +707 -702
  40. package/dist/shaka-player.compiled.map +4 -4
  41. package/dist/shaka-player.ui.d.ts +131 -5
  42. package/dist/shaka-player.ui.debug.d.ts +131 -5
  43. package/dist/shaka-player.ui.debug.externs.js +144 -10
  44. package/dist/shaka-player.ui.debug.js +354 -333
  45. package/dist/shaka-player.ui.debug.map +4 -4
  46. package/dist/shaka-player.ui.externs.js +144 -10
  47. package/dist/shaka-player.ui.js +860 -855
  48. package/dist/shaka-player.ui.map +4 -4
  49. package/docs/tutorials/fairplay.md +1 -1
  50. package/docs/tutorials/faq.md +25 -0
  51. package/externs/aria.js +18 -0
  52. package/externs/ima.js +4 -0
  53. package/externs/shaka/ads.js +2 -0
  54. package/karma.conf.js +1 -0
  55. package/lib/ads/ad_manager.js +29 -11
  56. package/lib/ads/client_side_ad_manager.js +76 -86
  57. package/lib/ads/server_side_ad_manager.js +26 -11
  58. package/lib/cast/cast_proxy.js +3 -2
  59. package/lib/cast/cast_receiver.js +6 -2
  60. package/lib/cast/cast_sender.js +2 -2
  61. package/lib/dash/dash_parser.js +63 -1
  62. package/lib/dash/segment_list.js +1 -1
  63. package/lib/dash/segment_template.js +41 -14
  64. package/lib/hls/hls_parser.js +41 -11
  65. package/lib/media/content_workarounds.js +18 -0
  66. package/lib/media/drm_engine.js +8 -0
  67. package/lib/media/gap_jumping_controller.js +8 -4
  68. package/lib/media/media_source_engine.js +7 -0
  69. package/lib/media/playhead.js +1 -1
  70. package/lib/media/presentation_timeline.js +3 -2
  71. package/lib/media/segment_index.js +41 -11
  72. package/lib/media/streaming_engine.js +34 -21
  73. package/lib/net/networking_engine.js +2 -1
  74. package/lib/offline/download_manager.js +1 -2
  75. package/lib/player.js +99 -44
  76. package/lib/polyfill/encryption_scheme.js +2 -0
  77. package/lib/polyfill/fullscreen.js +2 -0
  78. package/lib/polyfill/mathround.js +2 -0
  79. package/lib/polyfill/mediasource.js +2 -0
  80. package/lib/polyfill/patchedmediakeys_apple.js +6 -4
  81. package/lib/polyfill/patchedmediakeys_ms.js +6 -4
  82. package/lib/polyfill/patchedmediakeys_nop.js +2 -0
  83. package/lib/polyfill/patchedmediakeys_webkit.js +6 -4
  84. package/lib/polyfill/pip_webkit.js +2 -0
  85. package/lib/polyfill/video_play_promise.js +2 -0
  86. package/lib/polyfill/videoplaybackquality.js +2 -0
  87. package/lib/polyfill/vttcue.js +2 -0
  88. package/lib/text/mp4_ttml_parser.js +3 -0
  89. package/lib/text/ttml_text_parser.js +5 -0
  90. package/lib/text/ui_text_displayer.js +37 -3
  91. package/lib/util/error.js +1 -4
  92. package/lib/util/fake_event.js +53 -7
  93. package/lib/util/mime_utils.js +33 -0
  94. package/lib/util/periods.js +25 -3
  95. package/lib/util/stream_utils.js +11 -0
  96. package/package.json +3 -3
  97. package/test/cast/cast_proxy_unit.js +12 -6
  98. package/test/cast/cast_receiver_integration.js +1 -1
  99. package/test/cast/cast_utils_unit.js +1 -1
  100. package/test/dash/dash_parser_manifest_unit.js +73 -0
  101. package/test/demo/demo_unit.js +0 -1
  102. package/test/hls/hls_parser_unit.js +45 -1
  103. package/test/media/drm_engine_unit.js +56 -0
  104. package/test/media/playhead_unit.js +27 -1
  105. package/test/media/presentation_timeline_unit.js +19 -0
  106. package/test/media/segment_index_unit.js +79 -6
  107. package/test/media/streaming_engine_unit.js +3 -3
  108. package/test/player_integration.js +38 -0
  109. package/test/player_unit.js +19 -1
  110. package/test/test/assets/3675/chunk-stream0-00001.m4s +0 -0
  111. package/test/test/assets/3675/chunk-stream0-00002.m4s +0 -0
  112. package/test/test/assets/3675/chunk-stream0-00003.m4s +0 -0
  113. package/test/test/assets/3675/chunk-stream0-00004.m4s +0 -0
  114. package/test/test/assets/3675/chunk-stream0-00005.m4s +0 -0
  115. package/test/test/assets/3675/chunk-stream0-00006.m4s +0 -0
  116. package/test/test/assets/3675/chunk-stream0-00007.m4s +0 -0
  117. package/test/test/assets/3675/dash_0.mpd +30 -0
  118. package/test/test/assets/3675/dash_1.mpd +30 -0
  119. package/test/test/assets/3675/dash_2.mpd +30 -0
  120. package/test/test/assets/3675/dash_3.mpd +30 -0
  121. package/test/test/assets/3675/dash_4.mpd +30 -0
  122. package/test/test/assets/3675/dash_5.mpd +26 -0
  123. package/test/test/assets/3675/init-stream0.m4s +0 -0
  124. package/test/test/util/fake_ad_manager.js +4 -1
  125. package/test/test/util/fake_media_source_engine.js +4 -0
  126. package/test/test/util/simple_fakes.js +5 -3
  127. package/test/test/util/waiter.js +36 -2
  128. package/test/text/ttml_text_parser_unit.js +9 -0
  129. package/test/text/ui_text_displayer_unit.js +19 -3
  130. package/test/ui/localization_unit.js +15 -14
  131. package/test/ui/ui_unit.js +4 -0
  132. package/ui/big_play_button.js +10 -0
  133. package/ui/cast_button.js +2 -3
  134. package/ui/controls.js +9 -7
  135. package/ui/less/containers.less +3 -0
  136. package/ui/locales/en.json +1 -0
  137. package/ui/locales/ru.json +6 -6
  138. package/ui/locales/source.json +4 -0
  139. package/ui/localization.js +28 -51
  140. package/ui/pip_button.js +2 -3
  141. package/ui/play_button.js +10 -10
  142. package/ui/small_play_button.js +12 -0
@@ -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=} dict
47
+ * @param {Map.<string, Object>=} dict
48
48
  */
49
49
  constructor(type, dict) {}
50
50
  };
@@ -258,10 +258,7 @@ shaka.util.BufferUtils = class {
258
258
  * <ul>
259
259
  * <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaError">MediaError</a>
260
260
  * <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status">HTTP Codes</a>
261
- * <li>
262
- * <a href="https://docs.microsoft.com/en-us/windows/win32/wmdm/error-codes">PlayReady errors</a>
263
- * or
264
- * <a href="https://github.com/tpn/winsdk-10/blob/master/Include/10.0.16299.0/winrt/Windows.Media.Protection.PlayReadyErrors.h">more PlayReady errors</a>
261
+ * <li><a href="https://hresult.info">Edge/PlayReady errors</a>
265
262
  * </ul>
266
263
  * @implements {shaka.extern.Error}
267
264
  * @extends {Error}
@@ -1787,13 +1784,16 @@ shaka.media.SegmentIndex = class {
1787
1784
  offset(offset) {}
1788
1785
  /**
1789
1786
  * Merges the given SegmentReferences. Supports extending the original
1790
- * references only. Will not replace old references or interleave new ones.
1787
+ * references only. Will replace old references with equivalent new ones, and
1788
+ * keep any unique old ones.
1791
1789
  * Used, for example, by the DASH and HLS parser, where manifests may not list
1792
1790
  * all available references, so we must keep available references in memory to
1793
1791
  * fill the availability window.
1794
1792
  * @param {!Array.<!shaka.media.SegmentReference>} references The list of
1795
1793
  * SegmentReferences, which must be sorted first by their start times
1796
1794
  * (ascending) and second by their end times (ascending).
1795
+ * @deprecated Not used directly by our own parsers, so will become private in
1796
+ * v4. Use mergeAndEvict() instead.
1797
1797
  */
1798
1798
  merge(references) {}
1799
1799
  /**
@@ -1837,9 +1837,10 @@ shaka.media.SegmentIndex = class {
1837
1837
  /**
1838
1838
  * Returns a new iterator that initially points to the segment that contains
1839
1839
  * the given time. Like the normal iterator, next() must be called first to
1840
- * get to the first element.
1840
+ * get to the first element. Returns null if we do not find a segment at the
1841
+ * requested time.
1841
1842
  * @param {number} time
1842
- * @return {!shaka.media.SegmentIterator}
1843
+ * @return {?shaka.media.SegmentIterator}
1843
1844
  */
1844
1845
  getIteratorForTime(time) {}
1845
1846
  /**
@@ -2685,6 +2686,7 @@ shaka.ads.ServerSideAd = class {
2685
2686
  /**
2686
2687
  * A class responsible for ad-related interactions.
2687
2688
  * @implements {shaka.extern.IAdManager}
2689
+ * @implements {shaka.util.IReleasable}
2688
2690
  */
2689
2691
  shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
2690
2692
  /** */
@@ -2697,6 +2699,10 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
2697
2699
  * @override
2698
2700
  */
2699
2701
  initClientSide(adContainer, video) {}
2702
+ /**
2703
+ * @override
2704
+ */
2705
+ release() {}
2700
2706
  /**
2701
2707
  * @override
2702
2708
  */
@@ -3335,6 +3341,134 @@ shaka.polyfill = class {
3335
3341
  */
3336
3342
  static register(polyfill, priority) {}
3337
3343
  };
3344
+ /**
3345
+ * @summary A polyfill to add support for EncryptionScheme queries in EME.
3346
+ * @see https://wicg.github.io/encrypted-media-encryption-scheme/
3347
+ * @see https://github.com/w3c/encrypted-media/pull/457
3348
+ * @see https://github.com/google/eme-encryption-scheme-polyfill
3349
+ */
3350
+ shaka.polyfill.EncryptionScheme = class {
3351
+ /**
3352
+ * Install the polyfill if needed.
3353
+ * @suppress {missingRequire}
3354
+ */
3355
+ static install() {}
3356
+ };
3357
+ /**
3358
+ * @summary A polyfill to unify fullscreen APIs across browsers.
3359
+ * Many browsers have prefixed fullscreen methods on Element and document.
3360
+ * See {@link https://mzl.la/2K0xcHo Using fullscreen mode} on MDN for more
3361
+ * information.
3362
+ */
3363
+ shaka.polyfill.Fullscreen = class {
3364
+ /**
3365
+ * Install the polyfill if needed.
3366
+ */
3367
+ static install() {}
3368
+ };
3369
+ /**
3370
+ * @summary A polyfill to patch math round bug on some browsers.
3371
+ * @see https://stackoverflow.com/q/12830742
3372
+ */
3373
+ shaka.polyfill.MathRound = class {
3374
+ /**
3375
+ * Install the polyfill if needed.
3376
+ */
3377
+ static install() {}
3378
+ };
3379
+ /**
3380
+ * @summary A polyfill to patch MSE bugs.
3381
+ */
3382
+ shaka.polyfill.MediaSource = class {
3383
+ /**
3384
+ * Install the polyfill if needed.
3385
+ */
3386
+ static install() {}
3387
+ };
3388
+ /**
3389
+ * @summary A polyfill to implement modern, standardized EME on top of Apple's
3390
+ * prefixed EME in Safari.
3391
+ */
3392
+ shaka.polyfill.PatchedMediaKeysApple = class {
3393
+ /**
3394
+ * Installs the polyfill if needed.
3395
+ */
3396
+ static install() {}
3397
+ };
3398
+ /**
3399
+ * @summary A polyfill to implement
3400
+ * {@link https://bit.ly/EmeMar15 EME draft 12 March 2015}
3401
+ * on top of ms-prefixed
3402
+ * {@link https://www.w3.org/TR/2014/WD-encrypted-media-20140218/ EME v20140218}
3403
+ */
3404
+ shaka.polyfill.PatchedMediaKeysMs = class {
3405
+ /**
3406
+ * Installs the polyfill if needed.
3407
+ */
3408
+ static install() {}
3409
+ };
3410
+ /**
3411
+ * @summary A polyfill to stub out
3412
+ * {@link https://bit.ly/EmeMar15 EME draft 12 March 2015} on browsers without
3413
+ * EME.
3414
+ * All methods will fail.
3415
+ */
3416
+ shaka.polyfill.PatchedMediaKeysNop = class {
3417
+ /**
3418
+ * Installs the polyfill if needed.
3419
+ */
3420
+ static install() {}
3421
+ };
3422
+ /**
3423
+ * @summary A polyfill to implement
3424
+ * {@link https://bit.ly/EmeMar15 EME draft 12 March 2015} on top of
3425
+ * webkit-prefixed {@link https://bit.ly/Eme01b EME v0.1b}.
3426
+ */
3427
+ shaka.polyfill.PatchedMediaKeysWebkit = class {
3428
+ /**
3429
+ * Installs the polyfill if needed.
3430
+ */
3431
+ static install() {}
3432
+ };
3433
+ /**
3434
+ * @summary A polyfill to provide PiP support in Safari.
3435
+ * Note that Safari only supports PiP on video elements, not audio.
3436
+ */
3437
+ shaka.polyfill.PiPWebkit = class {
3438
+ /**
3439
+ * Install the polyfill if needed.
3440
+ */
3441
+ static install() {}
3442
+ };
3443
+ /**
3444
+ * @summary A polyfill to silence the play() Promise in HTML5 video.
3445
+ */
3446
+ shaka.polyfill.VideoPlayPromise = class {
3447
+ /**
3448
+ * Install the polyfill if needed.
3449
+ */
3450
+ static install() {}
3451
+ };
3452
+ /**
3453
+ * @summary A polyfill to provide MSE VideoPlaybackQuality metrics.
3454
+ * Many browsers do not yet provide this API, and Chrome currently provides
3455
+ * similar data through individual prefixed attributes on HTMLVideoElement.
3456
+ */
3457
+ shaka.polyfill.VideoPlaybackQuality = class {
3458
+ /**
3459
+ * Install the polyfill if needed.
3460
+ */
3461
+ static install() {}
3462
+ };
3463
+ /**
3464
+ * @summary A polyfill to provide VTTCue.
3465
+ */
3466
+ shaka.polyfill.VTTCue = class {
3467
+ /**
3468
+ * Install the polyfill if needed.
3469
+ */
3470
+ static install() {}
3471
+ };
3338
3472
  /**
3339
3473
  * @implements {shaka.extern.TextParser}
3340
3474
  */