shaka-player 3.1.3 → 3.2.2

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 (182) hide show
  1. package/AUTHORS +3 -0
  2. package/CHANGELOG.md +175 -3
  3. package/CONTRIBUTORS +3 -0
  4. package/README.md +4 -4
  5. package/build/generateExterns.js +1 -1
  6. package/build/types/polyfill +1 -0
  7. package/demo/common/asset.js +9 -7
  8. package/demo/common/assets.js +11 -2
  9. package/demo/common/message_ids.js +2 -1
  10. package/demo/config.js +5 -2
  11. package/demo/index.html +1 -1
  12. package/demo/locales/en.json +2 -1
  13. package/demo/locales/source.json +8 -4
  14. package/demo/main.js +2 -1
  15. package/dist/controls.css +2 -2
  16. package/dist/controls.css.map +1 -1
  17. package/dist/demo.compiled.debug.js +15 -15
  18. package/dist/demo.compiled.debug.map +2 -2
  19. package/dist/demo.compiled.js +15 -15
  20. package/dist/demo.compiled.map +2 -2
  21. package/dist/deps.js +22 -21
  22. package/dist/locales.js +36 -36
  23. package/dist/receiver.compiled.debug.js +9 -9
  24. package/dist/receiver.compiled.debug.map +2 -2
  25. package/dist/receiver.compiled.js +9 -9
  26. package/dist/receiver.compiled.map +2 -2
  27. package/dist/shaka-player.compiled.d.ts +58 -10
  28. package/dist/shaka-player.compiled.debug.d.ts +58 -10
  29. package/dist/shaka-player.compiled.debug.externs.js +777 -717
  30. package/dist/shaka-player.compiled.debug.js +639 -607
  31. package/dist/shaka-player.compiled.debug.map +4 -4
  32. package/dist/shaka-player.compiled.externs.js +777 -717
  33. package/dist/shaka-player.compiled.js +826 -819
  34. package/dist/shaka-player.compiled.map +4 -4
  35. package/dist/shaka-player.ui.d.ts +58 -10
  36. package/dist/shaka-player.ui.debug.d.ts +58 -10
  37. package/dist/shaka-player.ui.debug.externs.js +529 -469
  38. package/dist/shaka-player.ui.debug.js +676 -645
  39. package/dist/shaka-player.ui.debug.map +4 -4
  40. package/dist/shaka-player.ui.externs.js +529 -469
  41. package/dist/shaka-player.ui.js +963 -955
  42. package/dist/shaka-player.ui.map +4 -4
  43. package/docs/tutorials/fairplay.md +1 -1
  44. package/docs/tutorials/ui.md +5 -5
  45. package/externs/aria.js +6 -0
  46. package/externs/shaka/ads.js +24 -1
  47. package/externs/shaka/manifest.js +6 -1
  48. package/externs/shaka/offline.js +5 -0
  49. package/externs/shaka/player.js +53 -9
  50. package/externs/shaka/text.js +10 -10
  51. package/externs/texttrack.js +3 -0
  52. package/karma.conf.js +1 -0
  53. package/lib/ads/ad_manager.js +16 -15
  54. package/lib/ads/client_side_ad_manager.js +52 -88
  55. package/lib/ads/server_side_ad_manager.js +26 -12
  56. package/lib/cast/cast_proxy.js +11 -2
  57. package/lib/cast/cast_receiver.js +2 -1
  58. package/lib/cast/cast_sender.js +2 -2
  59. package/lib/cast/cast_utils.js +6 -1
  60. package/lib/cea/cea608_data_channel.js +56 -56
  61. package/lib/cea/cea608_memory.js +33 -33
  62. package/lib/cea/cea708_service.js +43 -43
  63. package/lib/cea/cea708_window.js +38 -38
  64. package/lib/cea/cea_decoder.js +13 -14
  65. package/lib/cea/cea_utils.js +23 -23
  66. package/lib/cea/dtvcc_packet_builder.js +7 -7
  67. package/lib/cea/i_caption_decoder.js +2 -3
  68. package/lib/cea/i_cea_parser.js +2 -2
  69. package/lib/cea/mp4_cea_parser.js +6 -6
  70. package/lib/dash/dash_parser.js +98 -2
  71. package/lib/dash/segment_list.js +1 -1
  72. package/lib/dash/segment_template.js +1 -1
  73. package/lib/hls/hls_parser.js +159 -29
  74. package/lib/media/closed_caption_parser.js +1 -2
  75. package/lib/media/drm_engine.js +169 -192
  76. package/lib/media/gap_jumping_controller.js +4 -2
  77. package/lib/media/media_source_engine.js +1 -2
  78. package/lib/media/segment_index.js +3 -1
  79. package/lib/media/segment_reference.js +19 -2
  80. package/lib/media/streaming_engine.js +8 -7
  81. package/lib/net/networking_engine.js +3 -1
  82. package/lib/offline/download_manager.js +1 -2
  83. package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
  84. package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
  85. package/lib/offline/manifest_converter.js +3 -1
  86. package/lib/offline/storage.js +12 -14
  87. package/lib/player.js +437 -167
  88. package/lib/polyfill/aria.js +82 -0
  89. package/lib/polyfill/media_capabilities.js +7 -1
  90. package/lib/polyfill/mediasource.js +6 -0
  91. package/lib/polyfill/orientation.js +1 -1
  92. package/lib/polyfill/patchedmediakeys_apple.js +4 -4
  93. package/lib/polyfill/patchedmediakeys_ms.js +4 -4
  94. package/lib/polyfill/patchedmediakeys_webkit.js +4 -4
  95. package/lib/routing/walker.js +2 -3
  96. package/lib/text/mp4_ttml_parser.js +3 -0
  97. package/lib/text/srt_text_parser.js +4 -4
  98. package/lib/text/text_engine.js +16 -4
  99. package/lib/text/ttml_text_parser.js +5 -0
  100. package/lib/text/ui_text_displayer.js +85 -37
  101. package/lib/text/vtt_text_parser.js +2 -2
  102. package/lib/text/web_vtt_generator.js +55 -12
  103. package/lib/util/error.js +6 -0
  104. package/lib/util/fake_event.js +53 -7
  105. package/lib/util/manifest_parser_utils.js +1 -0
  106. package/lib/util/mp4_box_parsers.js +20 -20
  107. package/lib/util/multi_map.js +8 -0
  108. package/lib/util/periods.js +4 -1
  109. package/lib/util/platform.js +13 -1
  110. package/lib/util/player_configuration.js +13 -1
  111. package/lib/util/stream_utils.js +153 -85
  112. package/lib/util/xml_utils.js +31 -12
  113. package/package.json +1 -1
  114. package/roadmap.md +24 -22
  115. package/shaka-player.uncompiled.js +1 -0
  116. package/test/cast/cast_proxy_unit.js +12 -6
  117. package/test/cast/cast_utils_unit.js +2 -1
  118. package/test/cea/cea608_memory_unit.js +1 -1
  119. package/test/cea/cea708_service_unit.js +8 -8
  120. package/test/cea/cea708_window_unit.js +6 -6
  121. package/test/cea/cea_decoder_unit.js +1 -1
  122. package/test/cea/dtvcc_packet_builder_unit.js +2 -2
  123. package/test/dash/dash_parser_manifest_unit.js +230 -2
  124. package/test/hls/hls_parser_unit.js +255 -1
  125. package/test/media/closed_caption_parser_unit.js +6 -1
  126. package/test/media/drm_engine_integration.js +86 -12
  127. package/test/media/drm_engine_unit.js +353 -450
  128. package/test/offline/manifest_convert_unit.js +2 -0
  129. package/test/offline/storage_integration.js +9 -19
  130. package/test/player_integration.js +90 -0
  131. package/test/player_src_equals_integration.js +52 -0
  132. package/test/player_unit.js +11 -33
  133. package/test/test/assets/3675/chunk-stream0-00001.m4s +0 -0
  134. package/test/test/assets/3675/chunk-stream0-00002.m4s +0 -0
  135. package/test/test/assets/3675/chunk-stream0-00003.m4s +0 -0
  136. package/test/test/assets/3675/chunk-stream0-00004.m4s +0 -0
  137. package/test/test/assets/3675/chunk-stream0-00005.m4s +0 -0
  138. package/test/test/assets/3675/chunk-stream0-00006.m4s +0 -0
  139. package/test/test/assets/3675/chunk-stream0-00007.m4s +0 -0
  140. package/test/test/assets/3675/dash_0.mpd +30 -0
  141. package/test/test/assets/3675/dash_1.mpd +30 -0
  142. package/test/test/assets/3675/dash_2.mpd +30 -0
  143. package/test/test/assets/3675/dash_3.mpd +30 -0
  144. package/test/test/assets/3675/dash_4.mpd +30 -0
  145. package/test/test/assets/3675/dash_5.mpd +26 -0
  146. package/test/test/assets/3675/init-stream0.m4s +0 -0
  147. package/test/test/assets/chapters.srt +11 -0
  148. package/test/test/assets/chapters.vtt +10 -0
  149. package/test/test/util/cea_utils.js +12 -12
  150. package/test/test/util/fake_ad_manager.js +8 -1
  151. package/test/test/util/manifest_generator.js +2 -0
  152. package/test/test/util/manifest_parser_util.js +3 -1
  153. package/test/text/ttml_text_parser_unit.js +9 -0
  154. package/test/text/ui_text_displayer_unit.js +29 -17
  155. package/test/text/web_vtt_generator_unit.js +81 -7
  156. package/test/ui/localization_unit.js +15 -14
  157. package/test/ui/text_displayer_layout_unit.js +13 -1
  158. package/test/util/stream_utils_unit.js +153 -10
  159. package/ui/airplay_button.js +1 -1
  160. package/ui/audio_language_selection.js +2 -5
  161. package/ui/cast_button.js +6 -9
  162. package/ui/constants.js +0 -3
  163. package/ui/controls.js +4 -6
  164. package/ui/fast_forward_button.js +2 -3
  165. package/ui/fullscreen_button.js +1 -3
  166. package/ui/language_utils.js +1 -1
  167. package/ui/less/containers.less +3 -7
  168. package/ui/locales/ru.json +6 -6
  169. package/ui/localization.js +28 -51
  170. package/ui/loop_button.js +1 -3
  171. package/ui/mute_button.js +1 -3
  172. package/ui/overflow_menu.js +2 -3
  173. package/ui/pip_button.js +7 -10
  174. package/ui/playback_rate_selection.js +3 -6
  175. package/ui/presentation_time.js +1 -3
  176. package/ui/resolution_selection.js +4 -7
  177. package/ui/rewind_button.js +2 -3
  178. package/ui/seek_bar.js +2 -4
  179. package/ui/spacer.js +1 -1
  180. package/ui/text_selection.js +8 -11
  181. package/ui/ui_utils.js +1 -1
  182. package/ui/volume_bar.js +1 -3
@@ -34,553 +34,6 @@ shaka.text = {};
34
34
  /** @const */
35
35
  shaka.util = {};
36
36
 
37
- /**
38
- * @summary A set of BufferSource utility functions.
39
- */
40
- shaka.util.BufferUtils = class {
41
- /**
42
- * Compare two buffers for equality. For buffers of different types, this
43
- * compares the underlying buffers as binary data.
44
- * @param {?BufferSource} arr1
45
- * @param {?BufferSource} arr2
46
- * @return {boolean}
47
- */
48
- static equal(arr1, arr2) {}
49
- /**
50
- * Gets an ArrayBuffer that contains the data from the given TypedArray. Note
51
- * this will allocate a new ArrayBuffer if the object is a partial view of
52
- * the data.
53
- * @param {!BufferSource} view
54
- * @return {!ArrayBuffer}
55
- */
56
- static toArrayBuffer(view) {}
57
- /**
58
- * Creates a new Uint8Array view on the same buffer. This clamps the values
59
- * to be within the same view (i.e. you can't use this to move past the end
60
- * of the view, even if the underlying buffer is larger). However, you can
61
- * pass a negative offset to access the data before the view.
62
- * @param {BufferSource} data
63
- * @param {number=} offset The offset from the beginning of this data's view
64
- * to start the new view at.
65
- * @param {number=} length The byte length of the new view.
66
- * @return {!Uint8Array}
67
- */
68
- static toUint8(data, offset, length) {}
69
- /**
70
- * Creates a DataView over the given buffer.
71
- * @see toUint8
72
- * @param {BufferSource} buffer
73
- * @param {number=} offset
74
- * @param {number=} length
75
- * @return {!DataView}
76
- */
77
- static toDataView(buffer, offset, length) {}
78
- };
79
- /**
80
- * @summary
81
- * Describes an error that happened.
82
- * @description
83
- * This uses numerical codes to describe
84
- * which error happened.
85
- * Some error are caused by errors from the browser. In these cases, the error
86
- * object is provided as part of the <code>data</code> field. System codes come
87
- * from the browser and may or may not be documented. Here are some places
88
- * where the errors may be documented:
89
- * <ul>
90
- * <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaError">MediaError</a>
91
- * <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status">HTTP Codes</a>
92
- * <li><a href="https://hresult.info">Edge/PlayReady errors</a>
93
- * </ul>
94
- * @implements {shaka.extern.Error}
95
- * @extends {Error}
96
- */
97
- shaka.util.Error = class {
98
- /**
99
- * @param {shaka.util.Error.Severity} severity
100
- * @param {shaka.util.Error.Category} category
101
- * @param {shaka.util.Error.Code} code
102
- * @param {...*} varArgs
103
- */
104
- constructor(severity, category, code, ...varArgs) {}
105
- };
106
- /**
107
- * @override
108
- */
109
- shaka.util.Error.prototype.severity;
110
- /**
111
- * @override
112
- */
113
- shaka.util.Error.prototype.category;
114
- /**
115
- * @override
116
- */
117
- shaka.util.Error.prototype.code;
118
- /**
119
- * @override
120
- */
121
- shaka.util.Error.prototype.data;
122
- /**
123
- * @override
124
- */
125
- shaka.util.Error.prototype.handled;
126
- /**
127
- * @enum {number}
128
- */
129
- shaka.util.Error.Severity = {
130
- 'RECOVERABLE': 1,
131
- 'CRITICAL': 2
132
- };
133
- /**
134
- * @enum {number}
135
- */
136
- shaka.util.Error.Category = {
137
- 'NETWORK': 1,
138
- 'TEXT': 2,
139
- 'MEDIA': 3,
140
- 'MANIFEST': 4,
141
- 'STREAMING': 5,
142
- 'DRM': 6,
143
- 'PLAYER': 7,
144
- 'CAST': 8,
145
- 'STORAGE': 9,
146
- 'ADS': 10
147
- };
148
- /**
149
- * @enum {number}
150
- */
151
- shaka.util.Error.Code = {
152
- 'UNSUPPORTED_SCHEME': 1000,
153
- 'BAD_HTTP_STATUS': 1001,
154
- 'HTTP_ERROR': 1002,
155
- 'TIMEOUT': 1003,
156
- 'MALFORMED_DATA_URI': 1004,
157
- 'REQUEST_FILTER_ERROR': 1006,
158
- 'RESPONSE_FILTER_ERROR': 1007,
159
- 'MALFORMED_TEST_URI': 1008,
160
- 'UNEXPECTED_TEST_REQUEST': 1009,
161
- 'ATTEMPTS_EXHAUSTED': 1010,
162
- 'INVALID_TEXT_HEADER': 2000,
163
- 'INVALID_TEXT_CUE': 2001,
164
- 'UNABLE_TO_DETECT_ENCODING': 2003,
165
- 'BAD_ENCODING': 2004,
166
- 'INVALID_XML': 2005,
167
- 'INVALID_MP4_TTML': 2007,
168
- 'INVALID_MP4_VTT': 2008,
169
- 'UNABLE_TO_EXTRACT_CUE_START_TIME': 2009,
170
- 'INVALID_MP4_CEA': 2010,
171
- 'TEXT_COULD_NOT_GUESS_MIME_TYPE': 2011,
172
- 'CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS': 2012,
173
- 'TEXT_ONLY_WEBVTT_SRC_EQUALS': 2013,
174
- 'MISSING_TEXT_PLUGIN': 2014,
175
- 'BUFFER_READ_OUT_OF_BOUNDS': 3000,
176
- 'JS_INTEGER_OVERFLOW': 3001,
177
- 'EBML_OVERFLOW': 3002,
178
- 'EBML_BAD_FLOATING_POINT_SIZE': 3003,
179
- 'MP4_SIDX_WRONG_BOX_TYPE': 3004,
180
- 'MP4_SIDX_INVALID_TIMESCALE': 3005,
181
- 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,
182
- 'WEBM_CUES_ELEMENT_MISSING': 3007,
183
- 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,
184
- 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,
185
- 'WEBM_INFO_ELEMENT_MISSING': 3010,
186
- 'WEBM_DURATION_ELEMENT_MISSING': 3011,
187
- 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,
188
- 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,
189
- 'MEDIA_SOURCE_OPERATION_FAILED': 3014,
190
- 'MEDIA_SOURCE_OPERATION_THREW': 3015,
191
- 'VIDEO_ERROR': 3016,
192
- 'QUOTA_EXCEEDED_ERROR': 3017,
193
- 'TRANSMUXING_FAILED': 3018,
194
- 'CONTENT_TRANSFORMATION_FAILED': 3019,
195
- 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,
196
- 'DASH_INVALID_XML': 4001,
197
- 'DASH_NO_SEGMENT_INFO': 4002,
198
- 'DASH_EMPTY_ADAPTATION_SET': 4003,
199
- 'DASH_EMPTY_PERIOD': 4004,
200
- 'DASH_WEBM_MISSING_INIT': 4005,
201
- 'DASH_UNSUPPORTED_CONTAINER': 4006,
202
- 'DASH_PSSH_BAD_ENCODING': 4007,
203
- 'DASH_NO_COMMON_KEY_SYSTEM': 4008,
204
- 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,
205
- 'DASH_CONFLICTING_KEY_IDS': 4010,
206
- 'RESTRICTIONS_CANNOT_BE_MET': 4012,
207
- 'HLS_PLAYLIST_HEADER_MISSING': 4015,
208
- 'INVALID_HLS_TAG': 4016,
209
- 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,
210
- 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,
211
- 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,
212
- 'HLS_MASTER_PLAYLIST_NOT_PROVIDED': 4022,
213
- 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,
214
- 'HLS_REQUIRED_TAG_MISSING': 4024,
215
- 'HLS_COULD_NOT_GUESS_CODECS': 4025,
216
- 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,
217
- 'DASH_UNSUPPORTED_XLINK_ACTUATE': 4027,
218
- 'DASH_XLINK_DEPTH_LIMIT': 4028,
219
- 'HLS_COULD_NOT_PARSE_SEGMENT_START_TIME': 4030,
220
- 'CONTENT_UNSUPPORTED_BY_BROWSER': 4032,
221
- 'CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM': 4033,
222
- 'HLS_AES_128_ENCRYPTION_NOT_SUPPORTED': 4034,
223
- 'HLS_INTERNAL_SKIP_STREAM': 4035,
224
- 'NO_VARIANTS': 4036,
225
- 'PERIOD_FLATTENING_FAILED': 4037,
226
- 'INCONSISTENT_DRM_ACROSS_PERIODS': 4038,
227
- 'HLS_VARIABLE_NOT_FOUND': 4039,
228
- 'STREAMING_ENGINE_STARTUP_INVALID_STATE': 5006,
229
- 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
230
- 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
231
- 'FAILED_TO_CREATE_CDM': 6002,
232
- 'FAILED_TO_ATTACH_TO_VIDEO': 6003,
233
- 'INVALID_SERVER_CERTIFICATE': 6004,
234
- 'FAILED_TO_CREATE_SESSION': 6005,
235
- 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,
236
- 'LICENSE_REQUEST_FAILED': 6007,
237
- 'LICENSE_RESPONSE_REJECTED': 6008,
238
- 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,
239
- 'NO_LICENSE_SERVER_GIVEN': 6012,
240
- 'OFFLINE_SESSION_REMOVED': 6013,
241
- 'EXPIRED': 6014,
242
- 'SERVER_CERTIFICATE_REQUIRED': 6015,
243
- 'INIT_DATA_TRANSFORM_ERROR': 6016,
244
- 'LOAD_INTERRUPTED': 7000,
245
- 'OPERATION_ABORTED': 7001,
246
- 'NO_VIDEO_ELEMENT': 7002,
247
- 'OBJECT_DESTROYED': 7003,
248
- 'CONTENT_NOT_LOADED': 7004,
249
- 'CAST_API_UNAVAILABLE': 8000,
250
- 'NO_CAST_RECEIVERS': 8001,
251
- 'ALREADY_CASTING': 8002,
252
- 'UNEXPECTED_CAST_ERROR': 8003,
253
- 'CAST_CANCELED_BY_USER': 8004,
254
- 'CAST_CONNECTION_TIMED_OUT': 8005,
255
- 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,
256
- 'STORAGE_NOT_SUPPORTED': 9000,
257
- 'INDEXED_DB_ERROR': 9001,
258
- 'DEPRECATED_OPERATION_ABORTED': 9002,
259
- 'REQUESTED_ITEM_NOT_FOUND': 9003,
260
- 'MALFORMED_OFFLINE_URI': 9004,
261
- 'CANNOT_STORE_LIVE_OFFLINE': 9005,
262
- 'NO_INIT_DATA_FOR_OFFLINE': 9007,
263
- 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008,
264
- 'NEW_KEY_OPERATION_NOT_SUPPORTED': 9011,
265
- 'KEY_NOT_FOUND': 9012,
266
- 'MISSING_STORAGE_CELL': 9013,
267
- 'STORAGE_LIMIT_REACHED': 9014,
268
- 'DOWNLOAD_SIZE_CALLBACK_ERROR': 9015,
269
- 'CS_IMA_SDK_MISSING': 10000,
270
- 'CS_AD_MANAGER_NOT_INITIALIZED': 10001,
271
- 'SS_IMA_SDK_MISSING': 10002,
272
- 'SS_AD_MANAGER_NOT_INITIALIZED': 10003,
273
- 'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004
274
- };
275
- /**
276
- * @namespace shaka.util.StringUtils
277
- * @summary A set of string utility functions.
278
- */
279
- shaka.util.StringUtils = class {
280
- /**
281
- * Creates a string from the given buffer as UTF-8 encoding.
282
- * @param {?BufferSource} data
283
- * @return {string}
284
- */
285
- static fromUTF8(data) {}
286
- /**
287
- * Creates a string from the given buffer as UTF-16 encoding.
288
- * @param {?BufferSource} data
289
- * @param {boolean} littleEndian
290
- true to read little endian, false to read big.
291
- * @param {boolean=} noThrow true to avoid throwing in cases where we may
292
- * expect invalid input. If noThrow is true and the data has an odd
293
- * length,it will be truncated.
294
- * @return {string}
295
- */
296
- static fromUTF16(data, littleEndian, noThrow) {}
297
- /**
298
- * Creates a string from the given buffer, auto-detecting the encoding that is
299
- * being used. If it cannot detect the encoding, it will throw an exception.
300
- * @param {?BufferSource} data
301
- * @return {string}
302
- */
303
- static fromBytesAutoDetect(data) {}
304
- /**
305
- * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
306
- * @param {string} str
307
- * @return {!ArrayBuffer}
308
- */
309
- static toUTF8(str) {}
310
- /**
311
- * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
312
- * @param {string} str
313
- * @param {boolean} littleEndian
314
- * @return {!ArrayBuffer}
315
- */
316
- static toUTF16(str, littleEndian) {}
317
- /**
318
- * Resets the fromCharCode method's implementation.
319
- * For debug use.
320
- */
321
- static resetFromCharCode() {}
322
- };
323
- /**
324
- * @summary DataViewReader abstracts a DataView object.
325
- */
326
- shaka.util.DataViewReader = class {
327
- /**
328
- * @param {BufferSource} data
329
- * @param {shaka.util.DataViewReader.Endianness} endianness The endianness.
330
- */
331
- constructor(data, endianness) {}
332
- /**
333
- * @return {boolean} True if the reader has more data, false otherwise.
334
- */
335
- hasMoreData() {}
336
- /**
337
- * Gets the current byte position.
338
- * @return {number}
339
- */
340
- getPosition() {}
341
- /**
342
- * Gets the byte length of the DataView.
343
- * @return {number}
344
- */
345
- getLength() {}
346
- /**
347
- * Reads an unsigned 8 bit integer, and advances the reader.
348
- * @return {number} The integer.
349
- */
350
- readUint8() {}
351
- /**
352
- * Reads an unsigned 16 bit integer, and advances the reader.
353
- * @return {number} The integer.
354
- */
355
- readUint16() {}
356
- /**
357
- * Reads an unsigned 32 bit integer, and advances the reader.
358
- * @return {number} The integer.
359
- */
360
- readUint32() {}
361
- /**
362
- * Reads a signed 32 bit integer, and advances the reader.
363
- * @return {number} The integer.
364
- */
365
- readInt32() {}
366
- /**
367
- * Reads an unsigned 64 bit integer, and advances the reader.
368
- * @return {number} The integer.
369
- */
370
- readUint64() {}
371
- /**
372
- * Reads the specified number of raw bytes.
373
- * @param {number} bytes The number of bytes to read.
374
- * @return {!Uint8Array}
375
- */
376
- readBytes(bytes) {}
377
- /**
378
- * Skips the specified number of bytes.
379
- * @param {number} bytes The number of bytes to skip.
380
- */
381
- skip(bytes) {}
382
- /**
383
- * Rewinds the specified number of bytes.
384
- * @param {number} bytes The number of bytes to rewind.
385
- */
386
- rewind(bytes) {}
387
- /**
388
- * Seeks to a specified position.
389
- * @param {number} position The desired byte position within the DataView.
390
- */
391
- seek(position) {}
392
- /**
393
- * Keeps reading until it reaches a byte that equals to zero. The text is
394
- * assumed to be UTF-8.
395
- * @return {string}
396
- */
397
- readTerminatedString() {}
398
- };
399
- /**
400
- * Endianness.
401
- * @enum {number}
402
- */
403
- shaka.util.DataViewReader.Endianness = {
404
- 'BIG_ENDIAN': 0,
405
- 'LITTLE_ENDIAN': 1
406
- };
407
- /**
408
- */
409
- shaka.util.Mp4Parser = class {
410
- /** */
411
- constructor() {}
412
- /**
413
- * Declare a box type as a Box.
414
- * @param {string} type
415
- * @param {!shaka.util.Mp4Parser.CallbackType} definition
416
- * @return {!shaka.util.Mp4Parser}
417
- */
418
- box(type, definition) {}
419
- /**
420
- * Declare a box type as a Full Box.
421
- * @param {string} type
422
- * @param {!shaka.util.Mp4Parser.CallbackType} definition
423
- * @return {!shaka.util.Mp4Parser}
424
- */
425
- fullBox(type, definition) {}
426
- /**
427
- * Stop parsing. Useful for extracting information from partial segments and
428
- * avoiding an out-of-bounds error once you find what you are looking for.
429
- */
430
- stop() {}
431
- /**
432
- * Parse the given data using the added callbacks.
433
- * @param {!BufferSource} data
434
- * @param {boolean=} partialOkay If true, allow reading partial payloads
435
- * from some boxes. If the goal is a child box, we can sometimes find it
436
- * without enough data to find all child boxes.
437
- * @param {boolean=} stopOnPartial If true, stop reading if an incomplete
438
- * box is detected.
439
- */
440
- parse(data, partialOkay, stopOnPartial) {}
441
- /**
442
- * Parse the next box on the current level.
443
- * @param {number} absStart The absolute start position in the original
444
- * byte array.
445
- * @param {!shaka.util.DataViewReader} reader
446
- * @param {boolean=} partialOkay If true, allow reading partial payloads
447
- * from some boxes. If the goal is a child box, we can sometimes find it
448
- * without enough data to find all child boxes.
449
- * @param {boolean=} stopOnPartial If true, stop reading if an incomplete
450
- * box is detected.
451
- */
452
- parseNext(absStart, reader, partialOkay, stopOnPartial) {}
453
- /**
454
- * A callback that tells the Mp4 parser to treat the body of a box as a series
455
- * of boxes. The number of boxes is limited by the size of the parent box.
456
- * @param {!shaka.extern.ParsedBox} box
457
- */
458
- static children(box) {}
459
- /**
460
- * A callback that tells the Mp4 parser to treat the body of a box as a sample
461
- * description. A sample description box has a fixed number of children. The
462
- * number of children is represented by a 4 byte unsigned integer. Each child
463
- * is a box.
464
- * @param {!shaka.extern.ParsedBox} box
465
- */
466
- static sampleDescription(box) {}
467
- /**
468
- * Create a callback that tells the Mp4 parser to treat the body of a box as a
469
- * binary blob and to parse the body's contents using the provided callback.
470
- * @param {function(!Uint8Array)} callback
471
- * @return {!shaka.util.Mp4Parser.CallbackType}
472
- */
473
- static allData(callback) {}
474
- /**
475
- * Convert an integer type from a box into an ascii string name.
476
- * Useful for debugging.
477
- * @param {number} type The type of the box, a uint32.
478
- * @return {string}
479
- */
480
- static typeToString(type) {}
481
- /**
482
- * Find the header size of the box.
483
- * Useful for modifying boxes in place or finding the exact offset of a field.
484
- * @param {shaka.extern.ParsedBox} box
485
- * @return {number}
486
- */
487
- static headerSize(box) {}
488
- };
489
- /**
490
- * @typedef {function(!shaka.extern.ParsedBox)}
491
- */
492
- shaka.util.Mp4Parser.CallbackType;
493
- /**
494
- * A timer allows a single function to be executed at a later time or at
495
- * regular intervals.
496
- * @final
497
- */
498
- shaka.util.Timer = class {
499
- /**
500
- * Create a new timer. A timer is committed to a single callback function.
501
- * While there is no technical reason to do this, it is far easier to
502
- * understand and use timers when they are connected to one functional idea.
503
- * @param {function()} onTick
504
- */
505
- constructor(onTick) {}
506
- /**
507
- * Have the timer call |onTick| now.
508
- * @return {!shaka.util.Timer}
509
- */
510
- tickNow() {}
511
- /**
512
- * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
513
- * called first.
514
- * @param {number} seconds
515
- * @return {!shaka.util.Timer}
516
- */
517
- tickAfter(seconds) {}
518
- /**
519
- * Have the timer call |onTick| every |seconds| until |stop| is called.
520
- * @param {number} seconds
521
- * @return {!shaka.util.Timer}
522
- */
523
- tickEvery(seconds) {}
524
- /**
525
- * Stop the timer and clear the previous behaviour. The timer is still usable
526
- * after calling |stop|.
527
- */
528
- stop() {}
529
- };
530
- /**
531
- * @summary A set of Uint8Array utility functions.
532
- */
533
- shaka.util.Uint8ArrayUtils = class {
534
- /**
535
- * Compare two Uint8Arrays for equality.
536
- * @param {Uint8Array} arr1
537
- * @param {Uint8Array} arr2
538
- * @return {boolean}
539
- * @deprecated
540
- */
541
- static equal(arr1, arr2) {}
542
- /**
543
- * Convert a buffer to a base64 string. The output will be standard
544
- * alphabet as opposed to base64url safe alphabet.
545
- * @param {BufferSource} data
546
- * @return {string}
547
- */
548
- static toStandardBase64(data) {}
549
- /**
550
- * Convert a buffer to a base64 string. The output will always use the
551
- * alternate encoding/alphabet also known as "base64url".
552
- * @param {BufferSource} data
553
- * @param {boolean=} padding If true, pad the output with equals signs.
554
- * Defaults to true.
555
- * @return {string}
556
- */
557
- static toBase64(data, padding) {}
558
- /**
559
- * Convert a base64 string to a Uint8Array. Accepts either the standard
560
- * alphabet or the alternate "base64url" alphabet.
561
- * @param {string} str
562
- * @return {!Uint8Array}
563
- */
564
- static fromBase64(str) {}
565
- /**
566
- * Convert a hex string to a Uint8Array.
567
- * @param {string} str
568
- * @return {!Uint8Array}
569
- */
570
- static fromHex(str) {}
571
- /**
572
- * Convert a buffer to a hex string.
573
- * @param {BufferSource} data
574
- * @return {string}
575
- */
576
- static toHex(data) {}
577
- /**
578
- * Concatenate buffers.
579
- * @param {...BufferSource} varArgs
580
- * @return {!Uint8Array}
581
- */
582
- static concat(...varArgs) {}
583
- };
584
37
  /**
585
38
  * @implements {shaka.extern.Cue}
586
39
  */
@@ -837,113 +290,454 @@ shaka.text.Cue.fontStyle = {
837
290
  /**
838
291
  * @enum {string}
839
292
  */
840
- shaka.text.Cue.textDecoration = {
841
- 'UNDERLINE': 'underline',
842
- 'LINE_THROUGH': 'lineThrough',
843
- 'OVERLINE': 'overline'
293
+ shaka.text.Cue.textDecoration = {
294
+ 'UNDERLINE': 'underline',
295
+ 'LINE_THROUGH': 'lineThrough',
296
+ 'OVERLINE': 'overline'
297
+ };
298
+ /**
299
+ * @implements {shaka.extern.CueRegion}
300
+ * @struct
301
+ */
302
+ shaka.text.CueRegion = class {
303
+ /** */
304
+ constructor() {}
305
+ };
306
+ /**
307
+ * @override
308
+ */
309
+ shaka.text.CueRegion.prototype.id;
310
+ /**
311
+ * @override
312
+ */
313
+ shaka.text.CueRegion.prototype.viewportAnchorX;
314
+ /**
315
+ * @override
316
+ */
317
+ shaka.text.CueRegion.prototype.viewportAnchorY;
318
+ /**
319
+ * @override
320
+ */
321
+ shaka.text.CueRegion.prototype.regionAnchorX;
322
+ /**
323
+ * @override
324
+ */
325
+ shaka.text.CueRegion.prototype.regionAnchorY;
326
+ /**
327
+ * @override
328
+ */
329
+ shaka.text.CueRegion.prototype.width;
330
+ /**
331
+ * @override
332
+ */
333
+ shaka.text.CueRegion.prototype.height;
334
+ /**
335
+ * @override
336
+ */
337
+ shaka.text.CueRegion.prototype.heightUnits;
338
+ /**
339
+ * @override
340
+ */
341
+ shaka.text.CueRegion.prototype.widthUnits;
342
+ /**
343
+ * @override
344
+ */
345
+ shaka.text.CueRegion.prototype.viewportAnchorUnits;
346
+ /**
347
+ * @override
348
+ */
349
+ shaka.text.CueRegion.prototype.scroll;
350
+ /**
351
+ * @enum {number}
352
+ */
353
+ shaka.text.CueRegion.units = {
354
+ 'PX': 0,
355
+ 'PERCENTAGE': 1,
356
+ 'LINES': 2
357
+ };
358
+ /**
359
+ * @enum {string}
360
+ */
361
+ shaka.text.CueRegion.scrollMode = {
362
+ 'NONE': '',
363
+ 'UP': 'up'
364
+ };
365
+ /**
366
+ * @summary A set of BufferSource utility functions.
367
+ */
368
+ shaka.util.BufferUtils = class {
369
+ /**
370
+ * Compare two buffers for equality. For buffers of different types, this
371
+ * compares the underlying buffers as binary data.
372
+ * @param {?BufferSource} arr1
373
+ * @param {?BufferSource} arr2
374
+ * @return {boolean}
375
+ */
376
+ static equal(arr1, arr2) {}
377
+ /**
378
+ * Gets an ArrayBuffer that contains the data from the given TypedArray. Note
379
+ * this will allocate a new ArrayBuffer if the object is a partial view of
380
+ * the data.
381
+ * @param {!BufferSource} view
382
+ * @return {!ArrayBuffer}
383
+ */
384
+ static toArrayBuffer(view) {}
385
+ /**
386
+ * Creates a new Uint8Array view on the same buffer. This clamps the values
387
+ * to be within the same view (i.e. you can't use this to move past the end
388
+ * of the view, even if the underlying buffer is larger). However, you can
389
+ * pass a negative offset to access the data before the view.
390
+ * @param {BufferSource} data
391
+ * @param {number=} offset The offset from the beginning of this data's view
392
+ * to start the new view at.
393
+ * @param {number=} length The byte length of the new view.
394
+ * @return {!Uint8Array}
395
+ */
396
+ static toUint8(data, offset, length) {}
397
+ /**
398
+ * Creates a DataView over the given buffer.
399
+ * @see toUint8
400
+ * @param {BufferSource} buffer
401
+ * @param {number=} offset
402
+ * @param {number=} length
403
+ * @return {!DataView}
404
+ */
405
+ static toDataView(buffer, offset, length) {}
406
+ };
407
+ /**
408
+ * An interface to standardize how objects are destroyed.
409
+ * @interface
410
+ */
411
+ shaka.util.IDestroyable = class {
412
+ /**
413
+ * Request that this object be destroyed, releasing all resources and shutting
414
+ * down all operations. Returns a Promise which is resolved when destruction
415
+ * is complete. This Promise should never be rejected.
416
+ * @return {!Promise}
417
+ */
418
+ destroy() {}
419
+ };
420
+ /**
421
+ */
422
+ shaka.dependencies = class {
423
+ /**
424
+ * Registers a new dependency.
425
+ * @param {shaka.dependencies.Allowed} key which is used for retrieving a
426
+ * dependency
427
+ * @param {?} dep a dependency
428
+ */
429
+ static add(key, dep) {}
430
+ /**
431
+ * Check if we have a dependency for the key.
432
+ * @param {shaka.dependencies.Allowed} key key
433
+ * @return {boolean}
434
+ */
435
+ static has(key) {}
436
+ };
437
+ /**
438
+ * @enum {string}
439
+ */
440
+ shaka.dependencies.Allowed = {
441
+ muxjs: 'muxjs'
844
442
  };
845
443
  /**
846
- * @implements {shaka.extern.CueRegion}
847
- * @struct
444
+ * @summary
445
+ * Describes an error that happened.
446
+ * @description
447
+ * This uses numerical codes to describe
448
+ * which error happened.
449
+ * Some error are caused by errors from the browser. In these cases, the error
450
+ * object is provided as part of the <code>data</code> field. System codes come
451
+ * from the browser and may or may not be documented. Here are some places
452
+ * where the errors may be documented:
453
+ * <ul>
454
+ * <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaError">MediaError</a>
455
+ * <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status">HTTP Codes</a>
456
+ * <li><a href="https://hresult.info">Edge/PlayReady errors</a>
457
+ * </ul>
458
+ * @implements {shaka.extern.Error}
459
+ * @extends {Error}
848
460
  */
849
- shaka.text.CueRegion = class {
850
- /** */
851
- constructor() {}
461
+ shaka.util.Error = class {
462
+ /**
463
+ * @param {shaka.util.Error.Severity} severity
464
+ * @param {shaka.util.Error.Category} category
465
+ * @param {shaka.util.Error.Code} code
466
+ * @param {...*} varArgs
467
+ */
468
+ constructor(severity, category, code, ...varArgs) {}
852
469
  };
853
470
  /**
854
471
  * @override
855
472
  */
856
- shaka.text.CueRegion.prototype.id;
857
- /**
858
- * @override
859
- */
860
- shaka.text.CueRegion.prototype.viewportAnchorX;
861
- /**
862
- * @override
863
- */
864
- shaka.text.CueRegion.prototype.viewportAnchorY;
865
- /**
866
- * @override
867
- */
868
- shaka.text.CueRegion.prototype.regionAnchorX;
869
- /**
870
- * @override
871
- */
872
- shaka.text.CueRegion.prototype.regionAnchorY;
873
- /**
874
- * @override
875
- */
876
- shaka.text.CueRegion.prototype.width;
473
+ shaka.util.Error.prototype.severity;
877
474
  /**
878
475
  * @override
879
476
  */
880
- shaka.text.CueRegion.prototype.height;
477
+ shaka.util.Error.prototype.category;
881
478
  /**
882
479
  * @override
883
480
  */
884
- shaka.text.CueRegion.prototype.heightUnits;
481
+ shaka.util.Error.prototype.code;
885
482
  /**
886
483
  * @override
887
484
  */
888
- shaka.text.CueRegion.prototype.widthUnits;
485
+ shaka.util.Error.prototype.data;
889
486
  /**
890
487
  * @override
891
488
  */
892
- shaka.text.CueRegion.prototype.viewportAnchorUnits;
489
+ shaka.util.Error.prototype.handled;
893
490
  /**
894
- * @override
895
- */
896
- shaka.text.CueRegion.prototype.scroll;
491
+ * @enum {number}
492
+ */
493
+ shaka.util.Error.Severity = {
494
+ 'RECOVERABLE': 1,
495
+ 'CRITICAL': 2
496
+ };
897
497
  /**
898
498
  * @enum {number}
899
499
  */
900
- shaka.text.CueRegion.units = {
901
- 'PX': 0,
902
- 'PERCENTAGE': 1,
903
- 'LINES': 2
500
+ shaka.util.Error.Category = {
501
+ 'NETWORK': 1,
502
+ 'TEXT': 2,
503
+ 'MEDIA': 3,
504
+ 'MANIFEST': 4,
505
+ 'STREAMING': 5,
506
+ 'DRM': 6,
507
+ 'PLAYER': 7,
508
+ 'CAST': 8,
509
+ 'STORAGE': 9,
510
+ 'ADS': 10
904
511
  };
905
512
  /**
906
- * @enum {string}
513
+ * @enum {number}
907
514
  */
908
- shaka.text.CueRegion.scrollMode = {
909
- 'NONE': '',
910
- 'UP': 'up'
515
+ shaka.util.Error.Code = {
516
+ 'UNSUPPORTED_SCHEME': 1000,
517
+ 'BAD_HTTP_STATUS': 1001,
518
+ 'HTTP_ERROR': 1002,
519
+ 'TIMEOUT': 1003,
520
+ 'MALFORMED_DATA_URI': 1004,
521
+ 'REQUEST_FILTER_ERROR': 1006,
522
+ 'RESPONSE_FILTER_ERROR': 1007,
523
+ 'MALFORMED_TEST_URI': 1008,
524
+ 'UNEXPECTED_TEST_REQUEST': 1009,
525
+ 'ATTEMPTS_EXHAUSTED': 1010,
526
+ 'INVALID_TEXT_HEADER': 2000,
527
+ 'INVALID_TEXT_CUE': 2001,
528
+ 'UNABLE_TO_DETECT_ENCODING': 2003,
529
+ 'BAD_ENCODING': 2004,
530
+ 'INVALID_XML': 2005,
531
+ 'INVALID_MP4_TTML': 2007,
532
+ 'INVALID_MP4_VTT': 2008,
533
+ 'UNABLE_TO_EXTRACT_CUE_START_TIME': 2009,
534
+ 'INVALID_MP4_CEA': 2010,
535
+ 'TEXT_COULD_NOT_GUESS_MIME_TYPE': 2011,
536
+ 'CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS': 2012,
537
+ 'TEXT_ONLY_WEBVTT_SRC_EQUALS': 2013,
538
+ 'MISSING_TEXT_PLUGIN': 2014,
539
+ 'BUFFER_READ_OUT_OF_BOUNDS': 3000,
540
+ 'JS_INTEGER_OVERFLOW': 3001,
541
+ 'EBML_OVERFLOW': 3002,
542
+ 'EBML_BAD_FLOATING_POINT_SIZE': 3003,
543
+ 'MP4_SIDX_WRONG_BOX_TYPE': 3004,
544
+ 'MP4_SIDX_INVALID_TIMESCALE': 3005,
545
+ 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,
546
+ 'WEBM_CUES_ELEMENT_MISSING': 3007,
547
+ 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,
548
+ 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,
549
+ 'WEBM_INFO_ELEMENT_MISSING': 3010,
550
+ 'WEBM_DURATION_ELEMENT_MISSING': 3011,
551
+ 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,
552
+ 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,
553
+ 'MEDIA_SOURCE_OPERATION_FAILED': 3014,
554
+ 'MEDIA_SOURCE_OPERATION_THREW': 3015,
555
+ 'VIDEO_ERROR': 3016,
556
+ 'QUOTA_EXCEEDED_ERROR': 3017,
557
+ 'TRANSMUXING_FAILED': 3018,
558
+ 'CONTENT_TRANSFORMATION_FAILED': 3019,
559
+ 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,
560
+ 'DASH_INVALID_XML': 4001,
561
+ 'DASH_NO_SEGMENT_INFO': 4002,
562
+ 'DASH_EMPTY_ADAPTATION_SET': 4003,
563
+ 'DASH_EMPTY_PERIOD': 4004,
564
+ 'DASH_WEBM_MISSING_INIT': 4005,
565
+ 'DASH_UNSUPPORTED_CONTAINER': 4006,
566
+ 'DASH_PSSH_BAD_ENCODING': 4007,
567
+ 'DASH_NO_COMMON_KEY_SYSTEM': 4008,
568
+ 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,
569
+ 'DASH_CONFLICTING_KEY_IDS': 4010,
570
+ 'RESTRICTIONS_CANNOT_BE_MET': 4012,
571
+ 'HLS_PLAYLIST_HEADER_MISSING': 4015,
572
+ 'INVALID_HLS_TAG': 4016,
573
+ 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,
574
+ 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,
575
+ 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,
576
+ 'HLS_MASTER_PLAYLIST_NOT_PROVIDED': 4022,
577
+ 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,
578
+ 'HLS_REQUIRED_TAG_MISSING': 4024,
579
+ 'HLS_COULD_NOT_GUESS_CODECS': 4025,
580
+ 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,
581
+ 'DASH_UNSUPPORTED_XLINK_ACTUATE': 4027,
582
+ 'DASH_XLINK_DEPTH_LIMIT': 4028,
583
+ 'HLS_COULD_NOT_PARSE_SEGMENT_START_TIME': 4030,
584
+ 'CONTENT_UNSUPPORTED_BY_BROWSER': 4032,
585
+ 'CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM': 4033,
586
+ 'HLS_AES_128_ENCRYPTION_NOT_SUPPORTED': 4034,
587
+ 'HLS_INTERNAL_SKIP_STREAM': 4035,
588
+ 'NO_VARIANTS': 4036,
589
+ 'PERIOD_FLATTENING_FAILED': 4037,
590
+ 'INCONSISTENT_DRM_ACROSS_PERIODS': 4038,
591
+ 'HLS_VARIABLE_NOT_FOUND': 4039,
592
+ 'STREAMING_ENGINE_STARTUP_INVALID_STATE': 5006,
593
+ 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
594
+ 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
595
+ 'FAILED_TO_CREATE_CDM': 6002,
596
+ 'FAILED_TO_ATTACH_TO_VIDEO': 6003,
597
+ 'INVALID_SERVER_CERTIFICATE': 6004,
598
+ 'FAILED_TO_CREATE_SESSION': 6005,
599
+ 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,
600
+ 'LICENSE_REQUEST_FAILED': 6007,
601
+ 'LICENSE_RESPONSE_REJECTED': 6008,
602
+ 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,
603
+ 'NO_LICENSE_SERVER_GIVEN': 6012,
604
+ 'OFFLINE_SESSION_REMOVED': 6013,
605
+ 'EXPIRED': 6014,
606
+ 'SERVER_CERTIFICATE_REQUIRED': 6015,
607
+ 'INIT_DATA_TRANSFORM_ERROR': 6016,
608
+ 'SERVER_CERTIFICATE_REQUEST_FAILED': 6017,
609
+ 'LOAD_INTERRUPTED': 7000,
610
+ 'OPERATION_ABORTED': 7001,
611
+ 'NO_VIDEO_ELEMENT': 7002,
612
+ 'OBJECT_DESTROYED': 7003,
613
+ 'CONTENT_NOT_LOADED': 7004,
614
+ 'CAST_API_UNAVAILABLE': 8000,
615
+ 'NO_CAST_RECEIVERS': 8001,
616
+ 'ALREADY_CASTING': 8002,
617
+ 'UNEXPECTED_CAST_ERROR': 8003,
618
+ 'CAST_CANCELED_BY_USER': 8004,
619
+ 'CAST_CONNECTION_TIMED_OUT': 8005,
620
+ 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,
621
+ 'STORAGE_NOT_SUPPORTED': 9000,
622
+ 'INDEXED_DB_ERROR': 9001,
623
+ 'DEPRECATED_OPERATION_ABORTED': 9002,
624
+ 'REQUESTED_ITEM_NOT_FOUND': 9003,
625
+ 'MALFORMED_OFFLINE_URI': 9004,
626
+ 'CANNOT_STORE_LIVE_OFFLINE': 9005,
627
+ 'NO_INIT_DATA_FOR_OFFLINE': 9007,
628
+ 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008,
629
+ 'NEW_KEY_OPERATION_NOT_SUPPORTED': 9011,
630
+ 'KEY_NOT_FOUND': 9012,
631
+ 'MISSING_STORAGE_CELL': 9013,
632
+ 'STORAGE_LIMIT_REACHED': 9014,
633
+ 'DOWNLOAD_SIZE_CALLBACK_ERROR': 9015,
634
+ 'CS_IMA_SDK_MISSING': 10000,
635
+ 'CS_AD_MANAGER_NOT_INITIALIZED': 10001,
636
+ 'SS_IMA_SDK_MISSING': 10002,
637
+ 'SS_AD_MANAGER_NOT_INITIALIZED': 10003,
638
+ 'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004
911
639
  };
912
640
  /**
913
- * An interface to standardize how objects are destroyed.
914
- * @interface
641
+ * @namespace shaka.util.StringUtils
642
+ * @summary A set of string utility functions.
915
643
  */
916
- shaka.util.IDestroyable = class {
644
+ shaka.util.StringUtils = class {
645
+ /**
646
+ * Creates a string from the given buffer as UTF-8 encoding.
647
+ * @param {?BufferSource} data
648
+ * @return {string}
649
+ */
650
+ static fromUTF8(data) {}
651
+ /**
652
+ * Creates a string from the given buffer as UTF-16 encoding.
653
+ * @param {?BufferSource} data
654
+ * @param {boolean} littleEndian
655
+ true to read little endian, false to read big.
656
+ * @param {boolean=} noThrow true to avoid throwing in cases where we may
657
+ * expect invalid input. If noThrow is true and the data has an odd
658
+ * length,it will be truncated.
659
+ * @return {string}
660
+ */
661
+ static fromUTF16(data, littleEndian, noThrow) {}
662
+ /**
663
+ * Creates a string from the given buffer, auto-detecting the encoding that is
664
+ * being used. If it cannot detect the encoding, it will throw an exception.
665
+ * @param {?BufferSource} data
666
+ * @return {string}
667
+ */
668
+ static fromBytesAutoDetect(data) {}
917
669
  /**
918
- * Request that this object be destroyed, releasing all resources and shutting
919
- * down all operations. Returns a Promise which is resolved when destruction
920
- * is complete. This Promise should never be rejected.
921
- * @return {!Promise}
670
+ * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
671
+ * @param {string} str
672
+ * @return {!ArrayBuffer}
922
673
  */
923
- destroy() {}
924
- };
925
- /**
926
- */
927
- shaka.dependencies = class {
674
+ static toUTF8(str) {}
928
675
  /**
929
- * Registers a new dependency.
930
- * @param {shaka.dependencies.Allowed} key which is used for retrieving a
931
- * dependency
932
- * @param {?} dep a dependency
676
+ * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
677
+ * @param {string} str
678
+ * @param {boolean} littleEndian
679
+ * @return {!ArrayBuffer}
933
680
  */
934
- static add(key, dep) {}
681
+ static toUTF16(str, littleEndian) {}
935
682
  /**
936
- * Check if we have a dependency for the key.
937
- * @param {shaka.dependencies.Allowed} key key
938
- * @return {boolean}
683
+ * Resets the fromCharCode method's implementation.
684
+ * For debug use.
939
685
  */
940
- static has(key) {}
686
+ static resetFromCharCode() {}
941
687
  };
942
688
  /**
943
- * @enum {string}
689
+ * @summary A set of Uint8Array utility functions.
944
690
  */
945
- shaka.dependencies.Allowed = {
946
- muxjs: 'muxjs'
691
+ shaka.util.Uint8ArrayUtils = class {
692
+ /**
693
+ * Compare two Uint8Arrays for equality.
694
+ * @param {Uint8Array} arr1
695
+ * @param {Uint8Array} arr2
696
+ * @return {boolean}
697
+ * @deprecated
698
+ */
699
+ static equal(arr1, arr2) {}
700
+ /**
701
+ * Convert a buffer to a base64 string. The output will be standard
702
+ * alphabet as opposed to base64url safe alphabet.
703
+ * @param {BufferSource} data
704
+ * @return {string}
705
+ */
706
+ static toStandardBase64(data) {}
707
+ /**
708
+ * Convert a buffer to a base64 string. The output will always use the
709
+ * alternate encoding/alphabet also known as "base64url".
710
+ * @param {BufferSource} data
711
+ * @param {boolean=} padding If true, pad the output with equals signs.
712
+ * Defaults to true.
713
+ * @return {string}
714
+ */
715
+ static toBase64(data, padding) {}
716
+ /**
717
+ * Convert a base64 string to a Uint8Array. Accepts either the standard
718
+ * alphabet or the alternate "base64url" alphabet.
719
+ * @param {string} str
720
+ * @return {!Uint8Array}
721
+ */
722
+ static fromBase64(str) {}
723
+ /**
724
+ * Convert a hex string to a Uint8Array.
725
+ * @param {string} str
726
+ * @return {!Uint8Array}
727
+ */
728
+ static fromHex(str) {}
729
+ /**
730
+ * Convert a buffer to a hex string.
731
+ * @param {BufferSource} data
732
+ * @return {string}
733
+ */
734
+ static toHex(data) {}
735
+ /**
736
+ * Concatenate buffers.
737
+ * @param {...BufferSource} varArgs
738
+ * @return {!Uint8Array}
739
+ */
740
+ static concat(...varArgs) {}
947
741
  };
948
742
  /**
949
743
  * @summary Manages text parsers and cues.
@@ -971,70 +765,42 @@ shaka.text.TextEngine = class {
971
765
  destroy() {}
972
766
  };
973
767
  /**
974
- * An interface to standardize how objects release internal references
975
- * synchronously. If an object needs to asynchronously release references, then
976
- * it should use 'shaka.util.IDestroyable'.
977
- * @interface
978
- */
979
- shaka.util.IReleasable = class {
980
- /**
981
- * Request that this object release all internal references.
982
- */
983
- release() {}
984
- };
985
- /**
986
- * @summary
987
- * An EventManager maintains a collection of "event
988
- * bindings" between event targets and event listeners.
989
- * @implements {shaka.util.IReleasable}
768
+ * A timer allows a single function to be executed at a later time or at
769
+ * regular intervals.
770
+ * @final
990
771
  */
991
- shaka.util.EventManager = class {
992
- /** */
993
- constructor() {}
772
+ shaka.util.Timer = class {
994
773
  /**
995
- * Detaches all event listeners.
996
- * @override
774
+ * Create a new timer. A timer is committed to a single callback function.
775
+ * While there is no technical reason to do this, it is far easier to
776
+ * understand and use timers when they are connected to one functional idea.
777
+ * @param {function()} onTick
997
778
  */
998
- release() {}
779
+ constructor(onTick) {}
999
780
  /**
1000
- * Attaches an event listener to an event target.
1001
- * @param {EventTarget} target The event target.
1002
- * @param {string} type The event type.
1003
- * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1004
- * @param {(boolean|!AddEventListenerOptions)=} options An object that
1005
- * specifies characteristics about the event listener.
1006
- * The passive option, if true, indicates that this function will never
1007
- * call preventDefault(), which improves scrolling performance.
781
+ * Have the timer call |onTick| now.
782
+ * @return {!shaka.util.Timer}
1008
783
  */
1009
- listen(target, type, listener, options) {}
784
+ tickNow() {}
1010
785
  /**
1011
- * Attaches an event listener to an event target. The listener will be
1012
- * removed when the first instance of the event is fired.
1013
- * @param {EventTarget} target The event target.
1014
- * @param {string} type The event type.
1015
- * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1016
- * @param {(boolean|!AddEventListenerOptions)=} options An object that
1017
- * specifies characteristics about the event listener.
1018
- * The passive option, if true, indicates that this function will never
1019
- * call preventDefault(), which improves scrolling performance.
786
+ * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
787
+ * called first.
788
+ * @param {number} seconds
789
+ * @return {!shaka.util.Timer}
1020
790
  */
1021
- listenOnce(target, type, listener, options) {}
791
+ tickAfter(seconds) {}
1022
792
  /**
1023
- * Detaches an event listener from an event target.
1024
- * @param {EventTarget} target The event target.
1025
- * @param {string} type The event type.
1026
- * @param {shaka.util.EventManager.ListenerType=} listener The event listener.
793
+ * Have the timer call |onTick| every |seconds| until |stop| is called.
794
+ * @param {number} seconds
795
+ * @return {!shaka.util.Timer}
1027
796
  */
1028
- unlisten(target, type, listener) {}
797
+ tickEvery(seconds) {}
1029
798
  /**
1030
- * Detaches all event listeners from all targets.
799
+ * Stop the timer and clear the previous behaviour. The timer is still usable
800
+ * after calling |stop|.
1031
801
  */
1032
- removeAll() {}
802
+ stop() {}
1033
803
  };
1034
- /**
1035
- * @typedef {function(!Event)}
1036
- */
1037
- shaka.util.EventManager.ListenerType;
1038
804
  /**
1039
805
  * @summary
1040
806
  * <p>
@@ -1192,7 +958,7 @@ shaka.util.AbortableOperation.prototype.promise;
1192
958
  shaka.util.FakeEvent = class {
1193
959
  /**
1194
960
  * @param {string} type
1195
- * @param {Object=} dict
961
+ * @param {Map.<string, Object>=} dict
1196
962
  */
1197
963
  constructor(type, dict) {}
1198
964
  };
@@ -1344,56 +1110,122 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1344
1110
  */
1345
1111
  shaka.net.NetworkingEngine.NumBytesRemainingClass = class {
1346
1112
  /**
1347
- * Constructor
1113
+ * Constructor
1114
+ */
1115
+ constructor() {}
1116
+ };
1117
+ /**
1118
+ * A pending network request. This can track the current progress of the
1119
+ * download, and allows the request to be aborted if the network is slow.
1120
+ * @implements {shaka.extern.IAbortableOperation.<shaka.extern.Response>}
1121
+ * @extends {shaka.util.AbortableOperation}
1122
+ */
1123
+ shaka.net.NetworkingEngine.PendingRequest = class extends shaka.util.AbortableOperation {
1124
+ /**
1125
+ * @param {!Promise} promise
1126
+ * A Promise which represents the underlying operation. It is resolved
1127
+ * when the operation is complete, and rejected if the operation fails or
1128
+ * is aborted. Aborted operations should be rejected with a
1129
+ * shaka.util.Error object using the error code OPERATION_ABORTED.
1130
+ * @param {function():!Promise} onAbort
1131
+ * Will be called by this object to abort the underlying operation. This
1132
+ * is not cancelation, and will not necessarily result in any work being
1133
+ * undone. abort() should return a Promise which is resolved when the
1134
+ * underlying operation has been aborted. The returned Promise should
1135
+ * never be rejected.
1136
+ * @param {shaka.net.NetworkingEngine.NumBytesRemainingClass}
1137
+ * numBytesRemainingObj
1138
+ */
1139
+ constructor(promise, onAbort, numBytesRemainingObj) {}
1140
+ };
1141
+ /**
1142
+ * Request types. Allows a filter to decide which requests to read/alter.
1143
+ * @enum {number}
1144
+ */
1145
+ shaka.net.NetworkingEngine.RequestType = {
1146
+ 'MANIFEST': 0,
1147
+ 'SEGMENT': 1,
1148
+ 'LICENSE': 2,
1149
+ 'APP': 3,
1150
+ 'TIMING': 4,
1151
+ 'SERVER_CERTIFICATE': 5
1152
+ };
1153
+ /**
1154
+ * Priority level for network scheme plugins.
1155
+ * If multiple plugins are provided for the same scheme, only the
1156
+ * highest-priority one is used.
1157
+ * @enum {number}
1158
+ */
1159
+ shaka.net.NetworkingEngine.PluginPriority = {
1160
+ 'FALLBACK': 1,
1161
+ 'PREFERRED': 2,
1162
+ 'APPLICATION': 3
1163
+ };
1164
+ /**
1165
+ * An interface to standardize how objects release internal references
1166
+ * synchronously. If an object needs to asynchronously release references, then
1167
+ * it should use 'shaka.util.IDestroyable'.
1168
+ * @interface
1169
+ */
1170
+ shaka.util.IReleasable = class {
1171
+ /**
1172
+ * Request that this object release all internal references.
1173
+ */
1174
+ release() {}
1175
+ };
1176
+ /**
1177
+ * @summary
1178
+ * An EventManager maintains a collection of "event
1179
+ * bindings" between event targets and event listeners.
1180
+ * @implements {shaka.util.IReleasable}
1181
+ */
1182
+ shaka.util.EventManager = class {
1183
+ /** */
1184
+ constructor() {}
1185
+ /**
1186
+ * Detaches all event listeners.
1187
+ * @override
1188
+ */
1189
+ release() {}
1190
+ /**
1191
+ * Attaches an event listener to an event target.
1192
+ * @param {EventTarget} target The event target.
1193
+ * @param {string} type The event type.
1194
+ * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1195
+ * @param {(boolean|!AddEventListenerOptions)=} options An object that
1196
+ * specifies characteristics about the event listener.
1197
+ * The passive option, if true, indicates that this function will never
1198
+ * call preventDefault(), which improves scrolling performance.
1199
+ */
1200
+ listen(target, type, listener, options) {}
1201
+ /**
1202
+ * Attaches an event listener to an event target. The listener will be
1203
+ * removed when the first instance of the event is fired.
1204
+ * @param {EventTarget} target The event target.
1205
+ * @param {string} type The event type.
1206
+ * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1207
+ * @param {(boolean|!AddEventListenerOptions)=} options An object that
1208
+ * specifies characteristics about the event listener.
1209
+ * The passive option, if true, indicates that this function will never
1210
+ * call preventDefault(), which improves scrolling performance.
1211
+ */
1212
+ listenOnce(target, type, listener, options) {}
1213
+ /**
1214
+ * Detaches an event listener from an event target.
1215
+ * @param {EventTarget} target The event target.
1216
+ * @param {string} type The event type.
1217
+ * @param {shaka.util.EventManager.ListenerType=} listener The event listener.
1348
1218
  */
1349
- constructor() {}
1350
- };
1351
- /**
1352
- * A pending network request. This can track the current progress of the
1353
- * download, and allows the request to be aborted if the network is slow.
1354
- * @implements {shaka.extern.IAbortableOperation.<shaka.extern.Response>}
1355
- * @extends {shaka.util.AbortableOperation}
1356
- */
1357
- shaka.net.NetworkingEngine.PendingRequest = class extends shaka.util.AbortableOperation {
1219
+ unlisten(target, type, listener) {}
1358
1220
  /**
1359
- * @param {!Promise} promise
1360
- * A Promise which represents the underlying operation. It is resolved
1361
- * when the operation is complete, and rejected if the operation fails or
1362
- * is aborted. Aborted operations should be rejected with a
1363
- * shaka.util.Error object using the error code OPERATION_ABORTED.
1364
- * @param {function():!Promise} onAbort
1365
- * Will be called by this object to abort the underlying operation. This
1366
- * is not cancelation, and will not necessarily result in any work being
1367
- * undone. abort() should return a Promise which is resolved when the
1368
- * underlying operation has been aborted. The returned Promise should
1369
- * never be rejected.
1370
- * @param {shaka.net.NetworkingEngine.NumBytesRemainingClass}
1371
- * numBytesRemainingObj
1221
+ * Detaches all event listeners from all targets.
1372
1222
  */
1373
- constructor(promise, onAbort, numBytesRemainingObj) {}
1374
- };
1375
- /**
1376
- * Request types. Allows a filter to decide which requests to read/alter.
1377
- * @enum {number}
1378
- */
1379
- shaka.net.NetworkingEngine.RequestType = {
1380
- 'MANIFEST': 0,
1381
- 'SEGMENT': 1,
1382
- 'LICENSE': 2,
1383
- 'APP': 3,
1384
- 'TIMING': 4
1223
+ removeAll() {}
1385
1224
  };
1386
1225
  /**
1387
- * Priority level for network scheme plugins.
1388
- * If multiple plugins are provided for the same scheme, only the
1389
- * highest-priority one is used.
1390
- * @enum {number}
1226
+ * @typedef {function(!Event)}
1391
1227
  */
1392
- shaka.net.NetworkingEngine.PluginPriority = {
1393
- 'FALLBACK': 1,
1394
- 'PREFERRED': 2,
1395
- 'APPLICATION': 3
1396
- };
1228
+ shaka.util.EventManager.ListenerType;
1397
1229
  /**
1398
1230
  * @summary A set of FairPlay utility functions.
1399
1231
  */
@@ -1447,6 +1279,176 @@ shaka.media.ManifestParser = class {
1447
1279
  */
1448
1280
  static unregisterParserByMime(mimeType) {}
1449
1281
  };
1282
+ /**
1283
+ * @summary DataViewReader abstracts a DataView object.
1284
+ */
1285
+ shaka.util.DataViewReader = class {
1286
+ /**
1287
+ * @param {BufferSource} data
1288
+ * @param {shaka.util.DataViewReader.Endianness} endianness The endianness.
1289
+ */
1290
+ constructor(data, endianness) {}
1291
+ /**
1292
+ * @return {boolean} True if the reader has more data, false otherwise.
1293
+ */
1294
+ hasMoreData() {}
1295
+ /**
1296
+ * Gets the current byte position.
1297
+ * @return {number}
1298
+ */
1299
+ getPosition() {}
1300
+ /**
1301
+ * Gets the byte length of the DataView.
1302
+ * @return {number}
1303
+ */
1304
+ getLength() {}
1305
+ /**
1306
+ * Reads an unsigned 8 bit integer, and advances the reader.
1307
+ * @return {number} The integer.
1308
+ */
1309
+ readUint8() {}
1310
+ /**
1311
+ * Reads an unsigned 16 bit integer, and advances the reader.
1312
+ * @return {number} The integer.
1313
+ */
1314
+ readUint16() {}
1315
+ /**
1316
+ * Reads an unsigned 32 bit integer, and advances the reader.
1317
+ * @return {number} The integer.
1318
+ */
1319
+ readUint32() {}
1320
+ /**
1321
+ * Reads a signed 32 bit integer, and advances the reader.
1322
+ * @return {number} The integer.
1323
+ */
1324
+ readInt32() {}
1325
+ /**
1326
+ * Reads an unsigned 64 bit integer, and advances the reader.
1327
+ * @return {number} The integer.
1328
+ */
1329
+ readUint64() {}
1330
+ /**
1331
+ * Reads the specified number of raw bytes.
1332
+ * @param {number} bytes The number of bytes to read.
1333
+ * @return {!Uint8Array}
1334
+ */
1335
+ readBytes(bytes) {}
1336
+ /**
1337
+ * Skips the specified number of bytes.
1338
+ * @param {number} bytes The number of bytes to skip.
1339
+ */
1340
+ skip(bytes) {}
1341
+ /**
1342
+ * Rewinds the specified number of bytes.
1343
+ * @param {number} bytes The number of bytes to rewind.
1344
+ */
1345
+ rewind(bytes) {}
1346
+ /**
1347
+ * Seeks to a specified position.
1348
+ * @param {number} position The desired byte position within the DataView.
1349
+ */
1350
+ seek(position) {}
1351
+ /**
1352
+ * Keeps reading until it reaches a byte that equals to zero. The text is
1353
+ * assumed to be UTF-8.
1354
+ * @return {string}
1355
+ */
1356
+ readTerminatedString() {}
1357
+ };
1358
+ /**
1359
+ * Endianness.
1360
+ * @enum {number}
1361
+ */
1362
+ shaka.util.DataViewReader.Endianness = {
1363
+ 'BIG_ENDIAN': 0,
1364
+ 'LITTLE_ENDIAN': 1
1365
+ };
1366
+ /**
1367
+ */
1368
+ shaka.util.Mp4Parser = class {
1369
+ /** */
1370
+ constructor() {}
1371
+ /**
1372
+ * Declare a box type as a Box.
1373
+ * @param {string} type
1374
+ * @param {!shaka.util.Mp4Parser.CallbackType} definition
1375
+ * @return {!shaka.util.Mp4Parser}
1376
+ */
1377
+ box(type, definition) {}
1378
+ /**
1379
+ * Declare a box type as a Full Box.
1380
+ * @param {string} type
1381
+ * @param {!shaka.util.Mp4Parser.CallbackType} definition
1382
+ * @return {!shaka.util.Mp4Parser}
1383
+ */
1384
+ fullBox(type, definition) {}
1385
+ /**
1386
+ * Stop parsing. Useful for extracting information from partial segments and
1387
+ * avoiding an out-of-bounds error once you find what you are looking for.
1388
+ */
1389
+ stop() {}
1390
+ /**
1391
+ * Parse the given data using the added callbacks.
1392
+ * @param {!BufferSource} data
1393
+ * @param {boolean=} partialOkay If true, allow reading partial payloads
1394
+ * from some boxes. If the goal is a child box, we can sometimes find it
1395
+ * without enough data to find all child boxes.
1396
+ * @param {boolean=} stopOnPartial If true, stop reading if an incomplete
1397
+ * box is detected.
1398
+ */
1399
+ parse(data, partialOkay, stopOnPartial) {}
1400
+ /**
1401
+ * Parse the next box on the current level.
1402
+ * @param {number} absStart The absolute start position in the original
1403
+ * byte array.
1404
+ * @param {!shaka.util.DataViewReader} reader
1405
+ * @param {boolean=} partialOkay If true, allow reading partial payloads
1406
+ * from some boxes. If the goal is a child box, we can sometimes find it
1407
+ * without enough data to find all child boxes.
1408
+ * @param {boolean=} stopOnPartial If true, stop reading if an incomplete
1409
+ * box is detected.
1410
+ */
1411
+ parseNext(absStart, reader, partialOkay, stopOnPartial) {}
1412
+ /**
1413
+ * A callback that tells the Mp4 parser to treat the body of a box as a series
1414
+ * of boxes. The number of boxes is limited by the size of the parent box.
1415
+ * @param {!shaka.extern.ParsedBox} box
1416
+ */
1417
+ static children(box) {}
1418
+ /**
1419
+ * A callback that tells the Mp4 parser to treat the body of a box as a sample
1420
+ * description. A sample description box has a fixed number of children. The
1421
+ * number of children is represented by a 4 byte unsigned integer. Each child
1422
+ * is a box.
1423
+ * @param {!shaka.extern.ParsedBox} box
1424
+ */
1425
+ static sampleDescription(box) {}
1426
+ /**
1427
+ * Create a callback that tells the Mp4 parser to treat the body of a box as a
1428
+ * binary blob and to parse the body's contents using the provided callback.
1429
+ * @param {function(!Uint8Array)} callback
1430
+ * @return {!shaka.util.Mp4Parser.CallbackType}
1431
+ */
1432
+ static allData(callback) {}
1433
+ /**
1434
+ * Convert an integer type from a box into an ascii string name.
1435
+ * Useful for debugging.
1436
+ * @param {number} type The type of the box, a uint32.
1437
+ * @return {string}
1438
+ */
1439
+ static typeToString(type) {}
1440
+ /**
1441
+ * Find the header size of the box.
1442
+ * Useful for modifying boxes in place or finding the exact offset of a field.
1443
+ * @param {shaka.extern.ParsedBox} box
1444
+ * @return {number}
1445
+ */
1446
+ static headerSize(box) {}
1447
+ };
1448
+ /**
1449
+ * @typedef {function(!shaka.extern.ParsedBox)}
1450
+ */
1451
+ shaka.util.Mp4Parser.CallbackType;
1450
1452
  /**
1451
1453
  * Creates an InitSegmentReference, which provides the location to an
1452
1454
  * initialization segment.
@@ -1517,9 +1519,13 @@ shaka.media.SegmentReference = class {
1517
1519
  * presentation. Any content from after this time will be removed by
1518
1520
  * MediaSource.
1519
1521
  * @param {!Array.<!shaka.media.SegmentReference>=} partialReferences
1520
- A list of SegmentReferences for the partial segments.
1522
+ * A list of SegmentReferences for the partial segments.
1523
+ * @param {?string=} tilesLayout
1524
+ * The value is a grid-item-dimension consisting of two positive decimal
1525
+ * integers in the format: column-x-row ('4x3'). It describes the
1526
+ * arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
1521
1527
  */
1522
- constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences) {}
1528
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout) {}
1523
1529
  /**
1524
1530
  * Creates and returns the URIs of the resource containing the segment.
1525
1531
  * @return {!Array.<string>}
@@ -1548,6 +1554,11 @@ shaka.media.SegmentReference = class {
1548
1554
  * @return {?number}
1549
1555
  */
1550
1556
  getEndByte() {}
1557
+ /**
1558
+ * Returns the segment's tiles layout. Only defined in image segments.
1559
+ * @return {?string}
1560
+ */
1561
+ getTilesLayout() {}
1551
1562
  };
1552
1563
  /**
1553
1564
  * PresentationTimeline.
@@ -2169,6 +2180,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2169
2180
  * @return {shaka.extern.PlayerConfiguration}
2170
2181
  */
2171
2182
  getConfiguration() {}
2183
+ /**
2184
+ * Returns the ratio of video length buffered compared to buffering Goal
2185
+ * @return {number}
2186
+ */
2187
+ getBufferFullness() {}
2172
2188
  /**
2173
2189
  * Reset configuration to default.
2174
2190
  */
@@ -2231,6 +2247,10 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2231
2247
  * @return {{start: number, end: number}}
2232
2248
  */
2233
2249
  seekRange() {}
2250
+ /**
2251
+ * Go to live in a live stream.
2252
+ */
2253
+ goToLive() {}
2234
2254
  /**
2235
2255
  * Get the key system currently used by EME. If EME is not being used, this
2236
2256
  * will return an empty string. If the player has not loaded content, this
@@ -2412,6 +2432,17 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2412
2432
  * @return {boolean}
2413
2433
  */
2414
2434
  isTextTrackVisible() {}
2435
+ /**
2436
+ * Return a list of chapters tracks.
2437
+ * @return {!Array.<shaka.extern.Track>}
2438
+ */
2439
+ getChaptersTracks() {}
2440
+ /**
2441
+ * This returns the list of chapters.
2442
+ * @param {string} language
2443
+ * @return {!Array.<shaka.extern.Chapter>}
2444
+ */
2445
+ getChapters(language) {}
2415
2446
  /**
2416
2447
  * Enable or disable the text displayer. If the player is in an unloaded
2417
2448
  * state, the request will be applied next time content is loaded.
@@ -2475,6 +2506,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2475
2506
  * @return {!Promise.<shaka.extern.Track>}
2476
2507
  */
2477
2508
  addTextTrackAsync(uri, language, kind, mimeType, codec, label, forced) {}
2509
+ /**
2510
+ * Adds the given chapters track to the loaded manifest. <code>load()</code>
2511
+ * must resolve before calling. The presentation must have a duration.
2512
+ * This returns the created track.
2513
+ * @param {string} uri
2514
+ * @param {string} language
2515
+ * @param {string=} mimeType
2516
+ * @return {!Promise.<shaka.extern.Track>}
2517
+ */
2518
+ addChaptersTrack(uri, language, mimeType) {}
2478
2519
  /**
2479
2520
  * Set the maximum resolution that the platform's hardware can handle.
2480
2521
  * This will be called automatically by <code>shaka.cast.CastReceiver</code>
@@ -2747,6 +2788,11 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
2747
2788
  * @override
2748
2789
  */
2749
2790
  replaceServerSideAdTagParameters(adTagParameters) {}
2791
+ /**
2792
+ * @return {!Array.<!shaka.extern.AdCuePoint>}
2793
+ * @override
2794
+ */
2795
+ getServerSideCuePoints() {}
2750
2796
  /**
2751
2797
  * @return {shaka.extern.AdsStats}
2752
2798
  * @override
@@ -3362,6 +3408,20 @@ shaka.polyfill = class {
3362
3408
  */
3363
3409
  static register(polyfill, priority) {}
3364
3410
  };
3411
+ /**
3412
+ * @summary A polyfill to add support for the ARIAMixin interface mixin, for
3413
+ * browsers that do not implement it (e.g. Firefox).
3414
+ * Note that IE also does not support ARIAMixin, but this polyfill does not work
3415
+ * for that platform, as it relies on getters and setters.
3416
+ * @see https://w3c.github.io/aria/#ARIAMixin
3417
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element
3418
+ */
3419
+ shaka.polyfill.Aria = class {
3420
+ /**
3421
+ * Install the polyfill if needed.
3422
+ */
3423
+ static install() {}
3424
+ };
3365
3425
  /**
3366
3426
  * @summary A polyfill to add support for EncryptionScheme queries in EME.
3367
3427
  * @see https://wicg.github.io/encrypted-media-encryption-scheme/
@@ -3623,8 +3683,8 @@ shaka.text.SrtTextParser = class {
3623
3683
  parseMedia(data, time) {}
3624
3684
  /**
3625
3685
  * Convert a SRT format to WebVTT
3626
- * @param {!string} data
3627
- * @return {!string}
3686
+ * @param {string} data
3687
+ * @return {string}
3628
3688
  */
3629
3689
  static srt2webvtt(data) {}
3630
3690
  };