shaka-player 4.7.13 → 4.8.1

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 (114) hide show
  1. package/AUTHORS +2 -0
  2. package/CONTRIBUTORS +2 -0
  3. package/LICENSE +54 -0
  4. package/README.md +22 -1
  5. package/dist/controls.css +1 -1
  6. package/dist/controls.css.map +1 -1
  7. package/dist/deps.js +34 -23
  8. package/dist/locales.js +41 -31
  9. package/dist/shaka-player.compiled.d.ts +196 -45
  10. package/dist/shaka-player.compiled.debug.d.ts +196 -45
  11. package/dist/shaka-player.compiled.debug.externs.js +491 -348
  12. package/dist/shaka-player.compiled.debug.js +969 -847
  13. package/dist/shaka-player.compiled.debug.map +4 -4
  14. package/dist/shaka-player.compiled.externs.js +491 -348
  15. package/dist/shaka-player.compiled.js +1238 -1171
  16. package/dist/shaka-player.compiled.map +4 -4
  17. package/dist/shaka-player.ui.d.ts +259 -48
  18. package/dist/shaka-player.ui.debug.d.ts +259 -48
  19. package/dist/shaka-player.ui.debug.externs.js +598 -377
  20. package/dist/shaka-player.ui.debug.js +1185 -980
  21. package/dist/shaka-player.ui.debug.map +4 -4
  22. package/dist/shaka-player.ui.externs.js +598 -377
  23. package/dist/shaka-player.ui.js +1526 -1408
  24. package/dist/shaka-player.ui.map +4 -4
  25. package/externs/device_sensor_event.js +18 -0
  26. package/externs/hisense.js +16 -0
  27. package/externs/playstation.js +31 -0
  28. package/externs/shaka/abr_manager.js +3 -1
  29. package/externs/shaka/ads.js +5 -0
  30. package/externs/shaka/codecs.js +13 -0
  31. package/externs/shaka/manifest.js +58 -6
  32. package/externs/shaka/net.js +13 -1
  33. package/externs/shaka/player.js +184 -13
  34. package/externs/shaka/text.js +19 -0
  35. package/externs/tizen.js +41 -0
  36. package/externs/webos.js +19 -0
  37. package/externs/xbox.js +43 -0
  38. package/lib/abr/simple_abr_manager.js +9 -1
  39. package/lib/ads/ad_manager.js +19 -2
  40. package/lib/ads/client_side_ad_manager.js +5 -3
  41. package/lib/ads/media_tailor_ad_manager.js +9 -0
  42. package/lib/cast/cast_receiver.js +0 -14
  43. package/lib/cast/cast_utils.js +1 -0
  44. package/lib/cea/mp4_cea_parser.js +6 -1
  45. package/lib/dash/content_protection.js +97 -53
  46. package/lib/dash/dash_parser.js +237 -177
  47. package/lib/dash/mpd_utils.js +72 -65
  48. package/lib/dash/segment_base.js +27 -21
  49. package/lib/dash/segment_list.js +18 -16
  50. package/lib/dash/segment_template.js +45 -22
  51. package/lib/hls/hls_parser.js +358 -164
  52. package/lib/media/buffering_observer.js +25 -1
  53. package/lib/media/drm_engine.js +91 -71
  54. package/lib/media/manifest_filterer.js +220 -0
  55. package/lib/media/media_source_engine.js +34 -5
  56. package/lib/media/preload_manager.js +827 -0
  57. package/lib/media/presentation_timeline.js +11 -0
  58. package/lib/media/segment_index.js +93 -47
  59. package/lib/media/segment_prefetch.js +140 -43
  60. package/lib/media/segment_reference.js +43 -8
  61. package/lib/media/segment_utils.js +208 -25
  62. package/lib/media/streaming_engine.js +355 -66
  63. package/lib/mss/content_protection.js +31 -25
  64. package/lib/mss/mss_parser.js +79 -55
  65. package/lib/net/networking_engine.js +49 -4
  66. package/lib/offline/storage.js +3 -3
  67. package/lib/player.js +882 -672
  68. package/lib/polyfill/media_capabilities.js +16 -1
  69. package/lib/text/simple_text_displayer.js +9 -0
  70. package/lib/text/stub_text_displayer.js +7 -0
  71. package/lib/text/text_engine.js +16 -3
  72. package/lib/text/ttml_text_parser.js +116 -114
  73. package/lib/text/ui_text_displayer.js +28 -11
  74. package/lib/text/vtt_text_parser.js +54 -115
  75. package/lib/transmuxer/opus.js +91 -0
  76. package/lib/transmuxer/ts_transmuxer.js +115 -0
  77. package/lib/util/cmcd_manager.js +153 -3
  78. package/lib/util/dom_utils.js +11 -0
  79. package/lib/util/error.js +5 -0
  80. package/lib/util/fake_event.js +2 -0
  81. package/lib/util/manifest_parser_utils.js +97 -3
  82. package/lib/util/mp4_box_parsers.js +346 -17
  83. package/lib/util/mp4_generator.js +23 -0
  84. package/lib/util/periods.js +19 -0
  85. package/lib/util/platform.js +161 -9
  86. package/lib/util/player_configuration.js +79 -13
  87. package/lib/util/stats.js +16 -0
  88. package/lib/util/stream_utils.js +22 -8
  89. package/lib/util/string_utils.js +36 -0
  90. package/lib/util/tXml.js +814 -0
  91. package/lib/util/ts_parser.js +50 -0
  92. package/lib/util/xml_utils.js +10 -338
  93. package/package.json +2 -2
  94. package/shaka-player.uncompiled.js +8 -0
  95. package/ui/controls.js +187 -5
  96. package/ui/enums.js +2 -0
  97. package/ui/externs/ui.js +30 -3
  98. package/ui/gl_matrix/matrix_4x4.js +568 -0
  99. package/ui/gl_matrix/matrix_quaternion.js +45 -0
  100. package/ui/less/containers.less +11 -0
  101. package/ui/locales/en-GB.json +2 -0
  102. package/ui/locales/en.json +2 -0
  103. package/ui/locales/es-419.json +2 -0
  104. package/ui/locales/es.json +2 -0
  105. package/ui/locales/source.json +8 -0
  106. package/ui/recenter_vr.js +126 -0
  107. package/ui/resolution_selection.js +25 -5
  108. package/ui/statistics_button.js +12 -0
  109. package/ui/text_selection.js +1 -1
  110. package/ui/toggle_stereoscopic.js +127 -0
  111. package/ui/ui.js +74 -38
  112. package/ui/vr_manager.js +557 -0
  113. package/ui/vr_utils.js +232 -0
  114. package/ui/vr_webgl.js +697 -0
@@ -127,6 +127,61 @@ shaka.util.FakeEventTarget = class {
127
127
  * @typedef {EventListener|function(!Event):*}
128
128
  */
129
129
  shaka.util.FakeEventTarget.ListenerType;
130
+ /**
131
+ * @summary A set of BufferSource utility functions.
132
+ */
133
+ shaka.util.BufferUtils = class {
134
+ /**
135
+ * Compare two buffers for equality. For buffers of different types, this
136
+ * compares the underlying buffers as binary data.
137
+ * @param {?BufferSource} arr1
138
+ * @param {?BufferSource} arr2
139
+ * @return {boolean}
140
+ * @suppress {strictMissingProperties}
141
+ */
142
+ static equal(arr1, arr2) {}
143
+ /**
144
+ * Gets an ArrayBuffer that contains the data from the given TypedArray. Note
145
+ * this will allocate a new ArrayBuffer if the object is a partial view of
146
+ * the data.
147
+ * @param {!BufferSource} view
148
+ * @return {!ArrayBuffer}
149
+ */
150
+ static toArrayBuffer(view) {}
151
+ /**
152
+ * Creates a new Uint8Array view on the same buffer. This clamps the values
153
+ * to be within the same view (i.e. you can't use this to move past the end
154
+ * of the view, even if the underlying buffer is larger). However, you can
155
+ * pass a negative offset to access the data before the view.
156
+ * @param {BufferSource} data
157
+ * @param {number=} offset The offset from the beginning of this data's view
158
+ * to start the new view at.
159
+ * @param {number=} length The byte length of the new view.
160
+ * @return {!Uint8Array}
161
+ */
162
+ static toUint8(data, offset, length) {}
163
+ /**
164
+ * Creates a new Uint16Array view on the same buffer. This clamps the values
165
+ * to be within the same view (i.e. you can't use this to move past the end
166
+ * of the view, even if the underlying buffer is larger). However, you can
167
+ * pass a negative offset to access the data before the view.
168
+ * @param {BufferSource} data
169
+ * @param {number=} offset The offset from the beginning of this data's view
170
+ * to start the new view at.
171
+ * @param {number=} length The byte length of the new view.
172
+ * @return {!Uint16Array}
173
+ */
174
+ static toUint16(data, offset, length) {}
175
+ /**
176
+ * Creates a DataView over the given buffer.
177
+ * @see toUint8
178
+ * @param {BufferSource} buffer
179
+ * @param {number=} offset
180
+ * @param {number=} length
181
+ * @return {!DataView}
182
+ */
183
+ static toDataView(buffer, offset, length) {}
184
+ };
130
185
  /**
131
186
  * @summary
132
187
  * Describes an error that happened.
@@ -313,6 +368,7 @@ shaka.util.Error.Code = {
313
368
  'NO_VIDEO_ELEMENT': 7002,
314
369
  'OBJECT_DESTROYED': 7003,
315
370
  'CONTENT_NOT_LOADED': 7004,
371
+ 'SRC_EQUALS_PRELOAD_NOT_SUPPORTED': 7005,
316
372
  'CAST_API_UNAVAILABLE': 8000,
317
373
  'NO_CAST_RECEIVERS': 8001,
318
374
  'ALREADY_CASTING': 8002,
@@ -342,6 +398,137 @@ shaka.util.Error.Code = {
342
398
  'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004,
343
399
  'MT_AD_MANAGER_NOT_INITIALIZED': 10005
344
400
  };
401
+ /**
402
+ * A timer allows a single function to be executed at a later time or at
403
+ * regular intervals.
404
+ * @final
405
+ */
406
+ shaka.util.Timer = class {
407
+ /**
408
+ * Create a new timer. A timer is committed to a single callback function.
409
+ * While there is no technical reason to do this, it is far easier to
410
+ * understand and use timers when they are connected to one functional idea.
411
+ * @param {function()} onTick
412
+ */
413
+ constructor(onTick) {}
414
+ /**
415
+ * Have the timer call |onTick| now.
416
+ * @return {!shaka.util.Timer}
417
+ */
418
+ tickNow() {}
419
+ /**
420
+ * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
421
+ * called first.
422
+ * @param {number} seconds
423
+ * @return {!shaka.util.Timer}
424
+ */
425
+ tickAfter(seconds) {}
426
+ /**
427
+ * Have the timer call |onTick| every |seconds| until |stop| is called.
428
+ * @param {number} seconds
429
+ * @return {!shaka.util.Timer}
430
+ */
431
+ tickEvery(seconds) {}
432
+ /**
433
+ * Stop the timer and clear the previous behaviour. The timer is still usable
434
+ * after calling |stop|.
435
+ */
436
+ stop() {}
437
+ };
438
+ /**
439
+ * @namespace shaka.util.StringUtils
440
+ * @summary A set of string utility functions.
441
+ */
442
+ shaka.util.StringUtils = class {
443
+ /**
444
+ * Creates a string from the given buffer as UTF-8 encoding.
445
+ * @param {?BufferSource} data
446
+ * @return {string}
447
+ */
448
+ static fromUTF8(data) {}
449
+ /**
450
+ * Creates a string from the given buffer as UTF-16 encoding.
451
+ * @param {?BufferSource} data
452
+ * @param {boolean} littleEndian
453
+ true to read little endian, false to read big.
454
+ * @param {boolean=} noThrow true to avoid throwing in cases where we may
455
+ * expect invalid input. If noThrow is true and the data has an odd
456
+ * length,it will be truncated.
457
+ * @return {string}
458
+ */
459
+ static fromUTF16(data, littleEndian, noThrow) {}
460
+ /**
461
+ * Creates a string from the given buffer, auto-detecting the encoding that is
462
+ * being used. If it cannot detect the encoding, it will throw an exception.
463
+ * @param {?BufferSource} data
464
+ * @return {string}
465
+ */
466
+ static fromBytesAutoDetect(data) {}
467
+ /**
468
+ * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
469
+ * @param {string} str
470
+ * @return {!ArrayBuffer}
471
+ */
472
+ static toUTF8(str) {}
473
+ /**
474
+ * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
475
+ * @param {string} str
476
+ * @param {boolean} littleEndian
477
+ * @return {!ArrayBuffer}
478
+ */
479
+ static toUTF16(str, littleEndian) {}
480
+ /**
481
+ * Resets the fromCharCode method's implementation.
482
+ * For debug use.
483
+ */
484
+ static resetFromCharCode() {}
485
+ };
486
+ /**
487
+ * @summary A set of Uint8Array utility functions.
488
+ */
489
+ shaka.util.Uint8ArrayUtils = class {
490
+ /**
491
+ * Convert a buffer to a base64 string. The output will be standard
492
+ * alphabet as opposed to base64url safe alphabet.
493
+ * @param {BufferSource} data
494
+ * @return {string}
495
+ */
496
+ static toStandardBase64(data) {}
497
+ /**
498
+ * Convert a buffer to a base64 string. The output will always use the
499
+ * alternate encoding/alphabet also known as "base64url".
500
+ * @param {BufferSource} data
501
+ * @param {boolean=} padding If true, pad the output with equals signs.
502
+ * Defaults to true.
503
+ * @return {string}
504
+ */
505
+ static toBase64(data, padding) {}
506
+ /**
507
+ * Convert a base64 string to a Uint8Array. Accepts either the standard
508
+ * alphabet or the alternate "base64url" alphabet.
509
+ * @param {string} str
510
+ * @return {!Uint8Array}
511
+ */
512
+ static fromBase64(str) {}
513
+ /**
514
+ * Convert a hex string to a Uint8Array.
515
+ * @param {string} str
516
+ * @return {!Uint8Array}
517
+ */
518
+ static fromHex(str) {}
519
+ /**
520
+ * Convert a buffer to a hex string.
521
+ * @param {BufferSource} data
522
+ * @return {string}
523
+ */
524
+ static toHex(data) {}
525
+ /**
526
+ * Concatenate buffers.
527
+ * @param {...BufferSource} varArgs
528
+ * @return {!Uint8Array}
529
+ */
530
+ static concat(...varArgs) {}
531
+ };
345
532
  /**
346
533
  * @summary A set of language utility functions.
347
534
  * @final
@@ -648,61 +835,6 @@ shaka.util.EventManager = class {
648
835
  * @typedef {function(!Event)}
649
836
  */
650
837
  shaka.util.EventManager.ListenerType;
651
- /**
652
- * @summary A set of BufferSource utility functions.
653
- */
654
- shaka.util.BufferUtils = class {
655
- /**
656
- * Compare two buffers for equality. For buffers of different types, this
657
- * compares the underlying buffers as binary data.
658
- * @param {?BufferSource} arr1
659
- * @param {?BufferSource} arr2
660
- * @return {boolean}
661
- * @suppress {strictMissingProperties}
662
- */
663
- static equal(arr1, arr2) {}
664
- /**
665
- * Gets an ArrayBuffer that contains the data from the given TypedArray. Note
666
- * this will allocate a new ArrayBuffer if the object is a partial view of
667
- * the data.
668
- * @param {!BufferSource} view
669
- * @return {!ArrayBuffer}
670
- */
671
- static toArrayBuffer(view) {}
672
- /**
673
- * Creates a new Uint8Array view on the same buffer. This clamps the values
674
- * to be within the same view (i.e. you can't use this to move past the end
675
- * of the view, even if the underlying buffer is larger). However, you can
676
- * pass a negative offset to access the data before the view.
677
- * @param {BufferSource} data
678
- * @param {number=} offset The offset from the beginning of this data's view
679
- * to start the new view at.
680
- * @param {number=} length The byte length of the new view.
681
- * @return {!Uint8Array}
682
- */
683
- static toUint8(data, offset, length) {}
684
- /**
685
- * Creates a new Uint16Array view on the same buffer. This clamps the values
686
- * to be within the same view (i.e. you can't use this to move past the end
687
- * of the view, even if the underlying buffer is larger). However, you can
688
- * pass a negative offset to access the data before the view.
689
- * @param {BufferSource} data
690
- * @param {number=} offset The offset from the beginning of this data's view
691
- * to start the new view at.
692
- * @param {number=} length The byte length of the new view.
693
- * @return {!Uint16Array}
694
- */
695
- static toUint16(data, offset, length) {}
696
- /**
697
- * Creates a DataView over the given buffer.
698
- * @see toUint8
699
- * @param {BufferSource} buffer
700
- * @param {number=} offset
701
- * @param {number=} length
702
- * @return {!DataView}
703
- */
704
- static toDataView(buffer, offset, length) {}
705
- };
706
838
  /**
707
839
  * The IClosedCaptionParser defines the interface to provide all operations for
708
840
  * parsing the closed captions embedded in Dash videos streams.
@@ -1287,46 +1419,9 @@ shaka.text.TextEngine = class {
1287
1419
  destroy() {}
1288
1420
  };
1289
1421
  /**
1290
- * A timer allows a single function to be executed at a later time or at
1291
- * regular intervals.
1292
- * @final
1422
+ * @summary A set of utility functions for dealing with Streams and Manifests.
1293
1423
  */
1294
- shaka.util.Timer = class {
1295
- /**
1296
- * Create a new timer. A timer is committed to a single callback function.
1297
- * While there is no technical reason to do this, it is far easier to
1298
- * understand and use timers when they are connected to one functional idea.
1299
- * @param {function()} onTick
1300
- */
1301
- constructor(onTick) {}
1302
- /**
1303
- * Have the timer call |onTick| now.
1304
- * @return {!shaka.util.Timer}
1305
- */
1306
- tickNow() {}
1307
- /**
1308
- * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
1309
- * called first.
1310
- * @param {number} seconds
1311
- * @return {!shaka.util.Timer}
1312
- */
1313
- tickAfter(seconds) {}
1314
- /**
1315
- * Have the timer call |onTick| every |seconds| until |stop| is called.
1316
- * @param {number} seconds
1317
- * @return {!shaka.util.Timer}
1318
- */
1319
- tickEvery(seconds) {}
1320
- /**
1321
- * Stop the timer and clear the previous behaviour. The timer is still usable
1322
- * after calling |stop|.
1323
- */
1324
- stop() {}
1325
- };
1326
- /**
1327
- * @summary A set of utility functions for dealing with Streams and Manifests.
1328
- */
1329
- shaka.util.StreamUtils = class {
1424
+ shaka.util.StreamUtils = class {
1330
1425
  /**
1331
1426
  * @param {shaka.extern.Variant} variant
1332
1427
  * @param {shaka.extern.Restrictions} restrictions
@@ -1389,9 +1484,16 @@ shaka.abr.SimpleAbrManager = class {
1389
1484
  */
1390
1485
  disable() {}
1391
1486
  /**
1487
+ * @param {number} deltaTimeMs The duration, in milliseconds, that the request
1488
+ * took to complete.
1489
+ * @param {number} numBytes The total number of bytes transferred.
1490
+ * @param {boolean} allowSwitch Indicate if the segment is allowed to switch
1491
+ * to another stream.
1492
+ * @param {shaka.extern.Request=} request
1493
+ * A reference to the request
1392
1494
  * @override
1393
1495
  */
1394
- segmentDownloaded(deltaTimeMs, numBytes, allowSwitch) {}
1496
+ segmentDownloaded(deltaTimeMs, numBytes, allowSwitch, request) {}
1395
1497
  /**
1396
1498
  * @override
1397
1499
  */
@@ -1531,7 +1633,8 @@ shaka.util.AbortableOperation.prototype.promise;
1531
1633
  */
1532
1634
  shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1533
1635
  /**
1534
- * @param {function(number, number, boolean)=} onProgressUpdated Called when
1636
+ * @param {shaka.net.NetworkingEngine.onProgressUpdated=} onProgressUpdated
1637
+ * Called when
1535
1638
  * a progress event is triggered. Passed the duration, in milliseconds,
1536
1639
  * that the request took, the number of bytes transferred, and the boolean
1537
1640
  * of whether the switching is allowed.
@@ -1543,8 +1646,10 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1543
1646
  * Called when a request is made
1544
1647
  * @param {shaka.net.NetworkingEngine.OnRetry=} onRetry
1545
1648
  * Called when a request retry is made
1649
+ * @param {shaka.net.NetworkingEngine.OnResponse=} onResponse
1650
+ * Called when receive the response
1546
1651
  */
1547
- constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest, onRetry) {}
1652
+ constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest, onRetry, onResponse) {}
1548
1653
  /**
1549
1654
  * @param {boolean} forceHTTPS
1550
1655
  */
@@ -1713,6 +1818,19 @@ shaka.net.NetworkingEngine.PluginPriority = {
1713
1818
  * the player, plus some extra data.
1714
1819
  */
1715
1820
  shaka.net.NetworkingEngine.OnHeadersReceived;
1821
+ /**
1822
+ * @typedef {function(
1823
+ * number,
1824
+ * number,
1825
+ * boolean,
1826
+ * shaka.extern.Request=)}
1827
+ * @description
1828
+ * A callback that is passed the duration, in milliseconds,
1829
+ * that the request took, the number of bytes transferred, a boolean
1830
+ * representing whether the switching is allowed and a ref to the
1831
+ * original request.
1832
+ */
1833
+ shaka.net.NetworkingEngine.onProgressUpdated;
1716
1834
  /**
1717
1835
  * @typedef {function(
1718
1836
  * !shaka.extern.Request,
@@ -1745,53 +1863,14 @@ shaka.net.NetworkingEngine.OnRequest;
1745
1863
  */
1746
1864
  shaka.net.NetworkingEngine.OnRetry;
1747
1865
  /**
1748
- * @namespace shaka.util.StringUtils
1749
- * @summary A set of string utility functions.
1866
+ * @typedef {function(
1867
+ * !shaka.net.NetworkingEngine.RequestType,
1868
+ * !shaka.extern.Response,
1869
+ * (shaka.extern.RequestContext|undefined))}
1870
+ * @description
1871
+ * A callback function called on every request
1750
1872
  */
1751
- shaka.util.StringUtils = class {
1752
- /**
1753
- * Creates a string from the given buffer as UTF-8 encoding.
1754
- * @param {?BufferSource} data
1755
- * @return {string}
1756
- */
1757
- static fromUTF8(data) {}
1758
- /**
1759
- * Creates a string from the given buffer as UTF-16 encoding.
1760
- * @param {?BufferSource} data
1761
- * @param {boolean} littleEndian
1762
- true to read little endian, false to read big.
1763
- * @param {boolean=} noThrow true to avoid throwing in cases where we may
1764
- * expect invalid input. If noThrow is true and the data has an odd
1765
- * length,it will be truncated.
1766
- * @return {string}
1767
- */
1768
- static fromUTF16(data, littleEndian, noThrow) {}
1769
- /**
1770
- * Creates a string from the given buffer, auto-detecting the encoding that is
1771
- * being used. If it cannot detect the encoding, it will throw an exception.
1772
- * @param {?BufferSource} data
1773
- * @return {string}
1774
- */
1775
- static fromBytesAutoDetect(data) {}
1776
- /**
1777
- * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
1778
- * @param {string} str
1779
- * @return {!ArrayBuffer}
1780
- */
1781
- static toUTF8(str) {}
1782
- /**
1783
- * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
1784
- * @param {string} str
1785
- * @param {boolean} littleEndian
1786
- * @return {!ArrayBuffer}
1787
- */
1788
- static toUTF16(str, littleEndian) {}
1789
- /**
1790
- * Resets the fromCharCode method's implementation.
1791
- * For debug use.
1792
- */
1793
- static resetFromCharCode() {}
1794
- };
1873
+ shaka.net.NetworkingEngine.OnResponse;
1795
1874
  /**
1796
1875
  * @summary DataViewReader abstracts a DataView object.
1797
1876
  */
@@ -1978,52 +2057,6 @@ shaka.util.Mp4Parser = class {
1978
2057
  * @typedef {function(!shaka.extern.ParsedBox)}
1979
2058
  */
1980
2059
  shaka.util.Mp4Parser.CallbackType;
1981
- /**
1982
- * @summary A set of Uint8Array utility functions.
1983
- */
1984
- shaka.util.Uint8ArrayUtils = class {
1985
- /**
1986
- * Convert a buffer to a base64 string. The output will be standard
1987
- * alphabet as opposed to base64url safe alphabet.
1988
- * @param {BufferSource} data
1989
- * @return {string}
1990
- */
1991
- static toStandardBase64(data) {}
1992
- /**
1993
- * Convert a buffer to a base64 string. The output will always use the
1994
- * alternate encoding/alphabet also known as "base64url".
1995
- * @param {BufferSource} data
1996
- * @param {boolean=} padding If true, pad the output with equals signs.
1997
- * Defaults to true.
1998
- * @return {string}
1999
- */
2000
- static toBase64(data, padding) {}
2001
- /**
2002
- * Convert a base64 string to a Uint8Array. Accepts either the standard
2003
- * alphabet or the alternate "base64url" alphabet.
2004
- * @param {string} str
2005
- * @return {!Uint8Array}
2006
- */
2007
- static fromBase64(str) {}
2008
- /**
2009
- * Convert a hex string to a Uint8Array.
2010
- * @param {string} str
2011
- * @return {!Uint8Array}
2012
- */
2013
- static fromHex(str) {}
2014
- /**
2015
- * Convert a buffer to a hex string.
2016
- * @param {BufferSource} data
2017
- * @return {string}
2018
- */
2019
- static toHex(data) {}
2020
- /**
2021
- * Concatenate buffers.
2022
- * @param {...BufferSource} varArgs
2023
- * @return {!Uint8Array}
2024
- */
2025
- static concat(...varArgs) {}
2026
- };
2027
2060
  /**
2028
2061
  * @summary An interface to register manifest parsers.
2029
2062
  */
@@ -2072,10 +2105,10 @@ shaka.media.InitSegmentReference = class {
2072
2105
  * the quality of the media associated with this init segment.
2073
2106
  * @param {(null|number)=} timescale
2074
2107
  * @param {(null|BufferSource)=} segmentData
2075
- * @param {?shaka.extern.aes128Key=} aes128Key
2108
+ * @param {?shaka.extern.aesKey=} aesKey
2076
2109
  * The segment's AES-128-CBC full segment encryption key and iv.
2077
2110
  */
2078
- constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData, aes128Key) {}
2111
+ constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData, aesKey) {}
2079
2112
  /**
2080
2113
  * Returns the offset from the start of the resource to the
2081
2114
  * start of the segment.
@@ -2148,12 +2181,12 @@ shaka.media.SegmentReference = class {
2148
2181
  * @param {shaka.media.SegmentReference.Status=} status
2149
2182
  * The segment status is used to indicate that a segment does not exist or is
2150
2183
  * not available.
2151
- * @param {?shaka.extern.aes128Key=} aes128Key
2184
+ * @param {?shaka.extern.aesKey=} aesKey
2152
2185
  * The segment's AES-128-CBC full segment encryption key and iv.
2153
2186
  * @param {boolean=} allPartialSegments
2154
2187
  * Indicate if the segment has all partial segments
2155
2188
  */
2156
- constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aes128Key, allPartialSegments) {}
2189
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aesKey, allPartialSegments) {}
2157
2190
  /**
2158
2191
  * Creates and returns the URIs of the resource containing the segment.
2159
2192
  * @return {!Array.<string>}
@@ -2271,6 +2304,16 @@ shaka.media.SegmentReference = class {
2271
2304
  * @param {number} lowestSyncTime
2272
2305
  */
2273
2306
  syncAgainst(lowestSyncTime) {}
2307
+ /**
2308
+ * Set the segment data.
2309
+ * @param {!BufferSource} segmentData
2310
+ */
2311
+ setSegmentData(segmentData) {}
2312
+ /**
2313
+ * Return the segment data.
2314
+ * @return {?BufferSource}
2315
+ */
2316
+ getSegmentData() {}
2274
2317
  };
2275
2318
  /**
2276
2319
  * Rather than using booleans to communicate what the state of the reference,
@@ -2508,6 +2551,11 @@ shaka.media.PresentationTimeline = class {
2508
2551
  * availability duration in seconds.
2509
2552
  */
2510
2553
  setSegmentAvailabilityDuration(segmentAvailabilityDuration) {}
2554
+ /**
2555
+ * Gets the presentation's segment availability duration.
2556
+ * @return {number}
2557
+ */
2558
+ getSegmentAvailabilityDuration() {}
2511
2559
  /**
2512
2560
  * Sets the presentation delay in seconds.
2513
2561
  * @param {number} delay
@@ -2673,6 +2721,7 @@ shaka.media.PresentationTimeline = class {
2673
2721
  shaka.media.PresentationTimeline.TimeRange;
2674
2722
  /**
2675
2723
  * SegmentIndex.
2724
+ * @implements {shaka.extern.SegmentIndex}
2676
2725
  * @implements {shaka.util.IReleasable}
2677
2726
  * @implements {Iterable.<!shaka.media.SegmentReference>}
2678
2727
  */
@@ -2683,6 +2732,14 @@ shaka.media.SegmentIndex = class {
2683
2732
  * (ascending) and second by their end times (ascending).
2684
2733
  */
2685
2734
  constructor(references) {}
2735
+ /**
2736
+ * @override
2737
+ */
2738
+ getNumReferences() {}
2739
+ /**
2740
+ * @override
2741
+ */
2742
+ getNumEvicted() {}
2686
2743
  /**
2687
2744
  * @override
2688
2745
  */
@@ -2695,20 +2752,11 @@ shaka.media.SegmentIndex = class {
2695
2752
  */
2696
2753
  markImmutable() {}
2697
2754
  /**
2698
- * Finds the position of the segment for the given time, in seconds, relative
2699
- * to the start of the presentation. Returns the position of the segment
2700
- * with the largest end time if more than one segment is known for the given
2701
- * time.
2702
- * @param {number} time
2703
- * @return {?number} The position of the segment, or null if the position of
2704
- * the segment could not be determined.
2755
+ * @override
2705
2756
  */
2706
2757
  find(time) {}
2707
2758
  /**
2708
- * Gets the SegmentReference for the segment at the given position.
2709
- * @param {number} position The position of the segment as returned by find().
2710
- * @return {shaka.media.SegmentReference} The SegmentReference, or null if
2711
- * no such SegmentReference exists.
2759
+ * @override
2712
2760
  */
2713
2761
  get(position) {}
2714
2762
  /**
@@ -2766,9 +2814,11 @@ shaka.media.SegmentIndex = class {
2766
2814
  * RFC 8216 rev 13, section 8.1: "Each (non-Partial) Media Segment in a Media
2767
2815
  * Playlist will contain at least one independent frame."
2768
2816
  * @param {number} time
2817
+ * @param {boolean=} allowNonIndepedent
2818
+ * @param {boolean=} reverse
2769
2819
  * @return {?shaka.media.SegmentIterator}
2770
2820
  */
2771
- getIteratorForTime(time) {}
2821
+ getIteratorForTime(time, allowNonIndepedent, reverse) {}
2772
2822
  /**
2773
2823
  * Create a SegmentIndex for a single segment of the given start time and
2774
2824
  * duration at the given URIs.
@@ -2788,8 +2838,13 @@ shaka.media.SegmentIterator = class {
2788
2838
  * @param {shaka.media.SegmentIndex} segmentIndex
2789
2839
  * @param {number} index
2790
2840
  * @param {number} partialSegmentIndex
2841
+ * @param {boolean} reverse
2791
2842
  */
2792
- constructor(segmentIndex, index, partialSegmentIndex) {}
2843
+ constructor(segmentIndex, index, partialSegmentIndex, reverse) {}
2844
+ /**
2845
+ * @param {boolean} reverse
2846
+ */
2847
+ setReverse(reverse) {}
2793
2848
  /**
2794
2849
  * @return {number}
2795
2850
  */
@@ -2817,6 +2872,10 @@ shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
2817
2872
  * @override
2818
2873
  */
2819
2874
  release() {}
2875
+ /**
2876
+ * @override
2877
+ */
2878
+ forEachTopLevelReference(fn) {}
2820
2879
  /**
2821
2880
  * @override
2822
2881
  */
@@ -2830,36 +2889,198 @@ shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
2830
2889
  */
2831
2890
  offset(offset) {}
2832
2891
  /**
2833
- * @override
2892
+ * @override
2893
+ */
2894
+ merge(references) {}
2895
+ /**
2896
+ * @override
2897
+ */
2898
+ evict(time) {}
2899
+ /**
2900
+ * @override
2901
+ */
2902
+ mergeAndEvict(references, windowStart) {}
2903
+ /**
2904
+ * @override
2905
+ */
2906
+ fit(windowStart, windowEnd) {}
2907
+ /**
2908
+ * @override
2909
+ */
2910
+ updateEvery(interval, updateCallback) {}
2911
+ };
2912
+ /**
2913
+ * @typedef {function(
2914
+ * !(shaka.media.InitSegmentReference|shaka.media.SegmentReference),
2915
+ * shaka.extern.Stream,
2916
+ * ?function(BufferSource):!Promise=
2917
+ * ):!shaka.net.NetworkingEngine.PendingRequest}
2918
+ * @description
2919
+ * A callback function that fetches a segment.
2920
+ */
2921
+ shaka.media.SegmentPrefetch.FetchDispatcher;
2922
+ /** */
2923
+ shaka.util.ConfigUtils = class {
2924
+ /**
2925
+ * @param {!Object} destination
2926
+ * @param {!Object} source
2927
+ * @param {!Object} template supplies default values
2928
+ * @param {!Object} overrides
2929
+ * Supplies override type checking. When the current path matches
2930
+ * the key in this object, each sub-value must match the type in this
2931
+ * object. If this contains an Object, it is used as the template.
2932
+ * @param {string} path to this part of the config
2933
+ * @return {boolean}
2934
+ */
2935
+ static mergeConfigObjects(destination, source, template, overrides, path) {}
2936
+ /**
2937
+ * Convert config from ('fieldName', value) format to a partial config object.
2938
+ * E. g. from ('manifest.retryParameters.maxAttempts', 1) to
2939
+ * { manifest: { retryParameters: { maxAttempts: 1 }}}.
2940
+ * @param {string} fieldName
2941
+ * @param {*} value
2942
+ * @return {!Object}
2943
+ */
2944
+ static convertToConfigObject(fieldName, value) {}
2945
+ };
2946
+ /**
2947
+ * @summary A set of FairPlay utility functions.
2948
+ */
2949
+ shaka.util.FairPlayUtils = class {
2950
+ /**
2951
+ * Check if FairPlay is supported.
2952
+ * @return {!Promise.<boolean>}
2953
+ */
2954
+ static isFairPlaySupported() {}
2955
+ /**
2956
+ * Using the default method, extract a content ID from the init data. This is
2957
+ * based on the FairPlay example documentation.
2958
+ * @param {!BufferSource} initData
2959
+ * @return {string}
2960
+ */
2961
+ static defaultGetContentId(initData) {}
2962
+ /**
2963
+ * Transforms the init data buffer using the given data. The format is:
2964
+ * <pre>
2965
+ * [4 bytes] initDataSize
2966
+ * [initDataSize bytes] initData
2967
+ * [4 bytes] contentIdSize
2968
+ * [contentIdSize bytes] contentId
2969
+ * [4 bytes] certSize
2970
+ * [certSize bytes] cert
2971
+ * </pre>
2972
+ * @param {!BufferSource} initData
2973
+ * @param {!BufferSource|string} contentId
2974
+ * @param {?BufferSource} cert The server certificate; this will throw if not
2975
+ * provided.
2976
+ * @return {!Uint8Array}
2977
+ */
2978
+ static initDataTransform(initData, contentId, cert) {}
2979
+ /**
2980
+ * Verimatrix initDataTransform configuration.
2981
+ * @param {!Uint8Array} initData
2982
+ * @param {string} initDataType
2983
+ * @param {?shaka.extern.DrmInfo} drmInfo
2984
+ */
2985
+ static verimatrixInitDataTransform(initData, initDataType, drmInfo) {}
2986
+ /**
2987
+ * EZDRM initDataTransform configuration.
2988
+ * @param {!Uint8Array} initData
2989
+ * @param {string} initDataType
2990
+ * @param {?shaka.extern.DrmInfo} drmInfo
2991
+ */
2992
+ static ezdrmInitDataTransform(initData, initDataType, drmInfo) {}
2993
+ /**
2994
+ * Conax initDataTransform configuration.
2995
+ * @param {!Uint8Array} initData
2996
+ * @param {string} initDataType
2997
+ * @param {?shaka.extern.DrmInfo} drmInfo
2998
+ */
2999
+ static conaxInitDataTransform(initData, initDataType, drmInfo) {}
3000
+ /**
3001
+ * ExpressPlay initDataTransform configuration.
3002
+ * @param {!Uint8Array} initData
3003
+ * @param {string} initDataType
3004
+ * @param {?shaka.extern.DrmInfo} drmInfo
3005
+ */
3006
+ static expressplayInitDataTransform(initData, initDataType, drmInfo) {}
3007
+ /**
3008
+ * Verimatrix FairPlay request.
3009
+ * @param {shaka.net.NetworkingEngine.RequestType} type
3010
+ * @param {shaka.extern.Request} request
3011
+ * @param {shaka.extern.RequestContext=} context
3012
+ */
3013
+ static verimatrixFairPlayRequest(type, request, context) {}
3014
+ /**
3015
+ * EZDRM FairPlay request.
3016
+ * @param {shaka.net.NetworkingEngine.RequestType} type
3017
+ * @param {shaka.extern.Request} request
3018
+ * @param {shaka.extern.RequestContext=} context
3019
+ */
3020
+ static ezdrmFairPlayRequest(type, request, context) {}
3021
+ /**
3022
+ * Conax FairPlay request.
3023
+ * @param {shaka.net.NetworkingEngine.RequestType} type
3024
+ * @param {shaka.extern.Request} request
3025
+ * @param {shaka.extern.RequestContext=} context
3026
+ */
3027
+ static conaxFairPlayRequest(type, request, context) {}
3028
+ /**
3029
+ * ExpressPlay FairPlay request.
3030
+ * @param {shaka.net.NetworkingEngine.RequestType} type
3031
+ * @param {shaka.extern.Request} request
3032
+ * @param {shaka.extern.RequestContext=} context
3033
+ */
3034
+ static expressplayFairPlayRequest(type, request, context) {}
3035
+ /**
3036
+ * Common FairPlay response transform for some DRMs providers.
3037
+ * @param {shaka.net.NetworkingEngine.RequestType} type
3038
+ * @param {shaka.extern.Response} response
3039
+ * @param {shaka.extern.RequestContext=} context
3040
+ */
3041
+ static commonFairPlayResponse(type, response, context) {}
3042
+ };
3043
+ /**
3044
+ * @final
3045
+ */
3046
+ shaka.util.PlayerConfiguration = class {
3047
+ /**
3048
+ * @return {shaka.extern.PlayerConfiguration}
2834
3049
  */
2835
- merge(references) {}
3050
+ static createDefault() {}
2836
3051
  /**
2837
- * @override
3052
+ * Merges the given configuration changes into the given destination. This
3053
+ * uses the default Player configurations as the template.
3054
+ * @param {shaka.extern.PlayerConfiguration} destination
3055
+ * @param {!Object} updates
3056
+ * @param {shaka.extern.PlayerConfiguration=} template
3057
+ * @return {boolean}
2838
3058
  */
2839
- evict(time) {}
3059
+ static mergeConfigObjects(destination, updates, template) {}
3060
+ };
3061
+ /**
3062
+ * @implements {shaka.util.IDestroyable}
3063
+ */
3064
+ shaka.media.PreloadManager = class extends shaka.util.FakeEventTarget {
2840
3065
  /**
2841
- * @override
3066
+ * @param {string} assetUri
3067
+ * @param {?string} mimeType
3068
+ * @param {number} startTimeOfLoad
3069
+ * @param {?number} startTime
3070
+ * @param {*} playerInterface
2842
3071
  */
2843
- mergeAndEvict(references, windowStart) {}
3072
+ constructor(assetUri, mimeType, startTimeOfLoad, startTime, playerInterface) {}
2844
3073
  /**
2845
- * @override
3074
+ * Waits for the loading to be finished (or to fail with an error).
3075
+ * @return {!Promise}
2846
3076
  */
2847
- fit(windowStart, windowEnd) {}
3077
+ waitForFinish() {}
2848
3078
  /**
3079
+ * Releases or stops all non-entrusted resources.
2849
3080
  * @override
2850
3081
  */
2851
- updateEvery(interval, updateCallback) {}
3082
+ destroy() {}
2852
3083
  };
2853
- /**
2854
- * @typedef {function(
2855
- * !(shaka.media.InitSegmentReference|shaka.media.SegmentReference),
2856
- * shaka.extern.Stream,
2857
- * ?function(BufferSource):!Promise=
2858
- * ):!shaka.net.NetworkingEngine.PendingRequest}
2859
- * @description
2860
- * A callback function that fetches a segment.
2861
- */
2862
- shaka.media.SegmentPrefetch.FetchDispatcher;
2863
3084
  /**
2864
3085
  * A text displayer plugin using the browser's native VTTCue interface.
2865
3086
  * @implements {shaka.extern.TextDisplayer}
@@ -2870,6 +3091,10 @@ shaka.text.SimpleTextDisplayer = class {
2870
3091
  * @param {string} label
2871
3092
  */
2872
3093
  constructor(video, label) {}
3094
+ /**
3095
+ * @override
3096
+ */
3097
+ configure(config) {}
2873
3098
  /**
2874
3099
  * @override
2875
3100
  */
@@ -2896,6 +3121,10 @@ shaka.text.SimpleTextDisplayer = class {
2896
3121
  * @implements {shaka.extern.TextDisplayer}
2897
3122
  */
2898
3123
  shaka.text.StubTextDisplayer = class {
3124
+ /**
3125
+ * @override
3126
+ */
3127
+ configure(config) {}
2899
3128
  /**
2900
3129
  * @override
2901
3130
  */
@@ -2936,8 +3165,13 @@ shaka.text.UITextDisplayer = class {
2936
3165
  * Constructor.
2937
3166
  * @param {HTMLMediaElement} video
2938
3167
  * @param {HTMLElement} videoContainer
3168
+ * @param {shaka.extern.TextDisplayerConfiguration} config
3169
+ */
3170
+ constructor(video, videoContainer, config) {}
3171
+ /**
3172
+ * @override
2939
3173
  */
2940
- constructor(video, videoContainer) {}
3174
+ configure(config) {}
2941
3175
  /**
2942
3176
  * @override
2943
3177
  */
@@ -3014,145 +3248,6 @@ shaka.util.CmsdManager = class {
3014
3248
  */
3015
3249
  getBandwidthEstimate(defaultEstimate) {}
3016
3250
  };
3017
- /** */
3018
- shaka.util.ConfigUtils = class {
3019
- /**
3020
- * @param {!Object} destination
3021
- * @param {!Object} source
3022
- * @param {!Object} template supplies default values
3023
- * @param {!Object} overrides
3024
- * Supplies override type checking. When the current path matches
3025
- * the key in this object, each sub-value must match the type in this
3026
- * object. If this contains an Object, it is used as the template.
3027
- * @param {string} path to this part of the config
3028
- * @return {boolean}
3029
- */
3030
- static mergeConfigObjects(destination, source, template, overrides, path) {}
3031
- /**
3032
- * Convert config from ('fieldName', value) format to a partial config object.
3033
- * E. g. from ('manifest.retryParameters.maxAttempts', 1) to
3034
- * { manifest: { retryParameters: { maxAttempts: 1 }}}.
3035
- * @param {string} fieldName
3036
- * @param {*} value
3037
- * @return {!Object}
3038
- */
3039
- static convertToConfigObject(fieldName, value) {}
3040
- };
3041
- /**
3042
- * @summary A set of FairPlay utility functions.
3043
- */
3044
- shaka.util.FairPlayUtils = class {
3045
- /**
3046
- * Check if FairPlay is supported.
3047
- * @return {!Promise.<boolean>}
3048
- */
3049
- static isFairPlaySupported() {}
3050
- /**
3051
- * Using the default method, extract a content ID from the init data. This is
3052
- * based on the FairPlay example documentation.
3053
- * @param {!BufferSource} initData
3054
- * @return {string}
3055
- */
3056
- static defaultGetContentId(initData) {}
3057
- /**
3058
- * Transforms the init data buffer using the given data. The format is:
3059
- * <pre>
3060
- * [4 bytes] initDataSize
3061
- * [initDataSize bytes] initData
3062
- * [4 bytes] contentIdSize
3063
- * [contentIdSize bytes] contentId
3064
- * [4 bytes] certSize
3065
- * [certSize bytes] cert
3066
- * </pre>
3067
- * @param {!BufferSource} initData
3068
- * @param {!BufferSource|string} contentId
3069
- * @param {?BufferSource} cert The server certificate; this will throw if not
3070
- * provided.
3071
- * @return {!Uint8Array}
3072
- */
3073
- static initDataTransform(initData, contentId, cert) {}
3074
- /**
3075
- * Verimatrix initDataTransform configuration.
3076
- * @param {!Uint8Array} initData
3077
- * @param {string} initDataType
3078
- * @param {?shaka.extern.DrmInfo} drmInfo
3079
- */
3080
- static verimatrixInitDataTransform(initData, initDataType, drmInfo) {}
3081
- /**
3082
- * EZDRM initDataTransform configuration.
3083
- * @param {!Uint8Array} initData
3084
- * @param {string} initDataType
3085
- * @param {?shaka.extern.DrmInfo} drmInfo
3086
- */
3087
- static ezdrmInitDataTransform(initData, initDataType, drmInfo) {}
3088
- /**
3089
- * Conax initDataTransform configuration.
3090
- * @param {!Uint8Array} initData
3091
- * @param {string} initDataType
3092
- * @param {?shaka.extern.DrmInfo} drmInfo
3093
- */
3094
- static conaxInitDataTransform(initData, initDataType, drmInfo) {}
3095
- /**
3096
- * ExpressPlay initDataTransform configuration.
3097
- * @param {!Uint8Array} initData
3098
- * @param {string} initDataType
3099
- * @param {?shaka.extern.DrmInfo} drmInfo
3100
- */
3101
- static expressplayInitDataTransform(initData, initDataType, drmInfo) {}
3102
- /**
3103
- * Verimatrix FairPlay request.
3104
- * @param {shaka.net.NetworkingEngine.RequestType} type
3105
- * @param {shaka.extern.Request} request
3106
- * @param {shaka.extern.RequestContext=} context
3107
- */
3108
- static verimatrixFairPlayRequest(type, request, context) {}
3109
- /**
3110
- * EZDRM FairPlay request.
3111
- * @param {shaka.net.NetworkingEngine.RequestType} type
3112
- * @param {shaka.extern.Request} request
3113
- * @param {shaka.extern.RequestContext=} context
3114
- */
3115
- static ezdrmFairPlayRequest(type, request, context) {}
3116
- /**
3117
- * Conax FairPlay request.
3118
- * @param {shaka.net.NetworkingEngine.RequestType} type
3119
- * @param {shaka.extern.Request} request
3120
- * @param {shaka.extern.RequestContext=} context
3121
- */
3122
- static conaxFairPlayRequest(type, request, context) {}
3123
- /**
3124
- * ExpressPlay FairPlay request.
3125
- * @param {shaka.net.NetworkingEngine.RequestType} type
3126
- * @param {shaka.extern.Request} request
3127
- * @param {shaka.extern.RequestContext=} context
3128
- */
3129
- static expressplayFairPlayRequest(type, request, context) {}
3130
- /**
3131
- * Common FairPlay response transform for some DRMs providers.
3132
- * @param {shaka.net.NetworkingEngine.RequestType} type
3133
- * @param {shaka.extern.Response} response
3134
- * @param {shaka.extern.RequestContext=} context
3135
- */
3136
- static commonFairPlayResponse(type, response, context) {}
3137
- };
3138
- /**
3139
- * @final
3140
- */
3141
- shaka.util.PlayerConfiguration = class {
3142
- /**
3143
- * @return {shaka.extern.PlayerConfiguration}
3144
- */
3145
- static createDefault() {}
3146
- /**
3147
- * Merges the given configuration changes into the given destination. This
3148
- * uses the default Player configurations as the template.
3149
- * @param {shaka.extern.PlayerConfiguration} destination
3150
- * @param {!Object} updates
3151
- * @param {shaka.extern.PlayerConfiguration=} template
3152
- * @return {boolean}
3153
- */
3154
- static mergeConfigObjects(destination, updates, template) {}
3155
- };
3156
3251
  /**
3157
3252
  * @summary The main player object for Shaka Player.
3158
3253
  * @implements {shaka.util.IDestroyable}
@@ -3245,7 +3340,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3245
3340
  /**
3246
3341
  * Loads a new stream.
3247
3342
  * If another stream was already playing, first unloads that stream.
3248
- * @param {string} assetUri
3343
+ * @param {string|shaka.media.PreloadManager} assetUriOrPreloader
3249
3344
  * @param {?number=} startTime
3250
3345
  * When <code>startTime</code> is <code>null</code> or
3251
3346
  * <code>undefined</code>, playback will start at the default start time (0
@@ -3253,7 +3348,39 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3253
3348
  * @param {?string=} mimeType
3254
3349
  * @return {!Promise}
3255
3350
  */
3256
- load(assetUri, startTime, mimeType) {}
3351
+ load(assetUriOrPreloader, startTime, mimeType) {}
3352
+ /**
3353
+ * Unloads the currently playing stream, if any, and returns a PreloadManager
3354
+ * that contains the loaded manifest of that asset, if any.
3355
+ * Allows for the asset to be re-loaded by this player faster, in the future.
3356
+ * When in src= mode, this unloads but does not make a PreloadManager.
3357
+ * @param {boolean=} initializeMediaSource
3358
+ * @param {boolean=} keepAdManager
3359
+ * @return {!Promise.<?shaka.media.PreloadManager>}
3360
+ */
3361
+ unloadAndSavePreload(initializeMediaSource, keepAdManager) {}
3362
+ /**
3363
+ * Starts to preload a given asset, and returns a PreloadManager object that
3364
+ * represents that preloading process.
3365
+ * The PreloadManager will load the manifest for that asset, as well as the
3366
+ * initialization segment. It will not preload anything more than that;
3367
+ * this feature is intended for reducing start-time latency, not for fully
3368
+ * downloading assets before playing them (for that, use
3369
+ * |shaka.offline.Storage|).
3370
+ * You can pass that PreloadManager object in to the |load| method on this
3371
+ * Player instance to finish loading that particular asset, or you can call
3372
+ * the |destroy| method on the manager if the preload is no longer necessary.
3373
+ * If this returns null rather than a PreloadManager, that indicates that the
3374
+ * asset must be played with src=, which cannot be preloaded.
3375
+ * @param {string} assetUri
3376
+ * @param {?number=} startTime
3377
+ * When <code>startTime</code> is <code>null</code> or
3378
+ * <code>undefined</code>, playback will start at the default start time (0
3379
+ * for VOD and liveEdge for LIVE).
3380
+ * @param {?string=} mimeType
3381
+ * @return {!Promise.<?shaka.media.PreloadManager>}
3382
+ */
3383
+ preload(assetUri, startTime, mimeType) {}
3257
3384
  /**
3258
3385
  * Releases all of the mutexes of the player. Meant for use by the tests.
3259
3386
  */
@@ -3584,19 +3711,22 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3584
3711
  */
3585
3712
  setTextTrackVisibility(isVisible) {}
3586
3713
  /**
3587
- * Get the current playhead position as a date. This should only be called
3588
- * when the player has loaded a live stream. If the player has not loaded a
3589
- * live stream, this will return <code>null</code>.
3714
+ * Get the current playhead position as a date.
3590
3715
  * @return {Date}
3591
3716
  */
3592
3717
  getPlayheadTimeAsDate() {}
3593
3718
  /**
3594
- * Get the presentation start time as a date. This should only be called when
3595
- * the player has loaded a live stream. If the player has not loaded a live
3596
- * stream, this will return <code>null</code>.
3719
+ * Get the presentation start time as a date.
3597
3720
  * @return {Date}
3598
3721
  */
3599
3722
  getPresentationStartTimeAsDate() {}
3723
+ /**
3724
+ * Get the presentation segment availability duration. This should only be
3725
+ * called when the player has loaded a live stream. If the player has not
3726
+ * loaded a live stream, this will return <code>null</code>.
3727
+ * @return {?number}
3728
+ */
3729
+ getSegmentAvailabilityDuration() {}
3600
3730
  /**
3601
3731
  * Get information about what the player has buffered. If the player has not
3602
3732
  * loaded content or is currently loading content, the buffered content will
@@ -3648,8 +3778,6 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3648
3778
  addChaptersTrack(uri, language, mimeType) {}
3649
3779
  /**
3650
3780
  * Set the maximum resolution that the platform's hardware can handle.
3651
- * This will be called automatically by <code>shaka.cast.CastReceiver</code>
3652
- * to enforce limitations of the Chromecast hardware.
3653
3781
  * @param {number} width
3654
3782
  * @param {number} height
3655
3783
  */
@@ -4153,6 +4281,11 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
4153
4281
  * @override
4154
4282
  */
4155
4283
  requestMediaTailorStream(url, adsParams, backupUrl) {}
4284
+ /**
4285
+ * @param {string} url
4286
+ * @override
4287
+ */
4288
+ addMediaTailorTrackingUrl(url) {}
4156
4289
  /**
4157
4290
  * @override
4158
4291
  */
@@ -4558,6 +4691,16 @@ shaka.util.PeriodCombiner = class {
4558
4691
  * @return {!Promise}
4559
4692
  */
4560
4693
  combinePeriods(periods, isDynamic) {}
4694
+ /**
4695
+ * @param {boolean} allowed If set to true, multi-mimeType or multi-codec
4696
+ * variants will be allowed.
4697
+ */
4698
+ setAllowMultiTypeVariants(allowed) {}
4699
+ /**
4700
+ * @param {boolean} useOnce if true, stream will be used only once in period
4701
+ * flattening algoritnm.
4702
+ */
4703
+ setUseStreamOnce(useOnce) {}
4561
4704
  };
4562
4705
  /**
4563
4706
  * Creates a new DASH parser.
@@ -5771,9 +5914,10 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
5771
5914
  * @param {!shaka.Player} player
5772
5915
  * @param {!HTMLElement} videoContainer
5773
5916
  * @param {!HTMLMediaElement} video
5917
+ * @param {?HTMLCanvasElement} vrCanvas
5774
5918
  * @param {shaka.extern.UIConfiguration} config
5775
5919
  */
5776
- constructor(player, videoContainer, video, config) {}
5920
+ constructor(player, videoContainer, video, vrCanvas, config) {}
5777
5921
  /**
5778
5922
  * @override
5779
5923
  */
@@ -5916,6 +6060,60 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
5916
6060
  * @return {boolean}
5917
6061
  */
5918
6062
  isOpaque() {}
6063
+ /**
6064
+ */
6065
+ showUI() {}
6066
+ /**
6067
+ */
6068
+ hideUI() {}
6069
+ /**
6070
+ * Returns if a VR is capable.
6071
+ * @return {boolean}
6072
+ */
6073
+ canPlayVR() {}
6074
+ /**
6075
+ * Returns if a VR is supported.
6076
+ * @return {boolean}
6077
+ */
6078
+ isPlayingVR() {}
6079
+ /**
6080
+ * Get the angle of the north.
6081
+ * @return {?number}
6082
+ */
6083
+ getVRNorth() {}
6084
+ /**
6085
+ * Returns the angle of the current field of view displayed in degrees.
6086
+ * @return {?number}
6087
+ */
6088
+ getVRFieldOfView() {}
6089
+ /**
6090
+ * Changing the field of view increases or decreases the portion of the video
6091
+ * that is viewed at one time. If the field of view is decreased, a small
6092
+ * part of the video will be seen, but with more detail. If the field of view
6093
+ * is increased, a larger part of the video will be seen, but with less
6094
+ * detail.
6095
+ * @param {number} fieldOfView In degrees
6096
+ */
6097
+ setVRFieldOfView(fieldOfView) {}
6098
+ /**
6099
+ * Toggle stereoscopic mode.
6100
+ */
6101
+ toggleStereoscopicMode() {}
6102
+ /**
6103
+ * Increment the yaw in X angle in degrees.
6104
+ * @param {number} angle In degrees
6105
+ */
6106
+ incrementYaw(angle) {}
6107
+ /**
6108
+ * Increment the pitch in X angle in degrees.
6109
+ * @param {number} angle In degrees
6110
+ */
6111
+ incrementPitch(angle) {}
6112
+ /**
6113
+ * Increment the roll in X angle in degrees.
6114
+ * @param {number} angle In degrees
6115
+ */
6116
+ incrementRoll(angle) {}
5919
6117
  };
5920
6118
  /**
5921
6119
  * @extends {shaka.ui.Element}
@@ -5952,8 +6150,9 @@ shaka.ui.Overlay = class {
5952
6150
  * @param {!shaka.Player} player
5953
6151
  * @param {!HTMLElement} videoContainer
5954
6152
  * @param {!HTMLMediaElement} video
6153
+ * @param {?HTMLCanvasElement=} vrCanvas
5955
6154
  */
5956
- constructor(player, videoContainer, video) {}
6155
+ constructor(player, videoContainer, video, vrCanvas) {}
5957
6156
  /**
5958
6157
  * @override
5959
6158
  */
@@ -6116,6 +6315,17 @@ shaka.ui.PresentationTimeTracker = class extends shaka.ui.Element {
6116
6315
  */
6117
6316
  constructor(parent, controls) {}
6118
6317
  };
6318
+ /**
6319
+ * @extends {shaka.ui.Element}
6320
+ * @final
6321
+ */
6322
+ shaka.ui.RecenterVRButton = class extends shaka.ui.Element {
6323
+ /**
6324
+ * @param {!HTMLElement} parent
6325
+ * @param {!shaka.ui.Controls} controls
6326
+ */
6327
+ constructor(parent, controls) {}
6328
+ };
6119
6329
  /**
6120
6330
  * @extends {shaka.ui.Element}
6121
6331
  * @final
@@ -6204,6 +6414,17 @@ shaka.ui.TextSelection = class extends shaka.ui.SettingsMenu {
6204
6414
  */
6205
6415
  constructor(parent, controls) {}
6206
6416
  };
6417
+ /**
6418
+ * @extends {shaka.ui.Element}
6419
+ * @final
6420
+ */
6421
+ shaka.ui.ToggleStereoscopicButton = class extends shaka.ui.Element {
6422
+ /**
6423
+ * @param {!HTMLElement} parent
6424
+ * @param {!shaka.ui.Controls} controls
6425
+ */
6426
+ constructor(parent, controls) {}
6427
+ };
6207
6428
  /**
6208
6429
  * @extends {shaka.ui.RangeElement}
6209
6430
  * @final