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
@@ -891,6 +891,7 @@ shaka.util.Error.Code = {
891
891
  'NO_VIDEO_ELEMENT': 7002,
892
892
  'OBJECT_DESTROYED': 7003,
893
893
  'CONTENT_NOT_LOADED': 7004,
894
+ 'SRC_EQUALS_PRELOAD_NOT_SUPPORTED': 7005,
894
895
  'CAST_API_UNAVAILABLE': 8000,
895
896
  'NO_CAST_RECEIVERS': 8001,
896
897
  'ALREADY_CASTING': 8002,
@@ -920,6 +921,137 @@ shaka.util.Error.Code = {
920
921
  'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004,
921
922
  'MT_AD_MANAGER_NOT_INITIALIZED': 10005
922
923
  };
924
+ /**
925
+ * A timer allows a single function to be executed at a later time or at
926
+ * regular intervals.
927
+ * @final
928
+ */
929
+ shaka.util.Timer = class {
930
+ /**
931
+ * Create a new timer. A timer is committed to a single callback function.
932
+ * While there is no technical reason to do this, it is far easier to
933
+ * understand and use timers when they are connected to one functional idea.
934
+ * @param {function()} onTick
935
+ */
936
+ constructor(onTick) {}
937
+ /**
938
+ * Have the timer call |onTick| now.
939
+ * @return {!shaka.util.Timer}
940
+ */
941
+ tickNow() {}
942
+ /**
943
+ * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
944
+ * called first.
945
+ * @param {number} seconds
946
+ * @return {!shaka.util.Timer}
947
+ */
948
+ tickAfter(seconds) {}
949
+ /**
950
+ * Have the timer call |onTick| every |seconds| until |stop| is called.
951
+ * @param {number} seconds
952
+ * @return {!shaka.util.Timer}
953
+ */
954
+ tickEvery(seconds) {}
955
+ /**
956
+ * Stop the timer and clear the previous behaviour. The timer is still usable
957
+ * after calling |stop|.
958
+ */
959
+ stop() {}
960
+ };
961
+ /**
962
+ * @namespace shaka.util.StringUtils
963
+ * @summary A set of string utility functions.
964
+ */
965
+ shaka.util.StringUtils = class {
966
+ /**
967
+ * Creates a string from the given buffer as UTF-8 encoding.
968
+ * @param {?BufferSource} data
969
+ * @return {string}
970
+ */
971
+ static fromUTF8(data) {}
972
+ /**
973
+ * Creates a string from the given buffer as UTF-16 encoding.
974
+ * @param {?BufferSource} data
975
+ * @param {boolean} littleEndian
976
+ true to read little endian, false to read big.
977
+ * @param {boolean=} noThrow true to avoid throwing in cases where we may
978
+ * expect invalid input. If noThrow is true and the data has an odd
979
+ * length,it will be truncated.
980
+ * @return {string}
981
+ */
982
+ static fromUTF16(data, littleEndian, noThrow) {}
983
+ /**
984
+ * Creates a string from the given buffer, auto-detecting the encoding that is
985
+ * being used. If it cannot detect the encoding, it will throw an exception.
986
+ * @param {?BufferSource} data
987
+ * @return {string}
988
+ */
989
+ static fromBytesAutoDetect(data) {}
990
+ /**
991
+ * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
992
+ * @param {string} str
993
+ * @return {!ArrayBuffer}
994
+ */
995
+ static toUTF8(str) {}
996
+ /**
997
+ * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
998
+ * @param {string} str
999
+ * @param {boolean} littleEndian
1000
+ * @return {!ArrayBuffer}
1001
+ */
1002
+ static toUTF16(str, littleEndian) {}
1003
+ /**
1004
+ * Resets the fromCharCode method's implementation.
1005
+ * For debug use.
1006
+ */
1007
+ static resetFromCharCode() {}
1008
+ };
1009
+ /**
1010
+ * @summary A set of Uint8Array utility functions.
1011
+ */
1012
+ shaka.util.Uint8ArrayUtils = class {
1013
+ /**
1014
+ * Convert a buffer to a base64 string. The output will be standard
1015
+ * alphabet as opposed to base64url safe alphabet.
1016
+ * @param {BufferSource} data
1017
+ * @return {string}
1018
+ */
1019
+ static toStandardBase64(data) {}
1020
+ /**
1021
+ * Convert a buffer to a base64 string. The output will always use the
1022
+ * alternate encoding/alphabet also known as "base64url".
1023
+ * @param {BufferSource} data
1024
+ * @param {boolean=} padding If true, pad the output with equals signs.
1025
+ * Defaults to true.
1026
+ * @return {string}
1027
+ */
1028
+ static toBase64(data, padding) {}
1029
+ /**
1030
+ * Convert a base64 string to a Uint8Array. Accepts either the standard
1031
+ * alphabet or the alternate "base64url" alphabet.
1032
+ * @param {string} str
1033
+ * @return {!Uint8Array}
1034
+ */
1035
+ static fromBase64(str) {}
1036
+ /**
1037
+ * Convert a hex string to a Uint8Array.
1038
+ * @param {string} str
1039
+ * @return {!Uint8Array}
1040
+ */
1041
+ static fromHex(str) {}
1042
+ /**
1043
+ * Convert a buffer to a hex string.
1044
+ * @param {BufferSource} data
1045
+ * @return {string}
1046
+ */
1047
+ static toHex(data) {}
1048
+ /**
1049
+ * Concatenate buffers.
1050
+ * @param {...BufferSource} varArgs
1051
+ * @return {!Uint8Array}
1052
+ */
1053
+ static concat(...varArgs) {}
1054
+ };
923
1055
  /**
924
1056
  * @summary A set of utility functions for dealing with MIME types.
925
1057
  */
@@ -1109,43 +1241,6 @@ shaka.util.LanguageUtils = class {
1109
1241
  */
1110
1242
  static findClosestLocale(target, searchSpace) {}
1111
1243
  };
1112
- /**
1113
- * A timer allows a single function to be executed at a later time or at
1114
- * regular intervals.
1115
- * @final
1116
- */
1117
- shaka.util.Timer = class {
1118
- /**
1119
- * Create a new timer. A timer is committed to a single callback function.
1120
- * While there is no technical reason to do this, it is far easier to
1121
- * understand and use timers when they are connected to one functional idea.
1122
- * @param {function()} onTick
1123
- */
1124
- constructor(onTick) {}
1125
- /**
1126
- * Have the timer call |onTick| now.
1127
- * @return {!shaka.util.Timer}
1128
- */
1129
- tickNow() {}
1130
- /**
1131
- * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
1132
- * called first.
1133
- * @param {number} seconds
1134
- * @return {!shaka.util.Timer}
1135
- */
1136
- tickAfter(seconds) {}
1137
- /**
1138
- * Have the timer call |onTick| every |seconds| until |stop| is called.
1139
- * @param {number} seconds
1140
- * @return {!shaka.util.Timer}
1141
- */
1142
- tickEvery(seconds) {}
1143
- /**
1144
- * Stop the timer and clear the previous behaviour. The timer is still usable
1145
- * after calling |stop|.
1146
- */
1147
- stop() {}
1148
- };
1149
1244
  /**
1150
1245
  * @summary A set of utility functions for dealing with Streams and Manifests.
1151
1246
  */
@@ -1212,9 +1307,16 @@ shaka.abr.SimpleAbrManager = class {
1212
1307
  */
1213
1308
  disable() {}
1214
1309
  /**
1310
+ * @param {number} deltaTimeMs The duration, in milliseconds, that the request
1311
+ * took to complete.
1312
+ * @param {number} numBytes The total number of bytes transferred.
1313
+ * @param {boolean} allowSwitch Indicate if the segment is allowed to switch
1314
+ * to another stream.
1315
+ * @param {shaka.extern.Request=} request
1316
+ * A reference to the request
1215
1317
  * @override
1216
1318
  */
1217
- segmentDownloaded(deltaTimeMs, numBytes, allowSwitch) {}
1319
+ segmentDownloaded(deltaTimeMs, numBytes, allowSwitch, request) {}
1218
1320
  /**
1219
1321
  * @override
1220
1322
  */
@@ -1419,7 +1521,8 @@ shaka.util.FakeEventTarget.ListenerType;
1419
1521
  */
1420
1522
  shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1421
1523
  /**
1422
- * @param {function(number, number, boolean)=} onProgressUpdated Called when
1524
+ * @param {shaka.net.NetworkingEngine.onProgressUpdated=} onProgressUpdated
1525
+ * Called when
1423
1526
  * a progress event is triggered. Passed the duration, in milliseconds,
1424
1527
  * that the request took, the number of bytes transferred, and the boolean
1425
1528
  * of whether the switching is allowed.
@@ -1431,8 +1534,10 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1431
1534
  * Called when a request is made
1432
1535
  * @param {shaka.net.NetworkingEngine.OnRetry=} onRetry
1433
1536
  * Called when a request retry is made
1537
+ * @param {shaka.net.NetworkingEngine.OnResponse=} onResponse
1538
+ * Called when receive the response
1434
1539
  */
1435
- constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest, onRetry) {}
1540
+ constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest, onRetry, onResponse) {}
1436
1541
  /**
1437
1542
  * @param {boolean} forceHTTPS
1438
1543
  */
@@ -1601,6 +1706,19 @@ shaka.net.NetworkingEngine.PluginPriority = {
1601
1706
  * the player, plus some extra data.
1602
1707
  */
1603
1708
  shaka.net.NetworkingEngine.OnHeadersReceived;
1709
+ /**
1710
+ * @typedef {function(
1711
+ * number,
1712
+ * number,
1713
+ * boolean,
1714
+ * shaka.extern.Request=)}
1715
+ * @description
1716
+ * A callback that is passed the duration, in milliseconds,
1717
+ * that the request took, the number of bytes transferred, a boolean
1718
+ * representing whether the switching is allowed and a ref to the
1719
+ * original request.
1720
+ */
1721
+ shaka.net.NetworkingEngine.onProgressUpdated;
1604
1722
  /**
1605
1723
  * @typedef {function(
1606
1724
  * !shaka.extern.Request,
@@ -1633,53 +1751,14 @@ shaka.net.NetworkingEngine.OnRequest;
1633
1751
  */
1634
1752
  shaka.net.NetworkingEngine.OnRetry;
1635
1753
  /**
1636
- * @namespace shaka.util.StringUtils
1637
- * @summary A set of string utility functions.
1754
+ * @typedef {function(
1755
+ * !shaka.net.NetworkingEngine.RequestType,
1756
+ * !shaka.extern.Response,
1757
+ * (shaka.extern.RequestContext|undefined))}
1758
+ * @description
1759
+ * A callback function called on every request
1638
1760
  */
1639
- shaka.util.StringUtils = class {
1640
- /**
1641
- * Creates a string from the given buffer as UTF-8 encoding.
1642
- * @param {?BufferSource} data
1643
- * @return {string}
1644
- */
1645
- static fromUTF8(data) {}
1646
- /**
1647
- * Creates a string from the given buffer as UTF-16 encoding.
1648
- * @param {?BufferSource} data
1649
- * @param {boolean} littleEndian
1650
- true to read little endian, false to read big.
1651
- * @param {boolean=} noThrow true to avoid throwing in cases where we may
1652
- * expect invalid input. If noThrow is true and the data has an odd
1653
- * length,it will be truncated.
1654
- * @return {string}
1655
- */
1656
- static fromUTF16(data, littleEndian, noThrow) {}
1657
- /**
1658
- * Creates a string from the given buffer, auto-detecting the encoding that is
1659
- * being used. If it cannot detect the encoding, it will throw an exception.
1660
- * @param {?BufferSource} data
1661
- * @return {string}
1662
- */
1663
- static fromBytesAutoDetect(data) {}
1664
- /**
1665
- * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
1666
- * @param {string} str
1667
- * @return {!ArrayBuffer}
1668
- */
1669
- static toUTF8(str) {}
1670
- /**
1671
- * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
1672
- * @param {string} str
1673
- * @param {boolean} littleEndian
1674
- * @return {!ArrayBuffer}
1675
- */
1676
- static toUTF16(str, littleEndian) {}
1677
- /**
1678
- * Resets the fromCharCode method's implementation.
1679
- * For debug use.
1680
- */
1681
- static resetFromCharCode() {}
1682
- };
1761
+ shaka.net.NetworkingEngine.OnResponse;
1683
1762
  /**
1684
1763
  * @summary DataViewReader abstracts a DataView object.
1685
1764
  */
@@ -1866,52 +1945,6 @@ shaka.util.Mp4Parser = class {
1866
1945
  * @typedef {function(!shaka.extern.ParsedBox)}
1867
1946
  */
1868
1947
  shaka.util.Mp4Parser.CallbackType;
1869
- /**
1870
- * @summary A set of Uint8Array utility functions.
1871
- */
1872
- shaka.util.Uint8ArrayUtils = class {
1873
- /**
1874
- * Convert a buffer to a base64 string. The output will be standard
1875
- * alphabet as opposed to base64url safe alphabet.
1876
- * @param {BufferSource} data
1877
- * @return {string}
1878
- */
1879
- static toStandardBase64(data) {}
1880
- /**
1881
- * Convert a buffer to a base64 string. The output will always use the
1882
- * alternate encoding/alphabet also known as "base64url".
1883
- * @param {BufferSource} data
1884
- * @param {boolean=} padding If true, pad the output with equals signs.
1885
- * Defaults to true.
1886
- * @return {string}
1887
- */
1888
- static toBase64(data, padding) {}
1889
- /**
1890
- * Convert a base64 string to a Uint8Array. Accepts either the standard
1891
- * alphabet or the alternate "base64url" alphabet.
1892
- * @param {string} str
1893
- * @return {!Uint8Array}
1894
- */
1895
- static fromBase64(str) {}
1896
- /**
1897
- * Convert a hex string to a Uint8Array.
1898
- * @param {string} str
1899
- * @return {!Uint8Array}
1900
- */
1901
- static fromHex(str) {}
1902
- /**
1903
- * Convert a buffer to a hex string.
1904
- * @param {BufferSource} data
1905
- * @return {string}
1906
- */
1907
- static toHex(data) {}
1908
- /**
1909
- * Concatenate buffers.
1910
- * @param {...BufferSource} varArgs
1911
- * @return {!Uint8Array}
1912
- */
1913
- static concat(...varArgs) {}
1914
- };
1915
1948
  /**
1916
1949
  * @summary An interface to register manifest parsers.
1917
1950
  */
@@ -1960,10 +1993,10 @@ shaka.media.InitSegmentReference = class {
1960
1993
  * the quality of the media associated with this init segment.
1961
1994
  * @param {(null|number)=} timescale
1962
1995
  * @param {(null|BufferSource)=} segmentData
1963
- * @param {?shaka.extern.aes128Key=} aes128Key
1996
+ * @param {?shaka.extern.aesKey=} aesKey
1964
1997
  * The segment's AES-128-CBC full segment encryption key and iv.
1965
1998
  */
1966
- constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData, aes128Key) {}
1999
+ constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData, aesKey) {}
1967
2000
  /**
1968
2001
  * Returns the offset from the start of the resource to the
1969
2002
  * start of the segment.
@@ -2036,12 +2069,12 @@ shaka.media.SegmentReference = class {
2036
2069
  * @param {shaka.media.SegmentReference.Status=} status
2037
2070
  * The segment status is used to indicate that a segment does not exist or is
2038
2071
  * not available.
2039
- * @param {?shaka.extern.aes128Key=} aes128Key
2072
+ * @param {?shaka.extern.aesKey=} aesKey
2040
2073
  * The segment's AES-128-CBC full segment encryption key and iv.
2041
2074
  * @param {boolean=} allPartialSegments
2042
2075
  * Indicate if the segment has all partial segments
2043
2076
  */
2044
- constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aes128Key, allPartialSegments) {}
2077
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aesKey, allPartialSegments) {}
2045
2078
  /**
2046
2079
  * Creates and returns the URIs of the resource containing the segment.
2047
2080
  * @return {!Array.<string>}
@@ -2159,6 +2192,16 @@ shaka.media.SegmentReference = class {
2159
2192
  * @param {number} lowestSyncTime
2160
2193
  */
2161
2194
  syncAgainst(lowestSyncTime) {}
2195
+ /**
2196
+ * Set the segment data.
2197
+ * @param {!BufferSource} segmentData
2198
+ */
2199
+ setSegmentData(segmentData) {}
2200
+ /**
2201
+ * Return the segment data.
2202
+ * @return {?BufferSource}
2203
+ */
2204
+ getSegmentData() {}
2162
2205
  };
2163
2206
  /**
2164
2207
  * Rather than using booleans to communicate what the state of the reference,
@@ -2396,6 +2439,11 @@ shaka.media.PresentationTimeline = class {
2396
2439
  * availability duration in seconds.
2397
2440
  */
2398
2441
  setSegmentAvailabilityDuration(segmentAvailabilityDuration) {}
2442
+ /**
2443
+ * Gets the presentation's segment availability duration.
2444
+ * @return {number}
2445
+ */
2446
+ getSegmentAvailabilityDuration() {}
2399
2447
  /**
2400
2448
  * Sets the presentation delay in seconds.
2401
2449
  * @param {number} delay
@@ -2561,6 +2609,7 @@ shaka.media.PresentationTimeline = class {
2561
2609
  shaka.media.PresentationTimeline.TimeRange;
2562
2610
  /**
2563
2611
  * SegmentIndex.
2612
+ * @implements {shaka.extern.SegmentIndex}
2564
2613
  * @implements {shaka.util.IReleasable}
2565
2614
  * @implements {Iterable.<!shaka.media.SegmentReference>}
2566
2615
  */
@@ -2571,6 +2620,14 @@ shaka.media.SegmentIndex = class {
2571
2620
  * (ascending) and second by their end times (ascending).
2572
2621
  */
2573
2622
  constructor(references) {}
2623
+ /**
2624
+ * @override
2625
+ */
2626
+ getNumReferences() {}
2627
+ /**
2628
+ * @override
2629
+ */
2630
+ getNumEvicted() {}
2574
2631
  /**
2575
2632
  * @override
2576
2633
  */
@@ -2583,20 +2640,11 @@ shaka.media.SegmentIndex = class {
2583
2640
  */
2584
2641
  markImmutable() {}
2585
2642
  /**
2586
- * Finds the position of the segment for the given time, in seconds, relative
2587
- * to the start of the presentation. Returns the position of the segment
2588
- * with the largest end time if more than one segment is known for the given
2589
- * time.
2590
- * @param {number} time
2591
- * @return {?number} The position of the segment, or null if the position of
2592
- * the segment could not be determined.
2643
+ * @override
2593
2644
  */
2594
2645
  find(time) {}
2595
2646
  /**
2596
- * Gets the SegmentReference for the segment at the given position.
2597
- * @param {number} position The position of the segment as returned by find().
2598
- * @return {shaka.media.SegmentReference} The SegmentReference, or null if
2599
- * no such SegmentReference exists.
2647
+ * @override
2600
2648
  */
2601
2649
  get(position) {}
2602
2650
  /**
@@ -2654,9 +2702,11 @@ shaka.media.SegmentIndex = class {
2654
2702
  * RFC 8216 rev 13, section 8.1: "Each (non-Partial) Media Segment in a Media
2655
2703
  * Playlist will contain at least one independent frame."
2656
2704
  * @param {number} time
2705
+ * @param {boolean=} allowNonIndepedent
2706
+ * @param {boolean=} reverse
2657
2707
  * @return {?shaka.media.SegmentIterator}
2658
2708
  */
2659
- getIteratorForTime(time) {}
2709
+ getIteratorForTime(time, allowNonIndepedent, reverse) {}
2660
2710
  /**
2661
2711
  * Create a SegmentIndex for a single segment of the given start time and
2662
2712
  * duration at the given URIs.
@@ -2676,78 +2726,249 @@ shaka.media.SegmentIterator = class {
2676
2726
  * @param {shaka.media.SegmentIndex} segmentIndex
2677
2727
  * @param {number} index
2678
2728
  * @param {number} partialSegmentIndex
2729
+ * @param {boolean} reverse
2730
+ */
2731
+ constructor(segmentIndex, index, partialSegmentIndex, reverse) {}
2732
+ /**
2733
+ * @param {boolean} reverse
2734
+ */
2735
+ setReverse(reverse) {}
2736
+ /**
2737
+ * @return {number}
2738
+ */
2739
+ currentPosition() {}
2740
+ /**
2741
+ * @return {shaka.media.SegmentReference}
2742
+ */
2743
+ current() {}
2744
+ /**
2745
+ * @override
2746
+ */
2747
+ next() {}
2748
+ };
2749
+ /**
2750
+ * A meta-SegmentIndex composed of multiple other SegmentIndexes.
2751
+ * Used in constructing multi-Period Streams for DASH.
2752
+ * @extends shaka.media.SegmentIndex
2753
+ * @implements {shaka.util.IReleasable}
2754
+ * @implements {Iterable.<!shaka.media.SegmentReference>}
2755
+ */
2756
+ shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
2757
+ /** */
2758
+ constructor() {}
2759
+ /**
2760
+ * @override
2761
+ */
2762
+ release() {}
2763
+ /**
2764
+ * @override
2765
+ */
2766
+ forEachTopLevelReference(fn) {}
2767
+ /**
2768
+ * @override
2769
+ */
2770
+ find(time) {}
2771
+ /**
2772
+ * @override
2773
+ */
2774
+ get(position) {}
2775
+ /**
2776
+ * @override
2777
+ */
2778
+ offset(offset) {}
2779
+ /**
2780
+ * @override
2781
+ */
2782
+ merge(references) {}
2783
+ /**
2784
+ * @override
2785
+ */
2786
+ evict(time) {}
2787
+ /**
2788
+ * @override
2789
+ */
2790
+ mergeAndEvict(references, windowStart) {}
2791
+ /**
2792
+ * @override
2793
+ */
2794
+ fit(windowStart, windowEnd) {}
2795
+ /**
2796
+ * @override
2797
+ */
2798
+ updateEvery(interval, updateCallback) {}
2799
+ };
2800
+ /**
2801
+ * @typedef {function(
2802
+ * !(shaka.media.InitSegmentReference|shaka.media.SegmentReference),
2803
+ * shaka.extern.Stream,
2804
+ * ?function(BufferSource):!Promise=
2805
+ * ):!shaka.net.NetworkingEngine.PendingRequest}
2806
+ * @description
2807
+ * A callback function that fetches a segment.
2808
+ */
2809
+ shaka.media.SegmentPrefetch.FetchDispatcher;
2810
+ /** */
2811
+ shaka.util.ConfigUtils = class {
2812
+ /**
2813
+ * @param {!Object} destination
2814
+ * @param {!Object} source
2815
+ * @param {!Object} template supplies default values
2816
+ * @param {!Object} overrides
2817
+ * Supplies override type checking. When the current path matches
2818
+ * the key in this object, each sub-value must match the type in this
2819
+ * object. If this contains an Object, it is used as the template.
2820
+ * @param {string} path to this part of the config
2821
+ * @return {boolean}
2822
+ */
2823
+ static mergeConfigObjects(destination, source, template, overrides, path) {}
2824
+ /**
2825
+ * Convert config from ('fieldName', value) format to a partial config object.
2826
+ * E. g. from ('manifest.retryParameters.maxAttempts', 1) to
2827
+ * { manifest: { retryParameters: { maxAttempts: 1 }}}.
2828
+ * @param {string} fieldName
2829
+ * @param {*} value
2830
+ * @return {!Object}
2831
+ */
2832
+ static convertToConfigObject(fieldName, value) {}
2833
+ };
2834
+ /**
2835
+ * @summary A set of FairPlay utility functions.
2836
+ */
2837
+ shaka.util.FairPlayUtils = class {
2838
+ /**
2839
+ * Check if FairPlay is supported.
2840
+ * @return {!Promise.<boolean>}
2841
+ */
2842
+ static isFairPlaySupported() {}
2843
+ /**
2844
+ * Using the default method, extract a content ID from the init data. This is
2845
+ * based on the FairPlay example documentation.
2846
+ * @param {!BufferSource} initData
2847
+ * @return {string}
2848
+ */
2849
+ static defaultGetContentId(initData) {}
2850
+ /**
2851
+ * Transforms the init data buffer using the given data. The format is:
2852
+ * <pre>
2853
+ * [4 bytes] initDataSize
2854
+ * [initDataSize bytes] initData
2855
+ * [4 bytes] contentIdSize
2856
+ * [contentIdSize bytes] contentId
2857
+ * [4 bytes] certSize
2858
+ * [certSize bytes] cert
2859
+ * </pre>
2860
+ * @param {!BufferSource} initData
2861
+ * @param {!BufferSource|string} contentId
2862
+ * @param {?BufferSource} cert The server certificate; this will throw if not
2863
+ * provided.
2864
+ * @return {!Uint8Array}
2865
+ */
2866
+ static initDataTransform(initData, contentId, cert) {}
2867
+ /**
2868
+ * Verimatrix initDataTransform configuration.
2869
+ * @param {!Uint8Array} initData
2870
+ * @param {string} initDataType
2871
+ * @param {?shaka.extern.DrmInfo} drmInfo
2872
+ */
2873
+ static verimatrixInitDataTransform(initData, initDataType, drmInfo) {}
2874
+ /**
2875
+ * EZDRM initDataTransform configuration.
2876
+ * @param {!Uint8Array} initData
2877
+ * @param {string} initDataType
2878
+ * @param {?shaka.extern.DrmInfo} drmInfo
2879
+ */
2880
+ static ezdrmInitDataTransform(initData, initDataType, drmInfo) {}
2881
+ /**
2882
+ * Conax initDataTransform configuration.
2883
+ * @param {!Uint8Array} initData
2884
+ * @param {string} initDataType
2885
+ * @param {?shaka.extern.DrmInfo} drmInfo
2886
+ */
2887
+ static conaxInitDataTransform(initData, initDataType, drmInfo) {}
2888
+ /**
2889
+ * ExpressPlay initDataTransform configuration.
2890
+ * @param {!Uint8Array} initData
2891
+ * @param {string} initDataType
2892
+ * @param {?shaka.extern.DrmInfo} drmInfo
2893
+ */
2894
+ static expressplayInitDataTransform(initData, initDataType, drmInfo) {}
2895
+ /**
2896
+ * Verimatrix FairPlay request.
2897
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2898
+ * @param {shaka.extern.Request} request
2899
+ * @param {shaka.extern.RequestContext=} context
2900
+ */
2901
+ static verimatrixFairPlayRequest(type, request, context) {}
2902
+ /**
2903
+ * EZDRM FairPlay request.
2904
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2905
+ * @param {shaka.extern.Request} request
2906
+ * @param {shaka.extern.RequestContext=} context
2679
2907
  */
2680
- constructor(segmentIndex, index, partialSegmentIndex) {}
2908
+ static ezdrmFairPlayRequest(type, request, context) {}
2681
2909
  /**
2682
- * @return {number}
2910
+ * Conax FairPlay request.
2911
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2912
+ * @param {shaka.extern.Request} request
2913
+ * @param {shaka.extern.RequestContext=} context
2683
2914
  */
2684
- currentPosition() {}
2915
+ static conaxFairPlayRequest(type, request, context) {}
2685
2916
  /**
2686
- * @return {shaka.media.SegmentReference}
2917
+ * ExpressPlay FairPlay request.
2918
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2919
+ * @param {shaka.extern.Request} request
2920
+ * @param {shaka.extern.RequestContext=} context
2687
2921
  */
2688
- current() {}
2922
+ static expressplayFairPlayRequest(type, request, context) {}
2689
2923
  /**
2690
- * @override
2924
+ * Common FairPlay response transform for some DRMs providers.
2925
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2926
+ * @param {shaka.extern.Response} response
2927
+ * @param {shaka.extern.RequestContext=} context
2691
2928
  */
2692
- next() {}
2929
+ static commonFairPlayResponse(type, response, context) {}
2693
2930
  };
2694
2931
  /**
2695
- * A meta-SegmentIndex composed of multiple other SegmentIndexes.
2696
- * Used in constructing multi-Period Streams for DASH.
2697
- * @extends shaka.media.SegmentIndex
2698
- * @implements {shaka.util.IReleasable}
2699
- * @implements {Iterable.<!shaka.media.SegmentReference>}
2932
+ * @final
2700
2933
  */
2701
- shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
2702
- /** */
2703
- constructor() {}
2704
- /**
2705
- * @override
2706
- */
2707
- release() {}
2708
- /**
2709
- * @override
2710
- */
2711
- find(time) {}
2712
- /**
2713
- * @override
2714
- */
2715
- get(position) {}
2716
- /**
2717
- * @override
2718
- */
2719
- offset(offset) {}
2934
+ shaka.util.PlayerConfiguration = class {
2720
2935
  /**
2721
- * @override
2936
+ * @return {shaka.extern.PlayerConfiguration}
2722
2937
  */
2723
- merge(references) {}
2938
+ static createDefault() {}
2724
2939
  /**
2725
- * @override
2940
+ * Merges the given configuration changes into the given destination. This
2941
+ * uses the default Player configurations as the template.
2942
+ * @param {shaka.extern.PlayerConfiguration} destination
2943
+ * @param {!Object} updates
2944
+ * @param {shaka.extern.PlayerConfiguration=} template
2945
+ * @return {boolean}
2726
2946
  */
2727
- evict(time) {}
2947
+ static mergeConfigObjects(destination, updates, template) {}
2948
+ };
2949
+ /**
2950
+ * @implements {shaka.util.IDestroyable}
2951
+ */
2952
+ shaka.media.PreloadManager = class extends shaka.util.FakeEventTarget {
2728
2953
  /**
2729
- * @override
2954
+ * @param {string} assetUri
2955
+ * @param {?string} mimeType
2956
+ * @param {number} startTimeOfLoad
2957
+ * @param {?number} startTime
2958
+ * @param {*} playerInterface
2730
2959
  */
2731
- mergeAndEvict(references, windowStart) {}
2960
+ constructor(assetUri, mimeType, startTimeOfLoad, startTime, playerInterface) {}
2732
2961
  /**
2733
- * @override
2962
+ * Waits for the loading to be finished (or to fail with an error).
2963
+ * @return {!Promise}
2734
2964
  */
2735
- fit(windowStart, windowEnd) {}
2965
+ waitForFinish() {}
2736
2966
  /**
2967
+ * Releases or stops all non-entrusted resources.
2737
2968
  * @override
2738
2969
  */
2739
- updateEvery(interval, updateCallback) {}
2970
+ destroy() {}
2740
2971
  };
2741
- /**
2742
- * @typedef {function(
2743
- * !(shaka.media.InitSegmentReference|shaka.media.SegmentReference),
2744
- * shaka.extern.Stream,
2745
- * ?function(BufferSource):!Promise=
2746
- * ):!shaka.net.NetworkingEngine.PendingRequest}
2747
- * @description
2748
- * A callback function that fetches a segment.
2749
- */
2750
- shaka.media.SegmentPrefetch.FetchDispatcher;
2751
2972
  /**
2752
2973
  * A text displayer plugin using the browser's native VTTCue interface.
2753
2974
  * @implements {shaka.extern.TextDisplayer}
@@ -2758,6 +2979,10 @@ shaka.text.SimpleTextDisplayer = class {
2758
2979
  * @param {string} label
2759
2980
  */
2760
2981
  constructor(video, label) {}
2982
+ /**
2983
+ * @override
2984
+ */
2985
+ configure(config) {}
2761
2986
  /**
2762
2987
  * @override
2763
2988
  */
@@ -2784,6 +3009,10 @@ shaka.text.SimpleTextDisplayer = class {
2784
3009
  * @implements {shaka.extern.TextDisplayer}
2785
3010
  */
2786
3011
  shaka.text.StubTextDisplayer = class {
3012
+ /**
3013
+ * @override
3014
+ */
3015
+ configure(config) {}
2787
3016
  /**
2788
3017
  * @override
2789
3018
  */
@@ -2824,8 +3053,13 @@ shaka.text.UITextDisplayer = class {
2824
3053
  * Constructor.
2825
3054
  * @param {HTMLMediaElement} video
2826
3055
  * @param {HTMLElement} videoContainer
3056
+ * @param {shaka.extern.TextDisplayerConfiguration} config
3057
+ */
3058
+ constructor(video, videoContainer, config) {}
3059
+ /**
3060
+ * @override
2827
3061
  */
2828
- constructor(video, videoContainer) {}
3062
+ configure(config) {}
2829
3063
  /**
2830
3064
  * @override
2831
3065
  */
@@ -2902,145 +3136,6 @@ shaka.util.CmsdManager = class {
2902
3136
  */
2903
3137
  getBandwidthEstimate(defaultEstimate) {}
2904
3138
  };
2905
- /** */
2906
- shaka.util.ConfigUtils = class {
2907
- /**
2908
- * @param {!Object} destination
2909
- * @param {!Object} source
2910
- * @param {!Object} template supplies default values
2911
- * @param {!Object} overrides
2912
- * Supplies override type checking. When the current path matches
2913
- * the key in this object, each sub-value must match the type in this
2914
- * object. If this contains an Object, it is used as the template.
2915
- * @param {string} path to this part of the config
2916
- * @return {boolean}
2917
- */
2918
- static mergeConfigObjects(destination, source, template, overrides, path) {}
2919
- /**
2920
- * Convert config from ('fieldName', value) format to a partial config object.
2921
- * E. g. from ('manifest.retryParameters.maxAttempts', 1) to
2922
- * { manifest: { retryParameters: { maxAttempts: 1 }}}.
2923
- * @param {string} fieldName
2924
- * @param {*} value
2925
- * @return {!Object}
2926
- */
2927
- static convertToConfigObject(fieldName, value) {}
2928
- };
2929
- /**
2930
- * @summary A set of FairPlay utility functions.
2931
- */
2932
- shaka.util.FairPlayUtils = class {
2933
- /**
2934
- * Check if FairPlay is supported.
2935
- * @return {!Promise.<boolean>}
2936
- */
2937
- static isFairPlaySupported() {}
2938
- /**
2939
- * Using the default method, extract a content ID from the init data. This is
2940
- * based on the FairPlay example documentation.
2941
- * @param {!BufferSource} initData
2942
- * @return {string}
2943
- */
2944
- static defaultGetContentId(initData) {}
2945
- /**
2946
- * Transforms the init data buffer using the given data. The format is:
2947
- * <pre>
2948
- * [4 bytes] initDataSize
2949
- * [initDataSize bytes] initData
2950
- * [4 bytes] contentIdSize
2951
- * [contentIdSize bytes] contentId
2952
- * [4 bytes] certSize
2953
- * [certSize bytes] cert
2954
- * </pre>
2955
- * @param {!BufferSource} initData
2956
- * @param {!BufferSource|string} contentId
2957
- * @param {?BufferSource} cert The server certificate; this will throw if not
2958
- * provided.
2959
- * @return {!Uint8Array}
2960
- */
2961
- static initDataTransform(initData, contentId, cert) {}
2962
- /**
2963
- * Verimatrix initDataTransform configuration.
2964
- * @param {!Uint8Array} initData
2965
- * @param {string} initDataType
2966
- * @param {?shaka.extern.DrmInfo} drmInfo
2967
- */
2968
- static verimatrixInitDataTransform(initData, initDataType, drmInfo) {}
2969
- /**
2970
- * EZDRM initDataTransform configuration.
2971
- * @param {!Uint8Array} initData
2972
- * @param {string} initDataType
2973
- * @param {?shaka.extern.DrmInfo} drmInfo
2974
- */
2975
- static ezdrmInitDataTransform(initData, initDataType, drmInfo) {}
2976
- /**
2977
- * Conax initDataTransform configuration.
2978
- * @param {!Uint8Array} initData
2979
- * @param {string} initDataType
2980
- * @param {?shaka.extern.DrmInfo} drmInfo
2981
- */
2982
- static conaxInitDataTransform(initData, initDataType, drmInfo) {}
2983
- /**
2984
- * ExpressPlay initDataTransform configuration.
2985
- * @param {!Uint8Array} initData
2986
- * @param {string} initDataType
2987
- * @param {?shaka.extern.DrmInfo} drmInfo
2988
- */
2989
- static expressplayInitDataTransform(initData, initDataType, drmInfo) {}
2990
- /**
2991
- * Verimatrix FairPlay request.
2992
- * @param {shaka.net.NetworkingEngine.RequestType} type
2993
- * @param {shaka.extern.Request} request
2994
- * @param {shaka.extern.RequestContext=} context
2995
- */
2996
- static verimatrixFairPlayRequest(type, request, context) {}
2997
- /**
2998
- * EZDRM FairPlay request.
2999
- * @param {shaka.net.NetworkingEngine.RequestType} type
3000
- * @param {shaka.extern.Request} request
3001
- * @param {shaka.extern.RequestContext=} context
3002
- */
3003
- static ezdrmFairPlayRequest(type, request, context) {}
3004
- /**
3005
- * Conax FairPlay request.
3006
- * @param {shaka.net.NetworkingEngine.RequestType} type
3007
- * @param {shaka.extern.Request} request
3008
- * @param {shaka.extern.RequestContext=} context
3009
- */
3010
- static conaxFairPlayRequest(type, request, context) {}
3011
- /**
3012
- * ExpressPlay FairPlay request.
3013
- * @param {shaka.net.NetworkingEngine.RequestType} type
3014
- * @param {shaka.extern.Request} request
3015
- * @param {shaka.extern.RequestContext=} context
3016
- */
3017
- static expressplayFairPlayRequest(type, request, context) {}
3018
- /**
3019
- * Common FairPlay response transform for some DRMs providers.
3020
- * @param {shaka.net.NetworkingEngine.RequestType} type
3021
- * @param {shaka.extern.Response} response
3022
- * @param {shaka.extern.RequestContext=} context
3023
- */
3024
- static commonFairPlayResponse(type, response, context) {}
3025
- };
3026
- /**
3027
- * @final
3028
- */
3029
- shaka.util.PlayerConfiguration = class {
3030
- /**
3031
- * @return {shaka.extern.PlayerConfiguration}
3032
- */
3033
- static createDefault() {}
3034
- /**
3035
- * Merges the given configuration changes into the given destination. This
3036
- * uses the default Player configurations as the template.
3037
- * @param {shaka.extern.PlayerConfiguration} destination
3038
- * @param {!Object} updates
3039
- * @param {shaka.extern.PlayerConfiguration=} template
3040
- * @return {boolean}
3041
- */
3042
- static mergeConfigObjects(destination, updates, template) {}
3043
- };
3044
3139
  /**
3045
3140
  * @summary The main player object for Shaka Player.
3046
3141
  * @implements {shaka.util.IDestroyable}
@@ -3133,7 +3228,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3133
3228
  /**
3134
3229
  * Loads a new stream.
3135
3230
  * If another stream was already playing, first unloads that stream.
3136
- * @param {string} assetUri
3231
+ * @param {string|shaka.media.PreloadManager} assetUriOrPreloader
3137
3232
  * @param {?number=} startTime
3138
3233
  * When <code>startTime</code> is <code>null</code> or
3139
3234
  * <code>undefined</code>, playback will start at the default start time (0
@@ -3141,7 +3236,39 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3141
3236
  * @param {?string=} mimeType
3142
3237
  * @return {!Promise}
3143
3238
  */
3144
- load(assetUri, startTime, mimeType) {}
3239
+ load(assetUriOrPreloader, startTime, mimeType) {}
3240
+ /**
3241
+ * Unloads the currently playing stream, if any, and returns a PreloadManager
3242
+ * that contains the loaded manifest of that asset, if any.
3243
+ * Allows for the asset to be re-loaded by this player faster, in the future.
3244
+ * When in src= mode, this unloads but does not make a PreloadManager.
3245
+ * @param {boolean=} initializeMediaSource
3246
+ * @param {boolean=} keepAdManager
3247
+ * @return {!Promise.<?shaka.media.PreloadManager>}
3248
+ */
3249
+ unloadAndSavePreload(initializeMediaSource, keepAdManager) {}
3250
+ /**
3251
+ * Starts to preload a given asset, and returns a PreloadManager object that
3252
+ * represents that preloading process.
3253
+ * The PreloadManager will load the manifest for that asset, as well as the
3254
+ * initialization segment. It will not preload anything more than that;
3255
+ * this feature is intended for reducing start-time latency, not for fully
3256
+ * downloading assets before playing them (for that, use
3257
+ * |shaka.offline.Storage|).
3258
+ * You can pass that PreloadManager object in to the |load| method on this
3259
+ * Player instance to finish loading that particular asset, or you can call
3260
+ * the |destroy| method on the manager if the preload is no longer necessary.
3261
+ * If this returns null rather than a PreloadManager, that indicates that the
3262
+ * asset must be played with src=, which cannot be preloaded.
3263
+ * @param {string} assetUri
3264
+ * @param {?number=} startTime
3265
+ * When <code>startTime</code> is <code>null</code> or
3266
+ * <code>undefined</code>, playback will start at the default start time (0
3267
+ * for VOD and liveEdge for LIVE).
3268
+ * @param {?string=} mimeType
3269
+ * @return {!Promise.<?shaka.media.PreloadManager>}
3270
+ */
3271
+ preload(assetUri, startTime, mimeType) {}
3145
3272
  /**
3146
3273
  * Releases all of the mutexes of the player. Meant for use by the tests.
3147
3274
  */
@@ -3472,19 +3599,22 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3472
3599
  */
3473
3600
  setTextTrackVisibility(isVisible) {}
3474
3601
  /**
3475
- * Get the current playhead position as a date. This should only be called
3476
- * when the player has loaded a live stream. If the player has not loaded a
3477
- * live stream, this will return <code>null</code>.
3602
+ * Get the current playhead position as a date.
3478
3603
  * @return {Date}
3479
3604
  */
3480
3605
  getPlayheadTimeAsDate() {}
3481
3606
  /**
3482
- * Get the presentation start time as a date. This should only be called when
3483
- * the player has loaded a live stream. If the player has not loaded a live
3484
- * stream, this will return <code>null</code>.
3607
+ * Get the presentation start time as a date.
3485
3608
  * @return {Date}
3486
3609
  */
3487
3610
  getPresentationStartTimeAsDate() {}
3611
+ /**
3612
+ * Get the presentation segment availability duration. This should only be
3613
+ * called when the player has loaded a live stream. If the player has not
3614
+ * loaded a live stream, this will return <code>null</code>.
3615
+ * @return {?number}
3616
+ */
3617
+ getSegmentAvailabilityDuration() {}
3488
3618
  /**
3489
3619
  * Get information about what the player has buffered. If the player has not
3490
3620
  * loaded content or is currently loading content, the buffered content will
@@ -3536,8 +3666,6 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3536
3666
  addChaptersTrack(uri, language, mimeType) {}
3537
3667
  /**
3538
3668
  * Set the maximum resolution that the platform's hardware can handle.
3539
- * This will be called automatically by <code>shaka.cast.CastReceiver</code>
3540
- * to enforce limitations of the Chromecast hardware.
3541
3669
  * @param {number} width
3542
3670
  * @param {number} height
3543
3671
  */
@@ -4041,6 +4169,11 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
4041
4169
  * @override
4042
4170
  */
4043
4171
  requestMediaTailorStream(url, adsParams, backupUrl) {}
4172
+ /**
4173
+ * @param {string} url
4174
+ * @override
4175
+ */
4176
+ addMediaTailorTrackingUrl(url) {}
4044
4177
  /**
4045
4178
  * @override
4046
4179
  */
@@ -4446,6 +4579,16 @@ shaka.util.PeriodCombiner = class {
4446
4579
  * @return {!Promise}
4447
4580
  */
4448
4581
  combinePeriods(periods, isDynamic) {}
4582
+ /**
4583
+ * @param {boolean} allowed If set to true, multi-mimeType or multi-codec
4584
+ * variants will be allowed.
4585
+ */
4586
+ setAllowMultiTypeVariants(allowed) {}
4587
+ /**
4588
+ * @param {boolean} useOnce if true, stream will be used only once in period
4589
+ * flattening algoritnm.
4590
+ */
4591
+ setUseStreamOnce(useOnce) {}
4449
4592
  };
4450
4593
  /**
4451
4594
  * Creates a new DASH parser.