shaka-player 4.5.0 → 4.6.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 (214) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  2. package/AUTHORS +2 -0
  3. package/CHANGELOG.md +109 -0
  4. package/CODE_OF_CONDUCT.md +1 -1
  5. package/CONTRIBUTORS +2 -0
  6. package/README.md +38 -32
  7. package/demo/common/asset.js +11 -17
  8. package/demo/common/assets.js +117 -11
  9. package/demo/config.js +28 -1
  10. package/demo/custom.js +52 -38
  11. package/demo/main.js +11 -3
  12. package/demo/search.js +7 -0
  13. package/dist/controls.css +1 -1
  14. package/dist/controls.css.map +1 -1
  15. package/dist/demo.compiled.debug.js +133 -124
  16. package/dist/demo.compiled.debug.map +3 -3
  17. package/dist/demo.compiled.js +133 -124
  18. package/dist/demo.compiled.map +3 -3
  19. package/dist/deps.js +20 -18
  20. package/dist/locales.js +34 -30
  21. package/dist/receiver.compiled.debug.js +58 -50
  22. package/dist/receiver.compiled.debug.map +3 -3
  23. package/dist/receiver.compiled.js +58 -50
  24. package/dist/receiver.compiled.map +3 -3
  25. package/dist/shaka-player.compiled.d.ts +440 -390
  26. package/dist/shaka-player.compiled.debug.d.ts +440 -390
  27. package/dist/shaka-player.compiled.debug.externs.js +162 -77
  28. package/dist/shaka-player.compiled.debug.js +789 -738
  29. package/dist/shaka-player.compiled.debug.map +4 -4
  30. package/dist/shaka-player.compiled.externs.js +162 -77
  31. package/dist/shaka-player.compiled.js +1147 -1113
  32. package/dist/shaka-player.compiled.map +4 -4
  33. package/dist/shaka-player.ui.d.ts +491 -437
  34. package/dist/shaka-player.ui.debug.d.ts +491 -437
  35. package/dist/shaka-player.ui.debug.externs.js +167 -77
  36. package/dist/shaka-player.ui.debug.js +857 -791
  37. package/dist/shaka-player.ui.debug.map +4 -4
  38. package/dist/shaka-player.ui.externs.js +167 -77
  39. package/dist/shaka-player.ui.js +1359 -1314
  40. package/dist/shaka-player.ui.map +4 -4
  41. package/docs/tutorials/ad_monetization.md +54 -0
  42. package/docs/tutorials/basic-usage.md +2 -1
  43. package/docs/tutorials/errors.md +2 -1
  44. package/docs/tutorials/offline.md +10 -8
  45. package/docs/tutorials/plugins.md +5 -0
  46. package/docs/tutorials/ui-customization.md +13 -0
  47. package/docs/tutorials/ui.md +2 -1
  48. package/docs/tutorials/upgrade.md +3 -0
  49. package/externs/managedmediasource.js +24 -0
  50. package/externs/shaka/abr_manager.js +6 -2
  51. package/externs/shaka/cea.js +7 -0
  52. package/externs/shaka/codecs.js +5 -3
  53. package/externs/shaka/manifest.js +21 -5
  54. package/externs/shaka/manifest_parser.js +17 -0
  55. package/externs/shaka/net.js +2 -2
  56. package/externs/shaka/offline.js +9 -2
  57. package/externs/shaka/player.js +53 -7
  58. package/externs/shaka/text.js +3 -1
  59. package/externs/shaka/transmuxer.js +1 -1
  60. package/lib/abr/simple_abr_manager.js +25 -8
  61. package/lib/ads/media_tailor_ad_manager.js +14 -3
  62. package/lib/cast/cast_receiver.js +1 -1
  63. package/lib/cea/cea_decoder.js +28 -0
  64. package/lib/cea/dummy_caption_decoder.js +5 -0
  65. package/lib/dash/dash_parser.js +251 -84
  66. package/lib/dash/mpd_utils.js +52 -31
  67. package/lib/dash/segment_base.js +4 -5
  68. package/lib/dash/segment_list.js +5 -4
  69. package/lib/dash/segment_template.js +92 -29
  70. package/lib/hls/hls_classes.js +28 -43
  71. package/lib/hls/hls_parser.js +770 -652
  72. package/lib/hls/hls_utils.js +64 -5
  73. package/lib/hls/manifest_text_parser.js +7 -11
  74. package/lib/media/adaptation_set.js +20 -13
  75. package/lib/media/adaptation_set_criteria.js +70 -18
  76. package/lib/media/closed_caption_parser.js +13 -0
  77. package/lib/media/content_workarounds.js +6 -0
  78. package/lib/media/drm_engine.js +8 -13
  79. package/lib/media/manifest_parser.js +8 -113
  80. package/lib/media/media_source_capabilities.js +10 -3
  81. package/lib/media/media_source_engine.js +75 -21
  82. package/lib/media/play_rate_controller.js +8 -38
  83. package/lib/media/presentation_timeline.js +7 -1
  84. package/lib/media/quality_observer.js +1 -1
  85. package/lib/media/segment_index.js +5 -5
  86. package/lib/media/segment_prefetch.js +92 -24
  87. package/lib/media/segment_reference.js +67 -1
  88. package/lib/media/segment_utils.js +343 -0
  89. package/lib/media/stall_detector.js +0 -3
  90. package/lib/media/streaming_engine.js +72 -44
  91. package/lib/mss/mss_parser.js +18 -2
  92. package/lib/net/networking_engine.js +66 -12
  93. package/lib/net/networking_utils.js +95 -0
  94. package/lib/offline/indexeddb/v1_storage_cell.js +2 -0
  95. package/lib/offline/indexeddb/v2_storage_cell.js +2 -0
  96. package/lib/offline/manifest_converter.js +2 -0
  97. package/lib/offline/offline_manifest_parser.js +10 -0
  98. package/lib/offline/storage.js +11 -7
  99. package/lib/player.js +998 -1503
  100. package/lib/polyfill/mediasource.js +22 -1
  101. package/lib/text/mp4_ttml_parser.js +2 -2
  102. package/lib/text/srt_text_parser.js +2 -2
  103. package/lib/text/stub_text_displayer.js +51 -0
  104. package/lib/text/text_engine.js +3 -2
  105. package/lib/text/ttml_text_parser.js +28 -5
  106. package/lib/text/ui_text_displayer.js +4 -0
  107. package/lib/text/vtt_text_parser.js +7 -2
  108. package/lib/transmuxer/aac_transmuxer.js +1 -1
  109. package/lib/transmuxer/ac3_transmuxer.js +1 -1
  110. package/lib/transmuxer/ec3_transmuxer.js +1 -1
  111. package/lib/transmuxer/h264.js +5 -4
  112. package/lib/transmuxer/h265.js +5 -4
  113. package/lib/transmuxer/mp3_transmuxer.js +1 -1
  114. package/lib/transmuxer/mpeg_ts_transmuxer.js +1 -1
  115. package/lib/transmuxer/mss_transmuxer.js +1 -1
  116. package/lib/transmuxer/ts_transmuxer.js +33 -13
  117. package/lib/util/buffer_utils.js +26 -4
  118. package/lib/util/content_steering_manager.js +358 -0
  119. package/lib/util/error.js +2 -6
  120. package/lib/util/fairplay_utils.js +1 -1
  121. package/lib/util/fake_event.js +5 -1
  122. package/lib/util/id3_utils.js +50 -1
  123. package/lib/util/manifest_parser_utils.js +12 -8
  124. package/lib/util/mp4_generator.js +2 -4
  125. package/lib/util/mutex.js +59 -0
  126. package/lib/util/object_utils.js +1 -1
  127. package/lib/util/periods.js +154 -179
  128. package/lib/util/platform.js +4 -3
  129. package/lib/util/player_configuration.js +35 -6
  130. package/lib/util/stream_utils.js +105 -98
  131. package/lib/util/ts_parser.js +124 -73
  132. package/lib/util/uint8array_utils.js +5 -1
  133. package/lib/util/xml_utils.js +5 -0
  134. package/maintained-branches.md +2 -2
  135. package/package.json +1 -1
  136. package/roadmap.md +15 -5
  137. package/shaka-player.uncompiled.js +0 -1
  138. package/test/abr/simple_abr_manager_unit.js +33 -33
  139. package/test/ads/ad_manager_unit.js +3 -2
  140. package/test/cast/cast_receiver_integration.js +3 -4
  141. package/test/cast/cast_utils_unit.js +2 -0
  142. package/test/cea/cea_decoder_unit.js +7 -0
  143. package/test/codec_switching/codec_switching_integration.js +2 -1
  144. package/test/dash/dash_parser_integration.js +2 -1
  145. package/test/dash/dash_parser_live_unit.js +0 -19
  146. package/test/dash/dash_parser_manifest_unit.js +494 -2
  147. package/test/dash/mpd_utils_unit.js +61 -30
  148. package/test/hls/hls_live_unit.js +12 -3
  149. package/test/hls/hls_parser_unit.js +417 -27
  150. package/test/hls/manifest_text_parser_unit.js +32 -99
  151. package/test/media/adaptation_set_criteria_unit.js +172 -21
  152. package/test/media/adaptation_set_unit.js +1 -0
  153. package/test/media/content_workarounds_unit.js +1 -1
  154. package/test/media/drm_engine_unit.js +3 -3
  155. package/test/media/media_source_engine_unit.js +1 -1
  156. package/test/media/play_rate_controller_unit.js +0 -48
  157. package/test/media/segment_index_unit.js +2 -1
  158. package/test/mss/mss_player_integration.js +3 -2
  159. package/test/net/networking_engine_unit.js +3 -3
  160. package/test/{media/manifest_parser_unit.js → net/networking_utils_unit.js} +2 -2
  161. package/test/offline/manifest_convert_unit.js +9 -0
  162. package/test/offline/offline_integration.js +2 -1
  163. package/test/offline/storage_integration.js +21 -9
  164. package/test/player_external.js +4 -2
  165. package/test/player_integration.js +15 -4
  166. package/test/player_load_graph_integration.js +47 -151
  167. package/test/player_src_equals_external.js +1 -0
  168. package/test/player_src_equals_integration.js +71 -4
  169. package/test/player_unit.js +80 -27
  170. package/test/test/util/fake_media_source_engine.js +5 -0
  171. package/test/test/util/fake_networking_engine.js +9 -1
  172. package/test/test/util/fake_segment_prefetch.js +3 -0
  173. package/test/test/util/manifest_generator.js +4 -0
  174. package/test/test/util/manifest_parser_util.js +14 -2
  175. package/test/test/util/offline_utils.js +1 -0
  176. package/test/test/util/simple_fakes.js +2 -2
  177. package/test/test/util/streaming_engine_util.js +3 -0
  178. package/test/test/util/test_scheme.js +6 -0
  179. package/test/test/util/ui_utils.js +4 -3
  180. package/test/text/mp4_ttml_parser_unit.js +4 -4
  181. package/test/text/srt_text_parser_unit.js +1 -1
  182. package/test/text/text_displayer_layout_unit.js +1 -1
  183. package/test/text/text_engine_unit.js +6 -0
  184. package/test/text/ttml_text_parser_unit.js +33 -2
  185. package/test/transmuxer/transmuxer_engine_integration.js +9 -0
  186. package/test/transmuxer/transmuxer_integration.js +33 -3
  187. package/test/ui/ad_ui_unit.js +2 -2
  188. package/test/ui/ui_customization_unit.js +17 -16
  189. package/test/ui/ui_integration.js +30 -20
  190. package/test/ui/ui_unit.js +25 -19
  191. package/test/util/buffer_utils_unit.js +1 -1
  192. package/test/util/content_steering_manager_unit.js +427 -0
  193. package/test/util/id3_utils_unit.js +52 -0
  194. package/test/util/stream_utils_unit.js +17 -113
  195. package/test/util/ts_parser_unit.js +3 -3
  196. package/third_party/closure-uri/uri.js +13 -1
  197. package/ui/audio_language_selection.js +9 -2
  198. package/ui/externs/ui.js +17 -2
  199. package/ui/language_utils.js +43 -8
  200. package/ui/less/range_elements.less +33 -0
  201. package/ui/locales/en.json +1 -0
  202. package/ui/locales/es-419.json +1 -0
  203. package/ui/locales/es.json +1 -0
  204. package/ui/locales/source.json +4 -0
  205. package/ui/localization.js +10 -0
  206. package/ui/remote_button.js +3 -1
  207. package/ui/resolution_selection.js +47 -10
  208. package/ui/seek_bar.js +296 -3
  209. package/ui/text_selection.js +2 -1
  210. package/ui/ui.js +6 -2
  211. package/lib/routing/node.js +0 -23
  212. package/lib/routing/payload.js +0 -47
  213. package/lib/routing/walker.js +0 -587
  214. package/test/routing/walker_unit.js +0 -505
@@ -225,7 +225,6 @@ shaka.util.Error.Code = {
225
225
  'TEXT_ONLY_WEBVTT_SRC_EQUALS': 2013,
226
226
  'MISSING_TEXT_PLUGIN': 2014,
227
227
  'CHAPTERS_TRACK_FAILED': 2015,
228
- 'CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_SRC_EQUALS': 2016,
229
228
  'UNSUPPORTED_EXTERNAL_THUMBNAILS_URI': 2017,
230
229
  'BUFFER_READ_OUT_OF_BOUNDS': 3000,
231
230
  'JS_INTEGER_OVERFLOW': 3001,
@@ -548,6 +547,11 @@ shaka.ui.Localization = class extends shaka.util.FakeEventTarget {
548
547
  * @return {string}
549
548
  */
550
549
  resolve(id) {}
550
+ /**
551
+ * The locales currently used. An empty set means "no preference".
552
+ * @return {!Set.<string>}
553
+ */
554
+ getCurrentLocales() {}
551
555
  };
552
556
  /**
553
557
  * An enum for how the localization system should resolve conflicts between old
@@ -590,13 +594,6 @@ shaka.ui.Localization.LOCALE_CHANGED;
590
594
  * @const {string}
591
595
  */
592
596
  shaka.ui.Localization.LOCALE_UPDATED;
593
- /**
594
- * @enum {string}
595
- */
596
- shaka.config.CodecSwitchingStrategy = {
597
- RELOAD: 'reload',
598
- SMOOTH: 'smooth'
599
- };
600
597
  /**
601
598
  * @summary A set of BufferSource utility functions.
602
599
  */
@@ -630,6 +627,18 @@ shaka.util.BufferUtils = class {
630
627
  * @return {!Uint8Array}
631
628
  */
632
629
  static toUint8(data, offset, length) {}
630
+ /**
631
+ * Creates a new Uint16Array view on the same buffer. This clamps the values
632
+ * to be within the same view (i.e. you can't use this to move past the end
633
+ * of the view, even if the underlying buffer is larger). However, you can
634
+ * pass a negative offset to access the data before the view.
635
+ * @param {BufferSource} data
636
+ * @param {number=} offset The offset from the beginning of this data's view
637
+ * to start the new view at.
638
+ * @param {number=} length The byte length of the new view.
639
+ * @return {!Uint16Array}
640
+ */
641
+ static toUint16(data, offset, length) {}
633
642
  /**
634
643
  * Creates a DataView over the given buffer.
635
644
  * @see toUint8
@@ -1312,9 +1321,11 @@ shaka.abr.SimpleAbrManager = class {
1312
1321
  */
1313
1322
  init(switchCallback) {}
1314
1323
  /**
1324
+ * @param {boolean=} preferFastSwitching
1325
+ * @return {shaka.extern.Variant}
1315
1326
  * @override
1316
1327
  */
1317
- chooseVariant() {}
1328
+ chooseVariant(preferFastSwitching) {}
1318
1329
  /**
1319
1330
  * @override
1320
1331
  */
@@ -1326,7 +1337,7 @@ shaka.abr.SimpleAbrManager = class {
1326
1337
  /**
1327
1338
  * @override
1328
1339
  */
1329
- segmentDownloaded(deltaTimeMs, numBytes) {}
1340
+ segmentDownloaded(deltaTimeMs, numBytes, allowSwitch) {}
1330
1341
  /**
1331
1342
  * @override
1332
1343
  */
@@ -1357,6 +1368,13 @@ shaka.config.AutoShowText = {
1357
1368
  'IF_PREFERRED_TEXT_LANGUAGE': 2,
1358
1369
  'IF_SUBTITLES_MAY_BE_NEEDED': 3
1359
1370
  };
1371
+ /**
1372
+ * @enum {string}
1373
+ */
1374
+ shaka.config.CodecSwitchingStrategy = {
1375
+ RELOAD: 'reload',
1376
+ SMOOTH: 'smooth'
1377
+ };
1360
1378
  /**
1361
1379
  * A utility to wrap abortable operations. Note that these are not cancelable.
1362
1380
  * Cancelation implies undoing what has been done so far, whereas aborting only
@@ -1451,17 +1469,20 @@ shaka.util.AbortableOperation.prototype.promise;
1451
1469
  */
1452
1470
  shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1453
1471
  /**
1454
- * @param {function(number, number)=} onProgressUpdated Called when a progress
1455
- * event is triggered. Passed the duration, in milliseconds, that the
1456
- * request took, and the number of bytes transferred.
1472
+ * @param {function(number, number, boolean)=} onProgressUpdated Called when
1473
+ * a progress event is triggered. Passed the duration, in milliseconds,
1474
+ * that the request took, the number of bytes transferred, and the boolean
1475
+ * of whether the switching is allowed.
1457
1476
  * @param {shaka.net.NetworkingEngine.OnHeadersReceived=} onHeadersReceived
1458
1477
  * Called when the headers are received for a download.
1459
1478
  * @param {shaka.net.NetworkingEngine.OnDownloadFailed=} onDownloadFailed
1460
1479
  * Called when a download fails, for any reason.
1461
1480
  * @param {shaka.net.NetworkingEngine.OnRequest=} onRequest
1462
1481
  * Called when a request is made
1482
+ * @param {shaka.net.NetworkingEngine.OnRetry=} onRetry
1483
+ * Called when a request retry is made
1463
1484
  */
1464
- constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest) {}
1485
+ constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest, onRetry) {}
1465
1486
  /**
1466
1487
  * @param {boolean} forceHTTPS
1467
1488
  */
@@ -1590,7 +1611,8 @@ shaka.net.NetworkingEngine.RequestType = {
1590
1611
  'TIMING': 4,
1591
1612
  'SERVER_CERTIFICATE': 5,
1592
1613
  'KEY': 6,
1593
- 'ADS': 7
1614
+ 'ADS': 7,
1615
+ 'CONTENT_STEERING': 8
1594
1616
  };
1595
1617
  /**
1596
1618
  * A more advanced form of the RequestType structure, meant to describe
@@ -1649,6 +1671,17 @@ shaka.net.NetworkingEngine.OnDownloadFailed;
1649
1671
  * A callback function called on every request
1650
1672
  */
1651
1673
  shaka.net.NetworkingEngine.OnRequest;
1674
+ /**
1675
+ * @typedef {function(
1676
+ * !shaka.net.NetworkingEngine.RequestType,
1677
+ * (shaka.extern.RequestContext|undefined),
1678
+ * string,
1679
+ * string)}
1680
+ * @description
1681
+ * A callback function called on every request retry. The first string is the
1682
+ * new URI and the second string is the old URI.
1683
+ */
1684
+ shaka.net.NetworkingEngine.OnRetry;
1652
1685
  /**
1653
1686
  * @summary
1654
1687
  * An EventManager maintains a collection of "event
@@ -2100,8 +2133,10 @@ shaka.media.SegmentReference = class {
2100
2133
  * not available.
2101
2134
  * @param {?shaka.extern.aes128Key=} aes128Key
2102
2135
  * The segment's AES-128-CBC full segment encryption key and iv.
2136
+ * @param {boolean=} allPartialSegments
2137
+ * Indicate if the segment has all partial segments
2103
2138
  */
2104
- constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aes128Key) {}
2139
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aes128Key, allPartialSegments) {}
2105
2140
  /**
2106
2141
  * Creates and returns the URIs of the resource containing the segment.
2107
2142
  * @return {!Array.<string>}
@@ -2168,6 +2203,24 @@ shaka.media.SegmentReference = class {
2168
2203
  * @return {boolean}
2169
2204
  */
2170
2205
  isIndependent() {}
2206
+ /**
2207
+ * Mark the reference as partial.
2208
+ */
2209
+ markAsPartial() {}
2210
+ /**
2211
+ * Returns true if the segment is partial.
2212
+ * @return {boolean}
2213
+ */
2214
+ isPartial() {}
2215
+ /**
2216
+ * Mark the reference as being the last part of the full segment
2217
+ */
2218
+ markAsLastPartial() {}
2219
+ /**
2220
+ * Returns true if reference as being the last part of the full segment.
2221
+ * @return {boolean}
2222
+ */
2223
+ isLastPartial() {}
2171
2224
  /**
2172
2225
  * Mark the reference as byterange optimization.
2173
2226
  * The "byterange optimization" means that it is playable using MP4 low
@@ -2291,11 +2344,10 @@ shaka.util.TsParser = class {
2291
2344
  * The code is based on hls.js
2292
2345
  * Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
2293
2346
  * @param {shaka.extern.MPEG_PES} pes
2294
- * @param {?shaka.extern.MPEG_PES=} nextPes
2295
2347
  * @param {?shaka.extern.VideoNalu=} lastNalu
2296
2348
  * @return {!Array.<shaka.extern.VideoNalu>}
2297
2349
  */
2298
- parseNalus(pes, nextPes, lastNalu) {}
2350
+ parseNalus(pes, lastNalu) {}
2299
2351
  /**
2300
2352
  * Return the ID3 metadata
2301
2353
  * @return {!Array.<shaka.extern.ID3Metadata>}
@@ -2308,14 +2360,16 @@ shaka.util.TsParser = class {
2308
2360
  getAudioData() {}
2309
2361
  /**
2310
2362
  * Return the audio data
2363
+ * @param {boolean=} naluProcessing
2311
2364
  * @return {!Array.<shaka.extern.MPEG_PES>}
2312
2365
  */
2313
- getVideoData() {}
2366
+ getVideoData(naluProcessing) {}
2314
2367
  /**
2315
2368
  * Return the start time for the audio and video
2316
- * @return {{audio: ?number, video: ?number}}
2369
+ * @param {string} contentType
2370
+ * @return {?number}
2317
2371
  */
2318
- getStartTime() {}
2372
+ getStartTime(contentType) {}
2319
2373
  /**
2320
2374
  * Return the audio and video codecs
2321
2375
  * @return {{audio: ?string, video: ?string}}
@@ -2567,7 +2621,9 @@ shaka.media.PresentationTimeline = class {
2567
2621
  * @typedef {{
2568
2622
  * start: number,
2569
2623
  * unscaledStart: number,
2570
- * end: number
2624
+ * end: number,
2625
+ * partialSegments: number,
2626
+ * segmentPosition: number
2571
2627
  * }}
2572
2628
  * @description
2573
2629
  * Defines a time range of a media segment. Times are in seconds.
@@ -2577,6 +2633,10 @@ shaka.media.PresentationTimeline = class {
2577
2633
  * The start time of the range in representation timescale units.
2578
2634
  * @property {number} end
2579
2635
  * The end time (exclusive) of the range.
2636
+ * @property {number} partialSegments
2637
+ * The number of partial segments
2638
+ * @property {number} segmentPosition
2639
+ * The segment position of the timeline entry as it appears in the manifest
2580
2640
  */
2581
2641
  shaka.media.PresentationTimeline.TimeRange;
2582
2642
  /**
@@ -2796,6 +2856,32 @@ shaka.text.SimpleTextDisplayer = class {
2796
2856
  */
2797
2857
  setTextVisibility(on) {}
2798
2858
  };
2859
+ /**
2860
+ * A stub text displayer plugin that does nothing
2861
+ * @implements {shaka.extern.TextDisplayer}
2862
+ */
2863
+ shaka.text.StubTextDisplayer = class {
2864
+ /**
2865
+ * @override
2866
+ */
2867
+ remove(start, end) {}
2868
+ /**
2869
+ * @override
2870
+ */
2871
+ append(cues) {}
2872
+ /**
2873
+ * @override
2874
+ */
2875
+ destroy() {}
2876
+ /**
2877
+ * @override
2878
+ */
2879
+ isTextVisible() {}
2880
+ /**
2881
+ * @override
2882
+ */
2883
+ setTextVisibility(on) {}
2884
+ };
2799
2885
  /** */
2800
2886
  shaka.util.Dom = class {
2801
2887
  /**
@@ -3043,16 +3129,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3043
3129
  */
3044
3130
  static probeSupport(promptsOkay) {}
3045
3131
  /**
3046
- * Tell the player to use <code>mediaElement</code> for all <code>load</code>
3047
- * requests until <code>detach</code> or <code>destroy</code> are called.
3048
- * <p>
3049
- * Calling <code>attach</code> with <code>initializedMediaSource=true</code>
3050
- * will tell the player to take the initial load step and initialize media
3051
- * source.
3052
- * <p>
3053
- * Calls to <code>attach</code> will interrupt any in-progress calls to
3054
- * <code>load</code> but cannot interrupt calls to <code>attach</code>,
3055
- * <code>detach</code>, or <code>unload</code>.
3132
+ * Attaches the player to a media element.
3133
+ * If the player was already attached to a media element, first detaches from
3134
+ * that media element.
3056
3135
  * @param {!HTMLMediaElement} mediaElement
3057
3136
  * @param {boolean=} initializeMediaSource
3058
3137
  * @return {!Promise}
@@ -3065,35 +3144,15 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3065
3144
  */
3066
3145
  attachCanvas(canvas) {}
3067
3146
  /**
3068
- * Tell the player to stop using its current media element. If the player is:
3069
- * <ul>
3070
- * <li>detached, this will do nothing,
3071
- * <li>attached, this will release the media element,
3072
- * <li>loading, this will abort loading, unload, and release the media
3073
- * element,
3074
- * <li>playing content, this will stop playback, unload, and release the
3075
- * media element.
3076
- * </ul>
3077
- * <p>
3078
- * Calls to <code>detach</code> will interrupt any in-progress calls to
3079
- * <code>load</code> but cannot interrupt calls to <code>attach</code>,
3080
- * <code>detach</code>, or <code>unload</code>.
3147
+ * Detach the player from the current media element. Leaves the player in a
3148
+ * state where it cannot play media, until it has been attached to something
3149
+ * else.
3150
+ * @param {boolean=} keepAdManager
3081
3151
  * @return {!Promise}
3082
3152
  */
3083
- detach() {}
3153
+ detach(keepAdManager) {}
3084
3154
  /**
3085
- * Tell the player to either return to:
3086
- * <ul>
3087
- * <li>detached (when it does not have a media element),
3088
- * <li>attached (when it has a media element and
3089
- * <code>initializedMediaSource=false</code>)
3090
- * <li>media source initialized (when it has a media element and
3091
- * <code>initializedMediaSource=true</code>)
3092
- * </ul>
3093
- * <p>
3094
- * Calls to <code>unload</code> will interrupt any in-progress calls to
3095
- * <code>load</code> but cannot interrupt calls to <code>attach</code>,
3096
- * <code>detach</code>, or <code>unload</code>.
3155
+ * Unloads the currently playing stream, if any.
3097
3156
  * @param {boolean=} initializeMediaSource
3098
3157
  * @param {boolean=} keepAdManager
3099
3158
  * @return {!Promise}
@@ -3108,22 +3167,21 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3108
3167
  */
3109
3168
  updateStartTime(startTime) {}
3110
3169
  /**
3111
- * Tell the player to load the content at <code>assetUri</code> and start
3112
- * playback at <code>startTime</code>. Before calling <code>load</code>,
3113
- * a call to <code>attach</code> must have succeeded.
3114
- * <p>
3115
- * Calls to <code>load</code> will interrupt any in-progress calls to
3116
- * <code>load</code> but cannot interrupt calls to <code>attach</code>,
3117
- * <code>detach</code>, or <code>unload</code>.
3170
+ * Loads a new stream.
3171
+ * If another stream was already playing, first unloads that stream.
3118
3172
  * @param {string} assetUri
3119
3173
  * @param {?number=} startTime
3120
3174
  * When <code>startTime</code> is <code>null</code> or
3121
3175
  * <code>undefined</code>, playback will start at the default start time (0
3122
3176
  * for VOD and liveEdge for LIVE).
3123
- * @param {string=} mimeType
3177
+ * @param {?string=} mimeType
3124
3178
  * @return {!Promise}
3125
3179
  */
3126
3180
  load(assetUri, startTime, mimeType) {}
3181
+ /**
3182
+ * Releases all of the mutexes of the player. Meant for use by the tests.
3183
+ */
3184
+ releaseAllMutexes() {}
3127
3185
  /**
3128
3186
  * Changes configuration settings on the Player. This checks the names of
3129
3187
  * keys and the types of values to avoid coding errors. If there are errors,
@@ -3222,7 +3280,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3222
3280
  isAudioOnly() {}
3223
3281
  /**
3224
3282
  * Get the range of time (in seconds) that seeking is allowed. If the player
3225
- * has not loaded content, this will return a range from 0 to 0.
3283
+ * has not loaded content and the manifest is HLS, this will return a range
3284
+ * from 0 to 0.
3226
3285
  * @return {{start: number, end: number}}
3227
3286
  */
3228
3287
  seekRange() {}
@@ -3320,6 +3379,13 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3320
3379
  * @return {!Array.<shaka.extern.Track>}
3321
3380
  */
3322
3381
  getImageTracks() {}
3382
+ /**
3383
+ * Returns Thumbnail objects for each thumbnail for a given image track ID.
3384
+ * If the player has not loaded content, this will return a null.
3385
+ * @param {number} trackId
3386
+ * @return {!Promise.<?Array<!shaka.extern.Thumbnail>>}
3387
+ */
3388
+ getAllThumbnails(trackId) {}
3323
3389
  /**
3324
3390
  * Return a Thumbnail object from a image track Id and time.
3325
3391
  * If the player has not loaded content, this will return a null.
@@ -4444,6 +4510,14 @@ shaka.dash.DashParser = class {
4444
4510
  * @override
4445
4511
  */
4446
4512
  onExpirationUpdated(sessionId, expiration) {}
4513
+ /**
4514
+ * @override
4515
+ */
4516
+ onInitialVariantChosen(variant) {}
4517
+ /**
4518
+ * @override
4519
+ */
4520
+ banLocation(uri) {}
4447
4521
  };
4448
4522
  /**
4449
4523
  */
@@ -4513,6 +4587,14 @@ shaka.hls.HlsParser = class {
4513
4587
  * @override
4514
4588
  */
4515
4589
  onExpirationUpdated(sessionId, expiration) {}
4590
+ /**
4591
+ * @override
4592
+ */
4593
+ onInitialVariantChosen(variant) {}
4594
+ /**
4595
+ * @override
4596
+ */
4597
+ banLocation(uri) {}
4516
4598
  };
4517
4599
  /**
4518
4600
  * Creates a new MSS parser.
@@ -4541,6 +4623,14 @@ shaka.mss.MssParser = class {
4541
4623
  * @override
4542
4624
  */
4543
4625
  onExpirationUpdated(sessionId, expiration) {}
4626
+ /**
4627
+ * @override
4628
+ */
4629
+ onInitialVariantChosen(variant) {}
4630
+ /**
4631
+ * @override
4632
+ */
4633
+ banLocation(uri) {}
4544
4634
  };
4545
4635
  /**
4546
4636
  * @summary A networking plugin to handle http and https URIs via the Fetch API.
@@ -5013,7 +5103,7 @@ shaka.text.TtmlTextParser = class {
5013
5103
  /**
5014
5104
  * @override
5015
5105
  */
5016
- parseMedia(data, time) {}
5106
+ parseMedia(data, time, uri) {}
5017
5107
  };
5018
5108
  /**
5019
5109
  * @implements {shaka.extern.TextParser}
@@ -5036,7 +5126,7 @@ shaka.text.Mp4TtmlParser = class {
5036
5126
  /**
5037
5127
  * @override
5038
5128
  */
5039
- parseMedia(data, time) {}
5129
+ parseMedia(data, time, uri) {}
5040
5130
  };
5041
5131
  /**
5042
5132
  * @implements {shaka.extern.TextParser}
@@ -5126,7 +5216,7 @@ shaka.text.SrtTextParser = class {
5126
5216
  /**
5127
5217
  * @override
5128
5218
  */
5129
- parseMedia(data, time) {}
5219
+ parseMedia(data, time, uri) {}
5130
5220
  /**
5131
5221
  * Convert a SRT format to WebVTT
5132
5222
  * @param {string} data
@@ -5184,7 +5274,7 @@ shaka.transmuxer.AacTransmuxer = class {
5184
5274
  /**
5185
5275
  * @override
5186
5276
  */
5187
- getOrginalMimeType() {}
5277
+ getOriginalMimeType() {}
5188
5278
  /**
5189
5279
  * @override
5190
5280
  */
@@ -5217,7 +5307,7 @@ shaka.transmuxer.Ac3Transmuxer = class {
5217
5307
  /**
5218
5308
  * @override
5219
5309
  */
5220
- getOrginalMimeType() {}
5310
+ getOriginalMimeType() {}
5221
5311
  /**
5222
5312
  * @override
5223
5313
  */
@@ -5250,7 +5340,7 @@ shaka.transmuxer.Ec3Transmuxer = class {
5250
5340
  /**
5251
5341
  * @override
5252
5342
  */
5253
- getOrginalMimeType() {}
5343
+ getOriginalMimeType() {}
5254
5344
  /**
5255
5345
  * @override
5256
5346
  */
@@ -5283,7 +5373,7 @@ shaka.transmuxer.Mp3Transmuxer = class {
5283
5373
  /**
5284
5374
  * @override
5285
5375
  */
5286
- getOrginalMimeType() {}
5376
+ getOriginalMimeType() {}
5287
5377
  /**
5288
5378
  * @override
5289
5379
  */
@@ -5316,7 +5406,7 @@ shaka.transmuxer.MpegTsTransmuxer = class {
5316
5406
  /**
5317
5407
  * @override
5318
5408
  */
5319
- getOrginalMimeType() {}
5409
+ getOriginalMimeType() {}
5320
5410
  /**
5321
5411
  * @override
5322
5412
  */
@@ -5349,7 +5439,7 @@ shaka.transmuxer.MssTransmuxer = class {
5349
5439
  /**
5350
5440
  * @override
5351
5441
  */
5352
- getOrginalMimeType() {}
5442
+ getOriginalMimeType() {}
5353
5443
  /**
5354
5444
  * @override
5355
5445
  */
@@ -5382,7 +5472,7 @@ shaka.transmuxer.TsTransmuxer = class {
5382
5472
  /**
5383
5473
  * @override
5384
5474
  */
5385
- getOrginalMimeType() {}
5475
+ getOriginalMimeType() {}
5386
5476
  /**
5387
5477
  * @override
5388
5478
  */