shaka-player 4.10.13 → 4.11.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.
Files changed (91) hide show
  1. package/README.md +5 -1
  2. package/dist/controls.css +3 -3
  3. package/dist/controls.css.map +1 -1
  4. package/dist/deps.js +11 -11
  5. package/dist/locales.js +38 -34
  6. package/dist/shaka-player.compiled.d.ts +68 -33
  7. package/dist/shaka-player.compiled.debug.d.ts +68 -33
  8. package/dist/shaka-player.compiled.debug.externs.js +584 -544
  9. package/dist/shaka-player.compiled.debug.js +715 -676
  10. package/dist/shaka-player.compiled.debug.map +4 -4
  11. package/dist/shaka-player.compiled.externs.js +584 -544
  12. package/dist/shaka-player.compiled.js +1394 -1371
  13. package/dist/shaka-player.compiled.map +4 -4
  14. package/dist/shaka-player.ui.d.ts +76 -34
  15. package/dist/shaka-player.ui.debug.d.ts +76 -34
  16. package/dist/shaka-player.ui.debug.externs.js +77 -26
  17. package/dist/shaka-player.ui.debug.js +774 -720
  18. package/dist/shaka-player.ui.debug.map +4 -4
  19. package/dist/shaka-player.ui.externs.js +77 -26
  20. package/dist/shaka-player.ui.js +1649 -1617
  21. package/dist/shaka-player.ui.map +4 -4
  22. package/externs/mediasession.js +10 -1
  23. package/externs/shaka/ads.js +79 -2
  24. package/externs/shaka/manifest.js +6 -1
  25. package/externs/shaka/manifest_parser.js +6 -2
  26. package/externs/shaka/net.js +23 -2
  27. package/externs/shaka/player.js +414 -103
  28. package/externs/shaka/text.js +2 -1
  29. package/lib/abr/simple_abr_manager.js +5 -0
  30. package/lib/ads/ad_manager.js +45 -1
  31. package/lib/ads/ad_utils.js +124 -1
  32. package/lib/ads/interstitial_ad.js +9 -2
  33. package/lib/ads/interstitial_ad_manager.js +216 -101
  34. package/lib/ads/media_tailor_ad.js +1 -39
  35. package/lib/ads/media_tailor_ad_manager.js +32 -16
  36. package/lib/cea/cea608_data_channel.js +40 -8
  37. package/lib/cea/cea608_memory.js +28 -0
  38. package/lib/dash/dash_parser.js +162 -25
  39. package/lib/dash/segment_base.js +3 -2
  40. package/lib/dash/segment_list.js +6 -3
  41. package/lib/dash/segment_template.js +104 -20
  42. package/lib/hls/hls_parser.js +319 -215
  43. package/lib/media/drm_engine.js +11 -3
  44. package/lib/media/media_source_engine.js +0 -8
  45. package/lib/media/preload_manager.js +16 -4
  46. package/lib/media/segment_reference.js +3 -0
  47. package/lib/media/segment_utils.js +8 -1
  48. package/lib/media/streaming_engine.js +10 -6
  49. package/lib/mss/mss_parser.js +14 -2
  50. package/lib/net/http_fetch_plugin.js +12 -5
  51. package/lib/net/http_xhr_plugin.js +7 -3
  52. package/lib/net/networking_engine.js +21 -1
  53. package/lib/offline/manifest_converter.js +1 -0
  54. package/lib/offline/storage.js +1 -0
  55. package/lib/player.js +336 -121
  56. package/lib/text/cue.js +373 -0
  57. package/lib/text/mp4_ttml_parser.js +51 -1
  58. package/lib/text/mp4_vtt_parser.js +2 -5
  59. package/lib/text/sbv_text_parser.js +2 -31
  60. package/lib/text/srt_text_parser.js +1 -1
  61. package/lib/text/text_engine.js +1 -1
  62. package/lib/text/text_utils.js +1 -0
  63. package/lib/text/ttml_text_parser.js +14 -4
  64. package/lib/text/ui_text_displayer.js +0 -4
  65. package/lib/text/vtt_text_parser.js +10 -415
  66. package/lib/util/abortable_operation.js +8 -0
  67. package/lib/util/cmcd_manager.js +38 -0
  68. package/lib/util/error.js +16 -0
  69. package/lib/util/fake_event.js +1 -0
  70. package/lib/util/manifest_parser_utils.js +12 -3
  71. package/lib/util/player_configuration.js +4 -2
  72. package/lib/util/stream_utils.js +57 -2
  73. package/lib/util/tXml.js +2 -1
  74. package/lib/util/text_parser.js +46 -0
  75. package/lib/util/ts_parser.js +32 -3
  76. package/package.json +1 -1
  77. package/shaka-player.uncompiled.js +1 -1
  78. package/ui/chapter_selection.js +179 -0
  79. package/ui/controls.js +151 -0
  80. package/ui/enums.js +1 -0
  81. package/ui/externs/ui.js +7 -1
  82. package/ui/less/containers.less +3 -4
  83. package/ui/less/overflow_menu.less +5 -0
  84. package/ui/less/tooltip.less +1 -1
  85. package/ui/locales/en.json +1 -0
  86. package/ui/locales/es.json +1 -0
  87. package/ui/locales/fr.json +1 -0
  88. package/ui/locales/source.json +4 -0
  89. package/ui/seek_bar.js +3 -2
  90. package/ui/ui.js +2 -0
  91. package/lib/polyfill/abort_controller.js +0 -158
@@ -344,6 +344,7 @@ shaka.util.Error.Code = {
344
344
  'DASH_CONFLICTING_AES_128': 4050,
345
345
  'DASH_UNSUPPORTED_AES_128': 4051,
346
346
  'DASH_INVALID_PATCH': 4052,
347
+ 'HLS_EMPTY_MEDIA_PLAYLIST': 4053,
347
348
  'STREAMING_ENGINE_STARTUP_INVALID_STATE': 5006,
348
349
  'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
349
350
  'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
@@ -396,7 +397,9 @@ shaka.util.Error.Code = {
396
397
  'SS_IMA_SDK_MISSING': 10002,
397
398
  'SS_AD_MANAGER_NOT_INITIALIZED': 10003,
398
399
  'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004,
399
- 'MT_AD_MANAGER_NOT_INITIALIZED': 10005
400
+ 'MT_AD_MANAGER_NOT_INITIALIZED': 10005,
401
+ 'INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED': 10006,
402
+ 'VAST_INVALID_XML': 4001
400
403
  };
401
404
  /**
402
405
  * A timer allows a single function to be executed at a later time or at
@@ -987,6 +990,14 @@ shaka.text.Cue = class {
987
990
  * @suppress {checkTypes} since we must use [] and "in" with a struct type.
988
991
  */
989
992
  static equal(cue1, cue2) {}
993
+ /**
994
+ * Parses cue payload, searches for styling entities and, if needed,
995
+ * modifies original payload and creates nested cues to better represent
996
+ * styling found in payload. All changes are done in-place.
997
+ * @param {!shaka.text.Cue} cue
998
+ * @param {!Map<string, !shaka.text.Cue>=} styles
999
+ */
1000
+ static parseCuePayload(cue, styles) {}
990
1001
  };
991
1002
  /**
992
1003
  * The start time of the cue in seconds, relative to the start of the
@@ -1560,6 +1571,10 @@ shaka.util.AbortableOperation = class {
1560
1571
  * be rejected.
1561
1572
  */
1562
1573
  constructor(promise, onAbort) {}
1574
+ /**
1575
+ * @return {boolean} True if the operation has been aborted.
1576
+ */
1577
+ aborted() {}
1563
1578
  /**
1564
1579
  * @param {!shaka.util.Error} error
1565
1580
  * @return {!shaka.util.AbortableOperation} An operation which has already
@@ -1799,7 +1814,13 @@ shaka.net.NetworkingEngine.AdvancedRequestType = {
1799
1814
  'MASTER_PLAYLIST': 3,
1800
1815
  'MPD': 4,
1801
1816
  'MSS': 5,
1802
- 'MPD_PATCH': 6
1817
+ 'MPD_PATCH': 6,
1818
+ 'MEDIATAILOR_SESSION_INFO': 7,
1819
+ 'MEDIATAILOR_TRACKING_INFO': 8,
1820
+ 'MEDIATAILOR_STATIC_RESOURCE': 9,
1821
+ 'MEDIATAILOR_TRACKING_EVENT': 10,
1822
+ 'INTERSTITIAL_ASSET_LIST': 11,
1823
+ 'INTERSTITIAL_AD_URL': 12
1803
1824
  };
1804
1825
  /**
1805
1826
  * Priority level for network scheme plugins.
@@ -2452,7 +2473,8 @@ shaka.util.TsParser = class {
2452
2473
  getVideoResolution() {}
2453
2474
  /**
2454
2475
  * Return the video information
2455
- * @return {{height: ?string, width: ?string, codec: ?string}}
2476
+ * @return {{height: ?string, width: ?string, codec: ?string,
2477
+ * frameRate: ?string}}
2456
2478
  */
2457
2479
  getVideoInfo() {}
2458
2480
  /**
@@ -3223,7 +3245,9 @@ shaka.text.WebVttGenerator = class {
3223
3245
  */
3224
3246
  shaka.util.CmcdManager.StreamingFormat = {
3225
3247
  DASH: 'd',
3248
+ LOW_LATENCY_DASH: 'ld',
3226
3249
  HLS: 'h',
3250
+ LOW_LATENCY_HLS: 'lh',
3227
3251
  SMOOTH: 's',
3228
3252
  OTHER: 'o'
3229
3253
  };
@@ -3278,10 +3302,12 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3278
3302
  * When provided, the player will attach to <code>mediaElement</code>,
3279
3303
  * similar to calling <code>attach</code>. When not provided, the player
3280
3304
  * will remain detached.
3305
+ * @param {HTMLElement=} videoContainer
3306
+ * The videoContainer to construct UITextDisplayer
3281
3307
  * @param {function(shaka.Player)=} dependencyInjector Optional callback
3282
3308
  * which is called to inject mocks into the Player. Used for testing.
3283
3309
  */
3284
- constructor(mediaElement, dependencyInjector) {}
3310
+ constructor(mediaElement, videoContainer, dependencyInjector) {}
3285
3311
  /**
3286
3312
  * After destruction, a Player object cannot be used again.
3287
3313
  * @override
@@ -3868,6 +3894,13 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3868
3894
  * @param {HTMLElement} videoContainer
3869
3895
  */
3870
3896
  setVideoContainer(videoContainer) {}
3897
+ /**
3898
+ * Load a new font on the page. If the font was already loaded, it does
3899
+ * nothing.
3900
+ * @param {string} name
3901
+ * @param {string} url
3902
+ */
3903
+ addFont(name, url) {}
3871
3904
  };
3872
3905
  /**
3873
3906
  * In order to know what method of loading the player used for some content, we
@@ -4214,11 +4247,12 @@ shaka.ads.InterstitialAd = class {
4214
4247
  /**
4215
4248
  * @param {HTMLMediaElement} video
4216
4249
  * @param {boolean} isSkippable
4250
+ * @param {?number} skipOffset
4217
4251
  * @param {function()} onSkip
4218
4252
  * @param {number} sequenceLength
4219
4253
  * @param {number} adPosition
4220
4254
  */
4221
- constructor(video, isSkippable, onSkip, sequenceLength, adPosition) {}
4255
+ constructor(video, isSkippable, skipOffset, onSkip, sequenceLength, adPosition) {}
4222
4256
  /**
4223
4257
  * @override
4224
4258
  */
@@ -4720,7 +4754,19 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
4720
4754
  /**
4721
4755
  * @override
4722
4756
  */
4723
- onInterstitialMetadata(basePlayer, baseVideo, interstitial) {}
4757
+ onHLSInterstitialMetadata(basePlayer, baseVideo, interstitial) {}
4758
+ /**
4759
+ * @override
4760
+ */
4761
+ onDASHInterstitialMetadata(basePlayer, baseVideo, region) {}
4762
+ /**
4763
+ * @override
4764
+ */
4765
+ addCustomInterstitial(interstitial) {}
4766
+ /**
4767
+ * @override
4768
+ */
4769
+ addAdUrlInterstitial(url) {}
4724
4770
  };
4725
4771
  /**
4726
4772
  * The event name for when a sequence of ads has been loaded.
@@ -5184,9 +5230,11 @@ shaka.dash.DashParser = class {
5184
5230
  /** Creates a new DASH parser. */
5185
5231
  constructor() {}
5186
5232
  /**
5233
+ * @param {shaka.extern.ManifestConfiguration} config
5234
+ * @param {(function():boolean)=} isPreloadFn
5187
5235
  * @override
5188
5236
  */
5189
- configure(config) {}
5237
+ configure(config, isPreloadFn) {}
5190
5238
  /**
5191
5239
  * @override
5192
5240
  */
@@ -5265,9 +5313,11 @@ shaka.hls.HlsParser = class {
5265
5313
  */
5266
5314
  constructor() {}
5267
5315
  /**
5316
+ * @param {shaka.extern.ManifestConfiguration} config
5317
+ * @param {(function():boolean)=} isPreloadFn
5268
5318
  * @override
5269
5319
  */
5270
- configure(config) {}
5320
+ configure(config, isPreloadFn) {}
5271
5321
  /**
5272
5322
  * @override
5273
5323
  */
@@ -5305,9 +5355,11 @@ shaka.mss.MssParser = class {
5305
5355
  /** Creates a new MSS parser. */
5306
5356
  constructor() {}
5307
5357
  /**
5358
+ * @param {shaka.extern.ManifestConfiguration} config
5359
+ * @param {(function():boolean)=} isPreloadFn
5308
5360
  * @override
5309
5361
  */
5310
- configure(config) {}
5362
+ configure(config, isPreloadFn) {}
5311
5363
  /**
5312
5364
  * @override
5313
5365
  */
@@ -5345,9 +5397,10 @@ shaka.net.HttpFetchPlugin = class {
5345
5397
  * progress event happened.
5346
5398
  * @param {shaka.extern.HeadersReceived} headersReceived Called when the
5347
5399
  * headers for the download are received, but before the body is.
5400
+ * @param {shaka.extern.SchemePluginConfig} config
5348
5401
  * @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
5349
5402
  */
5350
- static parse(uri, request, requestType, progressUpdated, headersReceived) {}
5403
+ static parse(uri, request, requestType, progressUpdated, headersReceived, config) {}
5351
5404
  /**
5352
5405
  * Determine if the Fetch API is supported in the browser. Note: this is
5353
5406
  * deliberately exposed as a method to allow the client app to use the same
@@ -5368,9 +5421,10 @@ shaka.net.HttpXHRPlugin = class {
5368
5421
  * progress event happened.
5369
5422
  * @param {shaka.extern.HeadersReceived} headersReceived Called when the
5370
5423
  * headers for the download are received, but before the body is.
5424
+ * @param {shaka.extern.SchemePluginConfig} config
5371
5425
  * @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
5372
5426
  */
5373
- static parse(uri, request, requestType, progressUpdated, headersReceived) {}
5427
+ static parse(uri, request, requestType, progressUpdated, headersReceived, config) {}
5374
5428
  };
5375
5429
  /**
5376
5430
  * StorageMuxer is responsible for managing StorageMechanisms and addressing
@@ -5555,20 +5609,6 @@ shaka.polyfill = class {
5555
5609
  */
5556
5610
  static register(polyfill, priority) {}
5557
5611
  };
5558
- /**
5559
- * @summary A polyfill for systems that do not implement AbortController.
5560
- * This is used both with the fetch API for HTTP requests and inside the HLS
5561
- * parser.
5562
- * @extends AbortController
5563
- */
5564
- shaka.polyfill.AbortController = class {
5565
- /**
5566
- * Install the polyfill if needed.
5567
- */
5568
- static install() {}
5569
- /** */
5570
- constructor() {}
5571
- };
5572
5612
  /**
5573
5613
  * @summary A polyfill to add support for the ARIAMixin interface mixin, for
5574
5614
  * browsers that do not implement it (e.g. Firefox).
@@ -5802,7 +5842,7 @@ shaka.text.TtmlTextParser = class {
5802
5842
  /**
5803
5843
  * @override
5804
5844
  */
5805
- parseMedia(data, time, uri) {}
5845
+ parseMedia(data, time, uri, images) {}
5806
5846
  };
5807
5847
  /**
5808
5848
  * @implements {shaka.extern.TextParser}
@@ -6743,6 +6783,17 @@ shaka.ui.CastButton = class extends shaka.ui.Element {
6743
6783
  */
6744
6784
  constructor(parent, controls) {}
6745
6785
  };
6786
+ /**
6787
+ * @extends {shaka.ui.SettingsMenu}
6788
+ * @final
6789
+ */
6790
+ shaka.ui.ChapterSelection = class extends shaka.ui.SettingsMenu {
6791
+ /**
6792
+ * @param {!HTMLElement} parent
6793
+ * @param {!shaka.ui.Controls} controls
6794
+ */
6795
+ constructor(parent, controls) {}
6796
+ };
6746
6797
  /**
6747
6798
  * @extends {shaka.ui.Element}
6748
6799
  * @final