ravnur-player-public 3.4.2 → 3.4.4

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 (262) hide show
  1. package/.eslintignore +7 -0
  2. package/.eslintrc.js +206 -0
  3. package/.flowconfig +3 -0
  4. package/.vscode/extensions.json +7 -0
  5. package/.vscode/launch.json +37 -0
  6. package/.vscode/settings.json +4 -0
  7. package/README-Private.md +54 -0
  8. package/babel.config.js +28 -0
  9. package/bitbucket-pipelines.yml +61 -0
  10. package/cert.pem +23 -0
  11. package/demo/BaseM.mp4 +0 -0
  12. package/demo/HD.mp4 +0 -0
  13. package/demo/annotations.json +50 -0
  14. package/demo/annotations_ge.json +50 -0
  15. package/demo/base.mp3 +0 -0
  16. package/demo/cc_2125en.vtt +4958 -0
  17. package/demo/cc_en.vtt +171 -0
  18. package/demo/cc_ge.vtt +178 -0
  19. package/demo/chapters_en.vtt +38 -0
  20. package/demo/chapters_ge.vtt +5 -0
  21. package/demo/chapters_ge1.json +23 -0
  22. package/demo/hls/audio/stereo/en/128kbit.m3u8 +912 -0
  23. package/demo/hls/audio/stereo/none/128kbit.m3u8 +912 -0
  24. package/demo/hls/audio/surround/en/320kbit.m3u8 +912 -0
  25. package/demo/hls/playlist.m3u8 +31 -0
  26. package/demo/hls/video/10000kbit.m3u8 +894 -0
  27. package/demo/hls/video/1100kbit.m3u8 +894 -0
  28. package/demo/hls/video/1500kbit.m3u8 +894 -0
  29. package/demo/hls/video/250kbit.m3u8 +894 -0
  30. package/demo/hls/video/4000kbit.m3u8 +894 -0
  31. package/demo/hls/video/500kbit.m3u8 +894 -0
  32. package/demo/hls/video/6000kbit.m3u8 +894 -0
  33. package/demo/hls/video/800kbit.m3u8 +894 -0
  34. package/demo/hls.js +5 -0
  35. package/demo/hls.js.map +1 -0
  36. package/demo/hls.min.js +2 -0
  37. package/demo/hls.min.js.map +1 -0
  38. package/demo/playlist.m3u8 +31 -0
  39. package/demo/ravnur-flash-audio.swf +0 -0
  40. package/demo/ravnur-flash-video-hls.swf +0 -0
  41. package/demo/ravnur-flash-video.swf +0 -0
  42. package/demo/shaka/shaka-player.foo.debug.d.ts +4532 -0
  43. package/demo/shaka/shaka-player.foo.debug.externs.js +3886 -0
  44. package/demo/shaka/shaka-player.foo.debug.js +1746 -0
  45. package/demo/shaka/shaka-player.foo.debug.map +8 -0
  46. package/demo/shaka/wrapper.js +7 -0
  47. package/demo/test.html +458 -0
  48. package/dist/RavnurMediaPlayer.min.js +1 -1
  49. package/dist/cdn/RavnurMediaPlayer.min.js +1 -1
  50. package/jest.config.js +4 -0
  51. package/key.pem +27 -0
  52. package/lib/es5.js +344 -0
  53. package/lib/images/Spinner-small.gif +0 -0
  54. package/lib/images/close.png +0 -0
  55. package/lib/images/ic_check_box_black_24dp_1x.png +0 -0
  56. package/lib/images/ic_check_box_outline_blank_black_24dp_1x.png +0 -0
  57. package/lib/images/ic_chevron_left_white_24dp_1x.png +0 -0
  58. package/lib/images/ic_chevron_right_white_24dp_1x.png +0 -0
  59. package/lib/images/ic_closed_caption_white_24dp_1x.png +0 -0
  60. package/lib/images/ic_fast_forward_white_24dp_1x.png +0 -0
  61. package/lib/images/ic_fast_rewind_white_24dp_1x.png +0 -0
  62. package/lib/images/ic_fullscreen_exit_white_24dp_1x.png +0 -0
  63. package/lib/images/ic_fullscreen_white_24dp_1x.png +0 -0
  64. package/lib/images/ic_hd_white_24dp_1x.png +0 -0
  65. package/lib/images/ic_keyboard_arrow_left_black_24dp_1x.png +0 -0
  66. package/lib/images/ic_keyboard_arrow_right_black_24dp_1x.png +0 -0
  67. package/lib/images/ic_pause_white_24dp_1x.png +0 -0
  68. package/lib/images/ic_photo_white_24dp_1x.png +0 -0
  69. package/lib/images/ic_play_arrow_white_24dp_1x.png +0 -0
  70. package/lib/images/ic_refresh_white_24dp_1x.png +0 -0
  71. package/lib/images/ic_settings_white_24dp_1x.png +0 -0
  72. package/lib/images/ic_skip_next_white_24dp_1x.png +0 -0
  73. package/lib/images/ic_skip_previous_white_24dp_1x.png +0 -0
  74. package/lib/images/ic_toc_white_24dp_1x.png +0 -0
  75. package/lib/images/ic_volume_off_white_24dp_1x.png +0 -0
  76. package/lib/images/ic_volume_up_white_24dp_1x.png +0 -0
  77. package/lib/player4ie8.css +225 -0
  78. package/package.json +1 -5
  79. package/server.js +29 -0
  80. package/src/config/cc.js +56 -0
  81. package/src/config/i18n.js +101 -0
  82. package/src/config/options.js +123 -0
  83. package/src/config/playlist.js +9 -0
  84. package/src/config/source.js +23 -0
  85. package/src/config/statuses.js +8 -0
  86. package/src/config/styles.js +16 -0
  87. package/src/entity.js +27 -0
  88. package/src/events.js +5 -0
  89. package/src/extensions/annotations.js +142 -0
  90. package/src/extensions/audio-tarcks.js +115 -0
  91. package/src/extensions/backward.js +45 -0
  92. package/src/extensions/base.js +73 -0
  93. package/src/extensions/bottom-next.js +50 -0
  94. package/src/extensions/bottom-prev.js +50 -0
  95. package/src/extensions/buffering.js +78 -0
  96. package/src/extensions/c2pa.js +350 -0
  97. package/src/extensions/caption-search.js +230 -0
  98. package/src/extensions/cc.js +874 -0
  99. package/src/extensions/crawl.js +118 -0
  100. package/src/extensions/download.js +411 -0
  101. package/src/extensions/error.js +47 -0
  102. package/src/extensions/forward.js +44 -0
  103. package/src/extensions/fullscreen.js +84 -0
  104. package/src/extensions/help.js +201 -0
  105. package/src/extensions/helpers/FileSaver.js +157 -0
  106. package/src/extensions/helpers/clickOpener.js +180 -0
  107. package/src/extensions/helpers/opener.js +30 -0
  108. package/src/extensions/helpers/openerHeightChecker.js +13 -0
  109. package/src/extensions/helpers/popover.js +33 -0
  110. package/src/extensions/helpers/popoverPosition.js +30 -0
  111. package/src/extensions/helpers/scrollIntoView.js +9 -0
  112. package/src/extensions/helpers/storage.js +20 -0
  113. package/src/extensions/helpers/textContent.js +6 -0
  114. package/src/extensions/helpers/timeCodeToSeconds.js +44 -0
  115. package/src/extensions/helpers/transport.js +43 -0
  116. package/src/extensions/helpers/vtt-loader.js +42 -0
  117. package/src/extensions/index.js +87 -0
  118. package/src/extensions/live.js +76 -0
  119. package/src/extensions/mux.js +57 -0
  120. package/src/extensions/next-frame.js +44 -0
  121. package/src/extensions/next.js +48 -0
  122. package/src/extensions/placeholder.js +241 -0
  123. package/src/extensions/play.js +102 -0
  124. package/src/extensions/poster.js +47 -0
  125. package/src/extensions/prev-frame.js +44 -0
  126. package/src/extensions/prev.js +48 -0
  127. package/src/extensions/progress.js +465 -0
  128. package/src/extensions/resizer.js +37 -0
  129. package/src/extensions/settings.js +367 -0
  130. package/src/extensions/theater.js +56 -0
  131. package/src/extensions/title.js +38 -0
  132. package/src/extensions/toc.js +334 -0
  133. package/src/extensions/volume.js +196 -0
  134. package/src/flash/FlashPlugin.js +301 -0
  135. package/src/flash/MediaElement.js +361 -0
  136. package/src/flash/plugins.js +32 -0
  137. package/src/flash-detector.js +66 -0
  138. package/src/helpers/$t.js +10 -0
  139. package/src/helpers/binder.js +11 -0
  140. package/src/helpers/isAndroid.js +5 -0
  141. package/src/helpers/isBlackBerry.js +5 -0
  142. package/src/helpers/isCanvasSupported.js +6 -0
  143. package/src/helpers/isIE.js +21 -0
  144. package/src/helpers/isMobile.js +10 -0
  145. package/src/helpers/isWindows.js +5 -0
  146. package/src/helpers/isWindowsPhone.js +5 -0
  147. package/src/helpers/isiOS.js +5 -0
  148. package/src/html5media.js +19 -0
  149. package/src/index.js +2 -0
  150. package/src/logger.js +31 -0
  151. package/src/microevent.js +65 -0
  152. package/src/normalize-options.js +139 -0
  153. package/src/player.js +864 -0
  154. package/src/players/base.js +209 -0
  155. package/src/players/flash.js +172 -0
  156. package/src/players/hls.js +278 -0
  157. package/src/players/html.js +205 -0
  158. package/src/players/index.js +59 -0
  159. package/src/players/shaka.js +219 -0
  160. package/src/playlist.js +362 -0
  161. package/src/screenfull.js +121 -0
  162. package/src/state.js +474 -0
  163. package/src/static/es5.js +344 -0
  164. package/src/static/images/Spinner-small.gif +0 -0
  165. package/src/static/images/close.png +0 -0
  166. package/src/static/images/ic_check_box_black_24dp_1x.png +0 -0
  167. package/src/static/images/ic_check_box_outline_blank_black_24dp_1x.png +0 -0
  168. package/src/static/images/ic_chevron_left_white_24dp_1x.png +0 -0
  169. package/src/static/images/ic_chevron_right_white_24dp_1x.png +0 -0
  170. package/src/static/images/ic_closed_caption_white_24dp_1x.png +0 -0
  171. package/src/static/images/ic_fast_forward_white_24dp_1x.png +0 -0
  172. package/src/static/images/ic_fast_rewind_white_24dp_1x.png +0 -0
  173. package/src/static/images/ic_fullscreen_exit_white_24dp_1x.png +0 -0
  174. package/src/static/images/ic_fullscreen_white_24dp_1x.png +0 -0
  175. package/src/static/images/ic_hd_white_24dp_1x.png +0 -0
  176. package/src/static/images/ic_keyboard_arrow_left_black_24dp_1x.png +0 -0
  177. package/src/static/images/ic_keyboard_arrow_right_black_24dp_1x.png +0 -0
  178. package/src/static/images/ic_pause_white_24dp_1x.png +0 -0
  179. package/src/static/images/ic_play_arrow_white_24dp_1x.png +0 -0
  180. package/src/static/images/ic_refresh_white_24dp_1x.png +0 -0
  181. package/src/static/images/ic_settings_white_24dp_1x.png +0 -0
  182. package/src/static/images/ic_skip_next_white_24dp_1x.png +0 -0
  183. package/src/static/images/ic_skip_previous_white_24dp_1x.png +0 -0
  184. package/src/static/images/ic_toc_white_24dp_1x.png +0 -0
  185. package/src/static/images/ic_volume_off_white_24dp_1x.png +0 -0
  186. package/src/static/images/ic_volume_up_white_24dp_1x.png +0 -0
  187. package/src/static/player4ie8.css +225 -0
  188. package/src/styles/bplaylist.css.js +124 -0
  189. package/src/styles/index.js +1966 -0
  190. package/src/styles/playlist.css.js +84 -0
  191. package/src/styles/rplaylist.css.js +98 -0
  192. package/src/svgs.js +111 -0
  193. package/src/types/Logger.js +10 -0
  194. package/src/types/Options.js +179 -0
  195. package/src/types/Playlist.js +3 -0
  196. package/src/types/Source.js +28 -0
  197. package/src/types/State.js +46 -0
  198. package/src/types/Styles.js +11 -0
  199. package/src/types/TimeData.js +8 -0
  200. package/src/types/Translation.js +69 -0
  201. package/src/utils/absolutizeUrl.js +9 -0
  202. package/src/utils/addClass.js +9 -0
  203. package/src/utils/addEvent.js +31 -0
  204. package/src/utils/addProperty.js +65 -0
  205. package/src/utils/appendChild.js +14 -0
  206. package/src/utils/buff2hex.js +5 -0
  207. package/src/utils/contains.js +33 -0
  208. package/src/utils/createElement.js +24 -0
  209. package/src/utils/each.js +34 -0
  210. package/src/utils/escapeHTML.js +8 -0
  211. package/src/utils/existy.js +4 -0
  212. package/src/utils/extend.js +17 -0
  213. package/src/utils/filter.js +16 -0
  214. package/src/utils/find.js +11 -0
  215. package/src/utils/findIndex.js +20 -0
  216. package/src/utils/first.js +5 -0
  217. package/src/utils/get.js +19 -0
  218. package/src/utils/has.js +5 -0
  219. package/src/utils/hasClass.js +6 -0
  220. package/src/utils/head.js +11 -0
  221. package/src/utils/inRange.js +16 -0
  222. package/src/utils/index.js +73 -0
  223. package/src/utils/isArray.js +4 -0
  224. package/src/utils/isBoolean.js +3 -0
  225. package/src/utils/isElement.js +7 -0
  226. package/src/utils/isEmpty.js +6 -0
  227. package/src/utils/isEqual.js +33 -0
  228. package/src/utils/isEqualBuffer.js +13 -0
  229. package/src/utils/isFunction.js +3 -0
  230. package/src/utils/isNotEmpty.js +5 -0
  231. package/src/utils/isObject.js +5 -0
  232. package/src/utils/isString.js +9 -0
  233. package/src/utils/last.js +4 -0
  234. package/src/utils/map.js +11 -0
  235. package/src/utils/negate.js +8 -0
  236. package/src/utils/noop.js +1 -0
  237. package/src/utils/notExisty.js +5 -0
  238. package/src/utils/reduce.js +8 -0
  239. package/src/utils/remove.js +7 -0
  240. package/src/utils/removeClass.js +8 -0
  241. package/src/utils/removeEvent.js +7 -0
  242. package/src/utils/toArray.js +7 -0
  243. package/src/utils/toggleClass.js +16 -0
  244. package/src/utils/uidGenerator.js +8 -0
  245. package/src/utils/upperFirst.js +4 -0
  246. package/tests/extensions/__snapshots__/download.spec.js.snap +226 -0
  247. package/tests/extensions/__snapshots__/fullscreen.spec.js.snap +30 -0
  248. package/tests/extensions/__snapshots__/title.spec.js.snap +16 -0
  249. package/tests/extensions/download.spec.js +111 -0
  250. package/tests/extensions/fullscreen.spec.js +56 -0
  251. package/tests/extensions/title.spec.js +35 -0
  252. package/tests/mocks/assets/BaseM.mp4 +0 -0
  253. package/tests/mocks/assets/hls.min.js +5 -0
  254. package/tests/mocks/assets/styleMock.js +1 -0
  255. package/tests/mocks/base-player-options.js +47 -0
  256. package/tests/mocks/sources.js +58 -0
  257. package/tests/mocks/timedata/cc_en.vtt +171 -0
  258. package/tests/mocks/timedata/cc_ge.vtt +178 -0
  259. package/tests/utils/wait.js +1 -0
  260. package/webpack.config.js +78 -0
  261. package/dist/.DS_Store +0 -0
  262. package/dist/cdn/.DS_Store +0 -0
@@ -0,0 +1,3886 @@
1
+ /*! @license
2
+ * Shaka Player
3
+ * Copyright 2016 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * @fileoverview Generated externs. DO NOT EDIT!
8
+ * @externs
9
+ * @suppress {duplicate} To prevent compiler errors with the
10
+ * namespace being declared both here and by goog.provide in the
11
+ * library.
12
+ */
13
+
14
+ /** @namespace */
15
+ window.shaka = {};
16
+ /** @const */
17
+ shaka.abr = {};
18
+ /** @const */
19
+ shaka.config = {};
20
+ /** @const */
21
+ shaka.dash = {};
22
+ /** @const */
23
+ shaka.lcevc = {};
24
+ /** @const */
25
+ shaka.media = {};
26
+ /** @const */
27
+ shaka.media.SegmentPrefetch = {};
28
+ /** @const */
29
+ shaka.net = {};
30
+ /** @const */
31
+ shaka.text = {};
32
+ /** @const */
33
+ shaka.transmuxer = {};
34
+ /** @const */
35
+ shaka.util = {};
36
+ /** @const */
37
+ shaka.util.CmcdManager = {};
38
+
39
+ /**
40
+ * An interface to standardize how objects release internal references
41
+ * synchronously. If an object needs to asynchronously release references, then
42
+ * it should use 'shaka.util.IDestroyable'.
43
+ * @interface
44
+ */
45
+ shaka.util.IReleasable = class {
46
+ /**
47
+ * Request that this object release all internal references.
48
+ */
49
+ release() {}
50
+ };
51
+ /**
52
+ * @summary
53
+ * An EventManager maintains a collection of "event
54
+ * bindings" between event targets and event listeners.
55
+ * @implements {shaka.util.IReleasable}
56
+ */
57
+ shaka.util.EventManager = class {
58
+ /** */
59
+ constructor() {}
60
+ /**
61
+ * Detaches all event listeners.
62
+ * @override
63
+ */
64
+ release() {}
65
+ /**
66
+ * Attaches an event listener to an event target.
67
+ * @param {EventTarget} target The event target.
68
+ * @param {string} type The event type.
69
+ * @param {shaka.util.EventManager.ListenerType} listener The event listener.
70
+ * @param {(boolean|!AddEventListenerOptions)=} options An object that
71
+ * specifies characteristics about the event listener.
72
+ * The passive option, if true, indicates that this function will never
73
+ * call preventDefault(), which improves scrolling performance.
74
+ */
75
+ listen(target, type, listener, options) {}
76
+ /**
77
+ * Attaches an event listener to an event target. The listener will be
78
+ * removed when the first instance of the event is fired.
79
+ * @param {EventTarget} target The event target.
80
+ * @param {string} type The event type.
81
+ * @param {shaka.util.EventManager.ListenerType} listener The event listener.
82
+ * @param {(boolean|!AddEventListenerOptions)=} options An object that
83
+ * specifies characteristics about the event listener.
84
+ * The passive option, if true, indicates that this function will never
85
+ * call preventDefault(), which improves scrolling performance.
86
+ */
87
+ listenOnce(target, type, listener, options) {}
88
+ /**
89
+ * Detaches an event listener from an event target.
90
+ * @param {EventTarget} target The event target.
91
+ * @param {string} type The event type.
92
+ * @param {shaka.util.EventManager.ListenerType=} listener The event listener.
93
+ */
94
+ unlisten(target, type, listener) {}
95
+ /**
96
+ * Detaches all event listeners from all targets.
97
+ */
98
+ removeAll() {}
99
+ };
100
+ /**
101
+ * @typedef {function(!Event)}
102
+ */
103
+ shaka.util.EventManager.ListenerType;
104
+ /**
105
+ * @summary A set of BufferSource utility functions.
106
+ */
107
+ shaka.util.BufferUtils = class {
108
+ /**
109
+ * Compare two buffers for equality. For buffers of different types, this
110
+ * compares the underlying buffers as binary data.
111
+ * @param {?BufferSource} arr1
112
+ * @param {?BufferSource} arr2
113
+ * @return {boolean}
114
+ * @suppress {strictMissingProperties}
115
+ */
116
+ static equal(arr1, arr2) {}
117
+ /**
118
+ * Gets an ArrayBuffer that contains the data from the given TypedArray. Note
119
+ * this will allocate a new ArrayBuffer if the object is a partial view of
120
+ * the data.
121
+ * @param {!BufferSource} view
122
+ * @return {!ArrayBuffer}
123
+ */
124
+ static toArrayBuffer(view) {}
125
+ /**
126
+ * Creates a new Uint8Array view on the same buffer. This clamps the values
127
+ * to be within the same view (i.e. you can't use this to move past the end
128
+ * of the view, even if the underlying buffer is larger). However, you can
129
+ * pass a negative offset to access the data before the view.
130
+ * @param {BufferSource} data
131
+ * @param {number=} offset The offset from the beginning of this data's view
132
+ * to start the new view at.
133
+ * @param {number=} length The byte length of the new view.
134
+ * @return {!Uint8Array}
135
+ */
136
+ static toUint8(data, offset, length) {}
137
+ /**
138
+ * Creates a new Uint16Array view on the same buffer. This clamps the values
139
+ * to be within the same view (i.e. you can't use this to move past the end
140
+ * of the view, even if the underlying buffer is larger). However, you can
141
+ * pass a negative offset to access the data before the view.
142
+ * @param {BufferSource} data
143
+ * @param {number=} offset The offset from the beginning of this data's view
144
+ * to start the new view at.
145
+ * @param {number=} length The byte length of the new view.
146
+ * @return {!Uint16Array}
147
+ */
148
+ static toUint16(data, offset, length) {}
149
+ /**
150
+ * Creates a DataView over the given buffer.
151
+ * @see toUint8
152
+ * @param {BufferSource} buffer
153
+ * @param {number=} offset
154
+ * @param {number=} length
155
+ * @return {!DataView}
156
+ */
157
+ static toDataView(buffer, offset, length) {}
158
+ };
159
+ /**
160
+ * The IClosedCaptionParser defines the interface to provide all operations for
161
+ * parsing the closed captions embedded in Dash videos streams.
162
+ * TODO: Remove this interface and move method definitions
163
+ * directly to ClosedCaptonParser.
164
+ * @interface
165
+ */
166
+ shaka.media.IClosedCaptionParser = class {
167
+ };
168
+ /**
169
+ * Closed Caption Parser provides all operations for parsing the closed captions
170
+ * embedded in Dash videos streams.
171
+ * @implements {shaka.media.IClosedCaptionParser}
172
+ * @final
173
+ */
174
+ shaka.media.ClosedCaptionParser = class {
175
+ /**
176
+ * @param {string} mimeType
177
+ */
178
+ constructor(mimeType) {}
179
+ /**
180
+ * @param {string} mimeType
181
+ * @param {!shaka.extern.CeaParserPlugin} plugin
182
+ */
183
+ static registerParser(mimeType, plugin) {}
184
+ /**
185
+ * @param {string} mimeType
186
+ */
187
+ static unregisterParser(mimeType) {}
188
+ /**
189
+ * @param {string} mimeType
190
+ * @return {?shaka.extern.CeaParserPlugin}
191
+ */
192
+ static findParser(mimeType) {}
193
+ /**
194
+ * @param {!shaka.extern.CaptionDecoderPlugin} plugin
195
+ */
196
+ static registerDecoder(plugin) {}
197
+ /**
198
+ */
199
+ static unregisterDecoder() {}
200
+ /**
201
+ * @return {?shaka.extern.CaptionDecoderPlugin}
202
+ */
203
+ static findDecoder() {}
204
+ };
205
+ /**
206
+ */
207
+ shaka.text.Cue = class {
208
+ /**
209
+ * @param {number} startTime
210
+ * @param {number} endTime
211
+ * @param {string} payload
212
+ */
213
+ constructor(startTime, endTime, payload) {}
214
+ /**
215
+ * Create a copy of the cue with the same properties.
216
+ * @return {!shaka.text.Cue}
217
+ * @suppress {checkTypes} since we must use [] and "in" with a struct type.
218
+ */
219
+ clone() {}
220
+ /**
221
+ * Check if two Cues have all the same values in all properties.
222
+ * @param {!shaka.text.Cue} cue1
223
+ * @param {!shaka.text.Cue} cue2
224
+ * @return {boolean}
225
+ * @suppress {checkTypes} since we must use [] and "in" with a struct type.
226
+ */
227
+ static equal(cue1, cue2) {}
228
+ };
229
+ /**
230
+ * The start time of the cue in seconds, relative to the start of the
231
+ * presentation.
232
+ * @type {number}
233
+ */
234
+ shaka.text.Cue.prototype.startTime;
235
+ /**
236
+ * The end time of the cue in seconds, relative to the start of the
237
+ * presentation.
238
+ * @type {number}
239
+ */
240
+ shaka.text.Cue.prototype.endTime;
241
+ /**
242
+ * The text payload of the cue. If nestedCues is non-empty, this should be
243
+ * empty. Top-level block containers should have no payload of their own.
244
+ * @type {string}
245
+ */
246
+ shaka.text.Cue.prototype.payload;
247
+ /**
248
+ * The region to render the cue into. Only supported on top-level cues,
249
+ * because nested cues are inline elements.
250
+ * @type {shaka.text.CueRegion}
251
+ */
252
+ shaka.text.Cue.prototype.region;
253
+ /**
254
+ * The indent (in percent) of the cue box in the direction defined by the
255
+ * writing direction.
256
+ * @type {?number}
257
+ */
258
+ shaka.text.Cue.prototype.position;
259
+ /**
260
+ * Position alignment of the cue.
261
+ * @type {shaka.text.Cue.positionAlign}
262
+ */
263
+ shaka.text.Cue.prototype.positionAlign;
264
+ /**
265
+ * Size of the cue box (in percents), where 0 means "auto".
266
+ * @type {number}
267
+ */
268
+ shaka.text.Cue.prototype.size;
269
+ /**
270
+ * Alignment of the text inside the cue box.
271
+ * @type {shaka.text.Cue.textAlign}
272
+ */
273
+ shaka.text.Cue.prototype.textAlign;
274
+ /**
275
+ * Text direction of the cue.
276
+ * @type {shaka.text.Cue.direction}
277
+ */
278
+ shaka.text.Cue.prototype.direction;
279
+ /**
280
+ * Text writing mode of the cue.
281
+ * @type {shaka.text.Cue.writingMode}
282
+ */
283
+ shaka.text.Cue.prototype.writingMode;
284
+ /**
285
+ * The way to interpret line field. (Either as an integer line number or
286
+ * percentage from the display box).
287
+ * @type {shaka.text.Cue.lineInterpretation}
288
+ */
289
+ shaka.text.Cue.prototype.lineInterpretation;
290
+ /**
291
+ * The offset from the display box in either number of lines or
292
+ * percentage depending on the value of lineInterpretation.
293
+ * @type {?number}
294
+ */
295
+ shaka.text.Cue.prototype.line;
296
+ /**
297
+ * Separation between line areas inside the cue box in px or em
298
+ * (e.g. '100px'/'100em'). If not specified, this should be no less than
299
+ * the largest font size applied to the text in the cue.
300
+ * @type {string}.
301
+ */
302
+ shaka.text.Cue.prototype.lineHeight;
303
+ /**
304
+ * Line alignment of the cue box.
305
+ * Start alignment means the cue box’s top side (for horizontal cues), left
306
+ * side (for vertical growing right), or right side (for vertical growing
307
+ * left) is aligned at the line.
308
+ * Center alignment means the cue box is centered at the line.
309
+ * End alignment The cue box’s bottom side (for horizontal cues), right side
310
+ * (for vertical growing right), or left side (for vertical growing left) is
311
+ * aligned at the line.
312
+ * @type {shaka.text.Cue.lineAlign}
313
+ */
314
+ shaka.text.Cue.prototype.lineAlign;
315
+ /**
316
+ * Vertical alignments of the cues within their extents.
317
+ * 'BEFORE' means displaying the captions at the top of the text display
318
+ * container box, 'CENTER' means in the middle, 'AFTER' means at the bottom.
319
+ * @type {shaka.text.Cue.displayAlign}
320
+ */
321
+ shaka.text.Cue.prototype.displayAlign;
322
+ /**
323
+ * Text color as a CSS color, e.g. "#FFFFFF" or "white".
324
+ * @type {string}
325
+ */
326
+ shaka.text.Cue.prototype.color;
327
+ /**
328
+ * Text background color as a CSS color, e.g. "#FFFFFF" or "white".
329
+ * @type {string}
330
+ */
331
+ shaka.text.Cue.prototype.backgroundColor;
332
+ /**
333
+ * The URL of the background image, e.g. "data:[mime type];base64,[data]".
334
+ * @type {string}
335
+ */
336
+ shaka.text.Cue.prototype.backgroundImage;
337
+ /**
338
+ * The border around this cue as a CSS border.
339
+ * @type {string}
340
+ */
341
+ shaka.text.Cue.prototype.border;
342
+ /**
343
+ * Text font size in px or em (e.g. '100px'/'100em').
344
+ * @type {string}
345
+ */
346
+ shaka.text.Cue.prototype.fontSize;
347
+ /**
348
+ * Text font weight. Either normal or bold.
349
+ * @type {shaka.text.Cue.fontWeight}
350
+ */
351
+ shaka.text.Cue.prototype.fontWeight;
352
+ /**
353
+ * Text font style. Normal, italic or oblique.
354
+ * @type {shaka.text.Cue.fontStyle}
355
+ */
356
+ shaka.text.Cue.prototype.fontStyle;
357
+ /**
358
+ * Text font family.
359
+ * @type {string}
360
+ */
361
+ shaka.text.Cue.prototype.fontFamily;
362
+ /**
363
+ * Text letter spacing as a CSS letter-spacing value.
364
+ * @type {string}
365
+ */
366
+ shaka.text.Cue.prototype.letterSpacing;
367
+ /**
368
+ * Text line padding as a CSS line-padding value.
369
+ * @type {string}
370
+ */
371
+ shaka.text.Cue.prototype.linePadding;
372
+ /**
373
+ * Opacity of the cue element, from 0-1.
374
+ * @type {number}
375
+ */
376
+ shaka.text.Cue.prototype.opacity;
377
+ /**
378
+ * Text combine upright as a CSS text-combine-upright value.
379
+ * @type {string}
380
+ */
381
+ shaka.text.Cue.prototype.textCombineUpright;
382
+ /**
383
+ * Text decoration. A combination of underline, overline
384
+ * and line through. Empty array means no decoration.
385
+ * @type {!Array.<!shaka.text.Cue.textDecoration>}
386
+ */
387
+ shaka.text.Cue.prototype.textDecoration;
388
+ /**
389
+ * Text shadow color as a CSS text-shadow value.
390
+ * @type {string}
391
+ */
392
+ shaka.text.Cue.prototype.textShadow;
393
+ /**
394
+ * Text stroke color as a CSS color, e.g. "#FFFFFF" or "white".
395
+ * @type {string}
396
+ */
397
+ shaka.text.Cue.prototype.textStrokeColor;
398
+ /**
399
+ * Text stroke width as a CSS stroke-width value.
400
+ * @type {string}
401
+ */
402
+ shaka.text.Cue.prototype.textStrokeWidth;
403
+ /**
404
+ * Whether or not line wrapping should be applied to the cue.
405
+ * @type {boolean}
406
+ */
407
+ shaka.text.Cue.prototype.wrapLine;
408
+ /**
409
+ * Id of the cue.
410
+ * @type {string}
411
+ */
412
+ shaka.text.Cue.prototype.id;
413
+ /**
414
+ * Nested cues, which should be laid out horizontally in one block.
415
+ * Top-level cues are blocks, and nested cues are inline elements.
416
+ * Cues can be nested arbitrarily deeply.
417
+ * @type {!Array.<!shaka.text.Cue>}
418
+ */
419
+ shaka.text.Cue.prototype.nestedCues;
420
+ /**
421
+ * If true, this represents a container element that is "above" the main
422
+ * cues. For example, the <body> and <div> tags that contain the <p> tags
423
+ * in a TTML file. This controls the flow of the final cues; any nested cues
424
+ * within an "isContainer" cue will be laid out as separate lines.
425
+ * @type {boolean}
426
+ */
427
+ shaka.text.Cue.prototype.isContainer;
428
+ /**
429
+ * Whether or not the cue only acts as a line break between two nested cues.
430
+ * Should only appear in nested cues.
431
+ * @type {boolean}
432
+ */
433
+ shaka.text.Cue.prototype.lineBreak;
434
+ /**
435
+ * Used to indicate the type of ruby tag that should be used when rendering
436
+ * the cue. Valid values: ruby, rp, rt.
437
+ * @type {?string}
438
+ */
439
+ shaka.text.Cue.prototype.rubyTag;
440
+ /**
441
+ * The number of horizontal and vertical cells into which the Root Container
442
+ * Region area is divided.
443
+ * @type {{ columns: number, rows: number }}
444
+ */
445
+ shaka.text.Cue.prototype.cellResolution;
446
+ /**
447
+ * @enum {string}
448
+ */
449
+ shaka.text.Cue.positionAlign = {
450
+ 'LEFT': 'line-left',
451
+ 'RIGHT': 'line-right',
452
+ 'CENTER': 'center',
453
+ 'AUTO': 'auto'
454
+ };
455
+ /**
456
+ * @enum {string}
457
+ */
458
+ shaka.text.Cue.textAlign = {
459
+ 'LEFT': 'left',
460
+ 'RIGHT': 'right',
461
+ 'CENTER': 'center',
462
+ 'START': 'start',
463
+ 'END': 'end'
464
+ };
465
+ /**
466
+ * Vertical alignments of the cues within their extents.
467
+ * 'BEFORE' means displaying at the top of the captions container box, 'CENTER'
468
+ * means in the middle, 'AFTER' means at the bottom.
469
+ * @enum {string}
470
+ */
471
+ shaka.text.Cue.displayAlign = {
472
+ 'BEFORE': 'before',
473
+ 'CENTER': 'center',
474
+ 'AFTER': 'after'
475
+ };
476
+ /**
477
+ * @enum {string}
478
+ */
479
+ shaka.text.Cue.direction = {
480
+ 'HORIZONTAL_LEFT_TO_RIGHT': 'ltr',
481
+ 'HORIZONTAL_RIGHT_TO_LEFT': 'rtl'
482
+ };
483
+ /**
484
+ * @enum {string}
485
+ */
486
+ shaka.text.Cue.writingMode = {
487
+ 'HORIZONTAL_TOP_TO_BOTTOM': 'horizontal-tb',
488
+ 'VERTICAL_LEFT_TO_RIGHT': 'vertical-lr',
489
+ 'VERTICAL_RIGHT_TO_LEFT': 'vertical-rl'
490
+ };
491
+ /**
492
+ * @enum {number}
493
+ */
494
+ shaka.text.Cue.lineInterpretation = {
495
+ 'LINE_NUMBER': 0,
496
+ 'PERCENTAGE': 1
497
+ };
498
+ /**
499
+ * @enum {string}
500
+ */
501
+ shaka.text.Cue.lineAlign = {
502
+ 'CENTER': 'center',
503
+ 'START': 'start',
504
+ 'END': 'end'
505
+ };
506
+ /**
507
+ * Default text color according to
508
+ * https://w3c.github.io/webvtt/#default-text-color
509
+ * @enum {string}
510
+ */
511
+ shaka.text.Cue.defaultTextColor = {
512
+ 'white': 'white',
513
+ 'lime': 'lime',
514
+ 'cyan': 'cyan',
515
+ 'red': 'red',
516
+ 'yellow': 'yellow',
517
+ 'magenta': 'magenta',
518
+ 'blue': 'blue',
519
+ 'black': 'black'
520
+ };
521
+ /**
522
+ * Default text background color according to
523
+ * https://w3c.github.io/webvtt/#default-text-background
524
+ * @enum {string}
525
+ */
526
+ shaka.text.Cue.defaultTextBackgroundColor = {
527
+ 'bg_white': 'white',
528
+ 'bg_lime': 'lime',
529
+ 'bg_cyan': 'cyan',
530
+ 'bg_red': 'red',
531
+ 'bg_yellow': 'yellow',
532
+ 'bg_magenta': 'magenta',
533
+ 'bg_blue': 'blue',
534
+ 'bg_black': 'black'
535
+ };
536
+ /**
537
+ * In CSS font weight can be a number, where 400 is normal and 700 is bold.
538
+ * Use these values for the enum for consistency.
539
+ * @enum {number}
540
+ */
541
+ shaka.text.Cue.fontWeight = {
542
+ 'NORMAL': 400,
543
+ 'BOLD': 700
544
+ };
545
+ /**
546
+ * @enum {string}
547
+ */
548
+ shaka.text.Cue.fontStyle = {
549
+ 'NORMAL': 'normal',
550
+ 'ITALIC': 'italic',
551
+ 'OBLIQUE': 'oblique'
552
+ };
553
+ /**
554
+ * @enum {string}
555
+ */
556
+ shaka.text.Cue.textDecoration = {
557
+ 'UNDERLINE': 'underline',
558
+ 'LINE_THROUGH': 'lineThrough',
559
+ 'OVERLINE': 'overline'
560
+ };
561
+ /**
562
+ */
563
+ shaka.text.CueRegion = class {
564
+ /** */
565
+ constructor() {}
566
+ };
567
+ /**
568
+ * Region identifier.
569
+ * @type {string}
570
+ */
571
+ shaka.text.CueRegion.prototype.id;
572
+ /**
573
+ * The X offset to start the rendering area in viewportAnchorUnits of the
574
+ * video width.
575
+ * @type {number}
576
+ */
577
+ shaka.text.CueRegion.prototype.viewportAnchorX;
578
+ /**
579
+ * The X offset to start the rendering area in viewportAnchorUnits of the
580
+ * video height.
581
+ * @type {number}
582
+ */
583
+ shaka.text.CueRegion.prototype.viewportAnchorY;
584
+ /**
585
+ * The X offset to start the rendering area in percentage (0-100) of this
586
+ * region width.
587
+ * @type {number}
588
+ */
589
+ shaka.text.CueRegion.prototype.regionAnchorX;
590
+ /**
591
+ * The Y offset to start the rendering area in percentage (0-100) of the
592
+ * region height.
593
+ * @type {number}
594
+ */
595
+ shaka.text.CueRegion.prototype.regionAnchorY;
596
+ /**
597
+ * The width of the rendering area in widthUnits.
598
+ * @type {number}
599
+ */
600
+ shaka.text.CueRegion.prototype.width;
601
+ /**
602
+ * The width of the rendering area in heightUnits.
603
+ * @type {number}
604
+ */
605
+ shaka.text.CueRegion.prototype.height;
606
+ /**
607
+ * The units (percentage, pixels or lines) the region height is in.
608
+ * @type {shaka.text.CueRegion.units}
609
+ */
610
+ shaka.text.CueRegion.prototype.heightUnits;
611
+ /**
612
+ * The units (percentage or pixels) the region width is in.
613
+ * @type {shaka.text.CueRegion.units}
614
+ */
615
+ shaka.text.CueRegion.prototype.widthUnits;
616
+ /**
617
+ * The units (percentage or pixels) the region viewportAnchors are in.
618
+ * @type {shaka.text.CueRegion.units}
619
+ */
620
+ shaka.text.CueRegion.prototype.viewportAnchorUnits;
621
+ /**
622
+ * If scroll=UP, it means that cues in the region will be added to the
623
+ * bottom of the region and will push any already displayed cues in the
624
+ * region up. Otherwise (scroll=NONE) cues will stay fixed at the location
625
+ * they were first painted in.
626
+ * @type {shaka.text.CueRegion.scrollMode}
627
+ */
628
+ shaka.text.CueRegion.prototype.scroll;
629
+ /**
630
+ * @enum {number}
631
+ */
632
+ shaka.text.CueRegion.units = {
633
+ 'PX': 0,
634
+ 'PERCENTAGE': 1,
635
+ 'LINES': 2
636
+ };
637
+ /**
638
+ * @enum {string}
639
+ */
640
+ shaka.text.CueRegion.scrollMode = {
641
+ 'NONE': '',
642
+ 'UP': 'up'
643
+ };
644
+ /**
645
+ * An interface to standardize how objects are destroyed.
646
+ * @interface
647
+ */
648
+ shaka.util.IDestroyable = class {
649
+ /**
650
+ * Request that this object be destroyed, releasing all resources and shutting
651
+ * down all operations. Returns a Promise which is resolved when destruction
652
+ * is complete. This Promise should never be rejected.
653
+ * @return {!Promise}
654
+ */
655
+ destroy() {}
656
+ };
657
+ /**
658
+ * @summary Manages transmuxer plugins.
659
+ * @implements {shaka.util.IDestroyable}
660
+ */
661
+ shaka.transmuxer.TransmuxerEngine = class {
662
+ /**
663
+ * @override
664
+ */
665
+ destroy() {}
666
+ /**
667
+ * @param {string} mimeType
668
+ * @param {!shaka.extern.TransmuxerPlugin} plugin
669
+ * @param {number} priority
670
+ */
671
+ static registerTransmuxer(mimeType, plugin, priority) {}
672
+ /**
673
+ * @param {string} mimeType
674
+ * @param {number} priority
675
+ */
676
+ static unregisterTransmuxer(mimeType, priority) {}
677
+ /**
678
+ * @param {string} mimeType
679
+ * @param {string=} contentType
680
+ * @return {?shaka.extern.TransmuxerPlugin}
681
+ */
682
+ static findTransmuxer(mimeType, contentType) {}
683
+ };
684
+ /**
685
+ * Priority level for transmuxer plugins.
686
+ * If multiple plugins are provided for the same mime type, only the
687
+ * highest-priority one is used.
688
+ * @enum {number}
689
+ */
690
+ shaka.transmuxer.TransmuxerEngine.PluginPriority = {
691
+ 'FALLBACK': 1,
692
+ 'PREFERRED_SECONDARY': 2,
693
+ 'PREFERRED': 3,
694
+ 'APPLICATION': 4
695
+ };
696
+ /**
697
+ * @summary
698
+ * Describes an error that happened.
699
+ * @description
700
+ * This uses numerical codes to describe
701
+ * which error happened.
702
+ * Some error are caused by errors from the browser. In these cases, the error
703
+ * object is provided as part of the <code>data</code> field. System codes come
704
+ * from the browser and may or may not be documented. Here are some places
705
+ * where the errors may be documented:
706
+ * <ul>
707
+ * <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaError">MediaError</a>
708
+ * <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status">HTTP Codes</a>
709
+ * <li><a href="https://hresult.info">Edge/PlayReady errors</a>
710
+ * </ul>
711
+ * @implements {shaka.extern.Error}
712
+ * @extends {Error}
713
+ */
714
+ shaka.util.Error = class {
715
+ /**
716
+ * @param {shaka.util.Error.Severity} severity
717
+ * @param {shaka.util.Error.Category} category
718
+ * @param {shaka.util.Error.Code} code
719
+ * @param {...*} varArgs
720
+ */
721
+ constructor(severity, category, code, ...varArgs) {}
722
+ };
723
+ /**
724
+ * @override
725
+ */
726
+ shaka.util.Error.prototype.severity;
727
+ /**
728
+ * @override
729
+ */
730
+ shaka.util.Error.prototype.category;
731
+ /**
732
+ * @override
733
+ */
734
+ shaka.util.Error.prototype.code;
735
+ /**
736
+ * @override
737
+ */
738
+ shaka.util.Error.prototype.data;
739
+ /**
740
+ * @override
741
+ */
742
+ shaka.util.Error.prototype.handled;
743
+ /**
744
+ * @enum {number}
745
+ */
746
+ shaka.util.Error.Severity = {
747
+ 'RECOVERABLE': 1,
748
+ 'CRITICAL': 2
749
+ };
750
+ /**
751
+ * @enum {number}
752
+ */
753
+ shaka.util.Error.Category = {
754
+ 'NETWORK': 1,
755
+ 'TEXT': 2,
756
+ 'MEDIA': 3,
757
+ 'MANIFEST': 4,
758
+ 'STREAMING': 5,
759
+ 'DRM': 6,
760
+ 'PLAYER': 7,
761
+ 'CAST': 8,
762
+ 'STORAGE': 9,
763
+ 'ADS': 10
764
+ };
765
+ /**
766
+ * @enum {number}
767
+ */
768
+ shaka.util.Error.Code = {
769
+ 'UNSUPPORTED_SCHEME': 1000,
770
+ 'BAD_HTTP_STATUS': 1001,
771
+ 'HTTP_ERROR': 1002,
772
+ 'TIMEOUT': 1003,
773
+ 'MALFORMED_DATA_URI': 1004,
774
+ 'REQUEST_FILTER_ERROR': 1006,
775
+ 'RESPONSE_FILTER_ERROR': 1007,
776
+ 'MALFORMED_TEST_URI': 1008,
777
+ 'UNEXPECTED_TEST_REQUEST': 1009,
778
+ 'ATTEMPTS_EXHAUSTED': 1010,
779
+ 'SEGMENT_MISSING': 1011,
780
+ 'INVALID_TEXT_HEADER': 2000,
781
+ 'INVALID_TEXT_CUE': 2001,
782
+ 'UNABLE_TO_DETECT_ENCODING': 2003,
783
+ 'BAD_ENCODING': 2004,
784
+ 'INVALID_XML': 2005,
785
+ 'INVALID_MP4_TTML': 2007,
786
+ 'INVALID_MP4_VTT': 2008,
787
+ 'UNABLE_TO_EXTRACT_CUE_START_TIME': 2009,
788
+ 'INVALID_MP4_CEA': 2010,
789
+ 'TEXT_COULD_NOT_GUESS_MIME_TYPE': 2011,
790
+ 'CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS': 2012,
791
+ 'TEXT_ONLY_WEBVTT_SRC_EQUALS': 2013,
792
+ 'MISSING_TEXT_PLUGIN': 2014,
793
+ 'CHAPTERS_TRACK_FAILED': 2015,
794
+ 'UNSUPPORTED_EXTERNAL_THUMBNAILS_URI': 2017,
795
+ 'BUFFER_READ_OUT_OF_BOUNDS': 3000,
796
+ 'JS_INTEGER_OVERFLOW': 3001,
797
+ 'EBML_OVERFLOW': 3002,
798
+ 'EBML_BAD_FLOATING_POINT_SIZE': 3003,
799
+ 'MP4_SIDX_WRONG_BOX_TYPE': 3004,
800
+ 'MP4_SIDX_INVALID_TIMESCALE': 3005,
801
+ 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,
802
+ 'WEBM_CUES_ELEMENT_MISSING': 3007,
803
+ 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,
804
+ 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,
805
+ 'WEBM_INFO_ELEMENT_MISSING': 3010,
806
+ 'WEBM_DURATION_ELEMENT_MISSING': 3011,
807
+ 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,
808
+ 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,
809
+ 'MEDIA_SOURCE_OPERATION_FAILED': 3014,
810
+ 'MEDIA_SOURCE_OPERATION_THREW': 3015,
811
+ 'VIDEO_ERROR': 3016,
812
+ 'QUOTA_EXCEEDED_ERROR': 3017,
813
+ 'TRANSMUXING_FAILED': 3018,
814
+ 'CONTENT_TRANSFORMATION_FAILED': 3019,
815
+ 'MSS_MISSING_DATA_FOR_TRANSMUXING': 3020,
816
+ 'MSS_TRANSMUXING_CODEC_UNKNOWN': 3021,
817
+ 'MSS_TRANSMUXING_FAILED': 3022,
818
+ 'TRANSMUXING_NO_VIDEO_DATA': 3023,
819
+ 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,
820
+ 'DASH_INVALID_XML': 4001,
821
+ 'DASH_NO_SEGMENT_INFO': 4002,
822
+ 'DASH_EMPTY_ADAPTATION_SET': 4003,
823
+ 'DASH_EMPTY_PERIOD': 4004,
824
+ 'DASH_WEBM_MISSING_INIT': 4005,
825
+ 'DASH_UNSUPPORTED_CONTAINER': 4006,
826
+ 'DASH_PSSH_BAD_ENCODING': 4007,
827
+ 'DASH_NO_COMMON_KEY_SYSTEM': 4008,
828
+ 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,
829
+ 'DASH_CONFLICTING_KEY_IDS': 4010,
830
+ 'RESTRICTIONS_CANNOT_BE_MET': 4012,
831
+ 'HLS_PLAYLIST_HEADER_MISSING': 4015,
832
+ 'INVALID_HLS_TAG': 4016,
833
+ 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,
834
+ 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,
835
+ 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,
836
+ 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,
837
+ 'HLS_REQUIRED_TAG_MISSING': 4024,
838
+ 'HLS_COULD_NOT_GUESS_CODECS': 4025,
839
+ 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,
840
+ 'DASH_UNSUPPORTED_XLINK_ACTUATE': 4027,
841
+ 'DASH_XLINK_DEPTH_LIMIT': 4028,
842
+ 'CONTENT_UNSUPPORTED_BY_BROWSER': 4032,
843
+ 'CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM': 4033,
844
+ 'NO_VARIANTS': 4036,
845
+ 'PERIOD_FLATTENING_FAILED': 4037,
846
+ 'INCONSISTENT_DRM_ACROSS_PERIODS': 4038,
847
+ 'HLS_VARIABLE_NOT_FOUND': 4039,
848
+ 'HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED': 4040,
849
+ 'HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED': 4041,
850
+ 'NO_WEB_CRYPTO_API': 4042,
851
+ 'CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM': 4045,
852
+ 'MSS_INVALID_XML': 4046,
853
+ 'MSS_LIVE_CONTENT_NOT_SUPPORTED': 4047,
854
+ 'AES_128_INVALID_IV_LENGTH': 4048,
855
+ 'AES_128_INVALID_KEY_LENGTH': 4049,
856
+ 'DASH_CONFLICTING_AES_128': 4050,
857
+ 'DASH_UNSUPPORTED_AES_128': 4051,
858
+ 'STREAMING_ENGINE_STARTUP_INVALID_STATE': 5006,
859
+ 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
860
+ 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
861
+ 'FAILED_TO_CREATE_CDM': 6002,
862
+ 'FAILED_TO_ATTACH_TO_VIDEO': 6003,
863
+ 'INVALID_SERVER_CERTIFICATE': 6004,
864
+ 'FAILED_TO_CREATE_SESSION': 6005,
865
+ 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,
866
+ 'LICENSE_REQUEST_FAILED': 6007,
867
+ 'LICENSE_RESPONSE_REJECTED': 6008,
868
+ 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,
869
+ 'NO_LICENSE_SERVER_GIVEN': 6012,
870
+ 'OFFLINE_SESSION_REMOVED': 6013,
871
+ 'EXPIRED': 6014,
872
+ 'SERVER_CERTIFICATE_REQUIRED': 6015,
873
+ 'INIT_DATA_TRANSFORM_ERROR': 6016,
874
+ 'SERVER_CERTIFICATE_REQUEST_FAILED': 6017,
875
+ 'MIN_HDCP_VERSION_NOT_MATCH': 6018,
876
+ 'ERROR_CHECKING_HDCP_VERSION': 6019,
877
+ 'LOAD_INTERRUPTED': 7000,
878
+ 'OPERATION_ABORTED': 7001,
879
+ 'NO_VIDEO_ELEMENT': 7002,
880
+ 'OBJECT_DESTROYED': 7003,
881
+ 'CONTENT_NOT_LOADED': 7004,
882
+ 'SRC_EQUALS_PRELOAD_NOT_SUPPORTED': 7005,
883
+ 'CAST_API_UNAVAILABLE': 8000,
884
+ 'NO_CAST_RECEIVERS': 8001,
885
+ 'ALREADY_CASTING': 8002,
886
+ 'UNEXPECTED_CAST_ERROR': 8003,
887
+ 'CAST_CANCELED_BY_USER': 8004,
888
+ 'CAST_CONNECTION_TIMED_OUT': 8005,
889
+ 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,
890
+ 'STORAGE_NOT_SUPPORTED': 9000,
891
+ 'INDEXED_DB_ERROR': 9001,
892
+ 'DEPRECATED_OPERATION_ABORTED': 9002,
893
+ 'REQUESTED_ITEM_NOT_FOUND': 9003,
894
+ 'MALFORMED_OFFLINE_URI': 9004,
895
+ 'CANNOT_STORE_LIVE_OFFLINE': 9005,
896
+ 'NO_INIT_DATA_FOR_OFFLINE': 9007,
897
+ 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008,
898
+ 'NEW_KEY_OPERATION_NOT_SUPPORTED': 9011,
899
+ 'KEY_NOT_FOUND': 9012,
900
+ 'MISSING_STORAGE_CELL': 9013,
901
+ 'STORAGE_LIMIT_REACHED': 9014,
902
+ 'DOWNLOAD_SIZE_CALLBACK_ERROR': 9015,
903
+ 'MODIFY_OPERATION_NOT_SUPPORTED': 9016,
904
+ 'INDEXED_DB_INIT_TIMED_OUT': 9017,
905
+ 'CS_IMA_SDK_MISSING': 10000,
906
+ 'CS_AD_MANAGER_NOT_INITIALIZED': 10001,
907
+ 'SS_IMA_SDK_MISSING': 10002,
908
+ 'SS_AD_MANAGER_NOT_INITIALIZED': 10003,
909
+ 'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004,
910
+ 'MT_AD_MANAGER_NOT_INITIALIZED': 10005
911
+ };
912
+ /**
913
+ * A timer allows a single function to be executed at a later time or at
914
+ * regular intervals.
915
+ * @final
916
+ */
917
+ shaka.util.Timer = class {
918
+ /**
919
+ * Create a new timer. A timer is committed to a single callback function.
920
+ * While there is no technical reason to do this, it is far easier to
921
+ * understand and use timers when they are connected to one functional idea.
922
+ * @param {function()} onTick
923
+ */
924
+ constructor(onTick) {}
925
+ /**
926
+ * Have the timer call |onTick| now.
927
+ * @return {!shaka.util.Timer}
928
+ */
929
+ tickNow() {}
930
+ /**
931
+ * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
932
+ * called first.
933
+ * @param {number} seconds
934
+ * @return {!shaka.util.Timer}
935
+ */
936
+ tickAfter(seconds) {}
937
+ /**
938
+ * Have the timer call |onTick| every |seconds| until |stop| is called.
939
+ * @param {number} seconds
940
+ * @return {!shaka.util.Timer}
941
+ */
942
+ tickEvery(seconds) {}
943
+ /**
944
+ * Stop the timer and clear the previous behaviour. The timer is still usable
945
+ * after calling |stop|.
946
+ */
947
+ stop() {}
948
+ };
949
+ /**
950
+ * @namespace shaka.util.StringUtils
951
+ * @summary A set of string utility functions.
952
+ */
953
+ shaka.util.StringUtils = class {
954
+ /**
955
+ * Creates a string from the given buffer as UTF-8 encoding.
956
+ * @param {?BufferSource} data
957
+ * @return {string}
958
+ */
959
+ static fromUTF8(data) {}
960
+ /**
961
+ * Creates a string from the given buffer as UTF-16 encoding.
962
+ * @param {?BufferSource} data
963
+ * @param {boolean} littleEndian
964
+ true to read little endian, false to read big.
965
+ * @param {boolean=} noThrow true to avoid throwing in cases where we may
966
+ * expect invalid input. If noThrow is true and the data has an odd
967
+ * length,it will be truncated.
968
+ * @return {string}
969
+ */
970
+ static fromUTF16(data, littleEndian, noThrow) {}
971
+ /**
972
+ * Creates a string from the given buffer, auto-detecting the encoding that is
973
+ * being used. If it cannot detect the encoding, it will throw an exception.
974
+ * @param {?BufferSource} data
975
+ * @return {string}
976
+ */
977
+ static fromBytesAutoDetect(data) {}
978
+ /**
979
+ * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
980
+ * @param {string} str
981
+ * @return {!ArrayBuffer}
982
+ */
983
+ static toUTF8(str) {}
984
+ /**
985
+ * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
986
+ * @param {string} str
987
+ * @param {boolean} littleEndian
988
+ * @return {!ArrayBuffer}
989
+ */
990
+ static toUTF16(str, littleEndian) {}
991
+ /**
992
+ * Resets the fromCharCode method's implementation.
993
+ * For debug use.
994
+ */
995
+ static resetFromCharCode() {}
996
+ };
997
+ /**
998
+ * @summary A set of Uint8Array utility functions.
999
+ */
1000
+ shaka.util.Uint8ArrayUtils = class {
1001
+ /**
1002
+ * Convert a buffer to a base64 string. The output will be standard
1003
+ * alphabet as opposed to base64url safe alphabet.
1004
+ * @param {BufferSource} data
1005
+ * @return {string}
1006
+ */
1007
+ static toStandardBase64(data) {}
1008
+ /**
1009
+ * Convert a buffer to a base64 string. The output will always use the
1010
+ * alternate encoding/alphabet also known as "base64url".
1011
+ * @param {BufferSource} data
1012
+ * @param {boolean=} padding If true, pad the output with equals signs.
1013
+ * Defaults to true.
1014
+ * @return {string}
1015
+ */
1016
+ static toBase64(data, padding) {}
1017
+ /**
1018
+ * Convert a base64 string to a Uint8Array. Accepts either the standard
1019
+ * alphabet or the alternate "base64url" alphabet.
1020
+ * @param {string} str
1021
+ * @return {!Uint8Array}
1022
+ */
1023
+ static fromBase64(str) {}
1024
+ /**
1025
+ * Convert a hex string to a Uint8Array.
1026
+ * @param {string} str
1027
+ * @return {!Uint8Array}
1028
+ */
1029
+ static fromHex(str) {}
1030
+ /**
1031
+ * Convert a buffer to a hex string.
1032
+ * @param {BufferSource} data
1033
+ * @return {string}
1034
+ */
1035
+ static toHex(data) {}
1036
+ /**
1037
+ * Concatenate buffers.
1038
+ * @param {...BufferSource} varArgs
1039
+ * @return {!Uint8Array}
1040
+ */
1041
+ static concat(...varArgs) {}
1042
+ };
1043
+ /**
1044
+ * @summary A set of utility functions for dealing with MIME types.
1045
+ */
1046
+ shaka.util.MimeUtils = class {
1047
+ /**
1048
+ * Takes a MIME type and optional codecs string and produces the full MIME
1049
+ * type. Also remove the codecs for raw formats.
1050
+ * @param {string} mimeType
1051
+ * @param {string=} codecs
1052
+ * @return {string}
1053
+ */
1054
+ static getFullType(mimeType, codecs) {}
1055
+ /**
1056
+ * Takes a MIME type and optional codecs string and produces the full MIME
1057
+ * type.
1058
+ * @param {string} mimeType
1059
+ * @param {string=} codecs
1060
+ * @return {string}
1061
+ */
1062
+ static getFullTypeWithAllCodecs(mimeType, codecs) {}
1063
+ };
1064
+ /**
1065
+ * @summary Manages text parsers and cues.
1066
+ * @implements {shaka.util.IDestroyable}
1067
+ */
1068
+ shaka.text.TextEngine = class {
1069
+ /** @param {shaka.extern.TextDisplayer} displayer */
1070
+ constructor(displayer) {}
1071
+ /**
1072
+ * @param {string} mimeType
1073
+ * @param {!shaka.extern.TextParserPlugin} plugin
1074
+ */
1075
+ static registerParser(mimeType, plugin) {}
1076
+ /**
1077
+ * @param {string} mimeType
1078
+ */
1079
+ static unregisterParser(mimeType) {}
1080
+ /**
1081
+ * @return {?shaka.extern.TextParserPlugin}
1082
+ */
1083
+ static findParser(mimeType) {}
1084
+ /**
1085
+ * @override
1086
+ */
1087
+ destroy() {}
1088
+ };
1089
+ /**
1090
+ * @summary A set of language utility functions.
1091
+ * @final
1092
+ */
1093
+ shaka.util.LanguageUtils = class {
1094
+ /**
1095
+ * Check if |locale1| and |locale2| are locale-compatible.
1096
+ * Locale-compatible is defined as all components in each locale match. Since
1097
+ * we only respect the language and region components, we only check that
1098
+ * the language and region components match.
1099
+ * Examples:
1100
+ * Locale A | Locale B | Locale Compatible
1101
+ * ---------------------------------------
1102
+ * en-US | en-US | true
1103
+ * en | en-US | false
1104
+ * en-US | en-CA | false
1105
+ * @param {string} locale1
1106
+ * @param {string} locale2
1107
+ * @return {boolean}
1108
+ */
1109
+ static areLocaleCompatible(locale1, locale2) {}
1110
+ /**
1111
+ * Check if |locale1| and |locale2| are language-compatible.
1112
+ * Language compatible is when the language component of each locale matches.
1113
+ * This means that no matter what region they have (or don't have) as long as
1114
+ * the language components match, they are language-compatible.
1115
+ * Examples:
1116
+ * Locale A | Locale B | Language-Compatible
1117
+ * -----------------------------------------
1118
+ * en-US | en-US | true
1119
+ * en-US | en | true
1120
+ * en-US | en-CA | true
1121
+ * en-CA | fr-CA | false
1122
+ * @param {string} locale1
1123
+ * @param {string} locale2
1124
+ * @return {boolean}
1125
+ */
1126
+ static areLanguageCompatible(locale1, locale2) {}
1127
+ /**
1128
+ * Check if |possibleParent| is the parent locale of |possibleChild|. Because
1129
+ * we do not support dialects, the parent-child relationship is a lot simpler.
1130
+ * In a parent child relationship:
1131
+ * - The parent and child have the same language-component
1132
+ * - The parent has no region-component
1133
+ * - The child has a region-component
1134
+ * Example:
1135
+ * Locale A | Locale B | Is A The parent of B?
1136
+ * --------------------------------------------
1137
+ * en-US | en-US | no
1138
+ * en-US | en | no
1139
+ * en | en-US | yes
1140
+ * en | en | no
1141
+ * en | fr | no
1142
+ * @param {string} possibleParent
1143
+ * @param {string} possibleChild
1144
+ * @return {boolean}
1145
+ */
1146
+ static isParentOf(possibleParent, possibleChild) {}
1147
+ /**
1148
+ * Check if |localeA| shares the same parent with |localeB|. Since we don't
1149
+ * support dialect, we will only look at language and region. For two locales
1150
+ * to be siblings:
1151
+ * - Both must have language-components
1152
+ * - Both must have region-components
1153
+ * - Both must have the same language-component
1154
+ * Example:
1155
+ * Locale A | Locale B | Siblings?
1156
+ * --------------------------------------------
1157
+ * en-US | en-US | yes
1158
+ * en-US | en-CA | yes
1159
+ * en-US | en | no
1160
+ * en | en-US | no
1161
+ * en | en | no
1162
+ * en | fr | no
1163
+ * @param {string} localeA
1164
+ * @param {string} localeB
1165
+ * @return {boolean}
1166
+ */
1167
+ static isSiblingOf(localeA, localeB) {}
1168
+ /**
1169
+ * Normalize a locale. This will take a locale and canonicalize it to a state
1170
+ * that we are prepared to work with.
1171
+ * We only support with:
1172
+ * - language
1173
+ * - language-REGION
1174
+ * If given a dialect, we will discard it. We will convert any 3-character
1175
+ * codes to 2-character codes. We will force language codes to lowercase and
1176
+ * region codes to uppercase.
1177
+ * @param {string} locale
1178
+ * @return {string}
1179
+ */
1180
+ static normalize(locale) {}
1181
+ /**
1182
+ * Check if two language codes are siblings. Language codes are siblings if
1183
+ * they share the same base language while neither one is the base language.
1184
+ * For example, "en-US" and "en-CA" are siblings but "en-US" and "en" are not
1185
+ * siblings.
1186
+ * @param {string} a
1187
+ * @param {string} b
1188
+ * @return {boolean}
1189
+ */
1190
+ static areSiblings(a, b) {}
1191
+ /**
1192
+ * Compute a numerical relatedness for language codes. Language codes with a
1193
+ * higher relatedness are a better match. Unrelated language codes have a
1194
+ * relatedness score of 0.
1195
+ * @param {string} target
1196
+ * @param {string} candidate
1197
+ * @return {number}
1198
+ */
1199
+ static relatedness(target, candidate) {}
1200
+ /**
1201
+ * Get the normalized base language for a language code.
1202
+ * @param {string} lang
1203
+ * @return {string}
1204
+ */
1205
+ static getBase(lang) {}
1206
+ /**
1207
+ * Get the normalized language of the given text stream. Will return 'und' if
1208
+ * a language is not found on the text stream.
1209
+ * This should always be used to get the language from a text stream.
1210
+ * @param {shaka.extern.Stream} stream
1211
+ * @return {string}
1212
+ */
1213
+ static getLocaleForText(stream) {}
1214
+ /**
1215
+ * Get the normalized locale for the given variant. This will look through
1216
+ * the variant to find the locale that represents the content in the variant.
1217
+ * This will return 'und' if no language can be found.
1218
+ * This should always be used to get the locale from a variant.
1219
+ * @param {shaka.extern.Variant} variant
1220
+ * @return {string}
1221
+ */
1222
+ static getLocaleForVariant(variant) {}
1223
+ /**
1224
+ * Find the locale in |searchSpace| that comes closest to |target|. If no
1225
+ * locale is found to be close to |target|, then |null| will be returned.
1226
+ * @param {string} target
1227
+ * @param {!Iterable.<string>} searchSpace
1228
+ * @return {?string}
1229
+ */
1230
+ static findClosestLocale(target, searchSpace) {}
1231
+ };
1232
+ /**
1233
+ * @summary A set of utility functions for dealing with Streams and Manifests.
1234
+ */
1235
+ shaka.util.StreamUtils = class {
1236
+ /**
1237
+ * @param {shaka.extern.Variant} variant
1238
+ * @param {shaka.extern.Restrictions} restrictions
1239
+ * Configured restrictions from the user.
1240
+ * @param {{width: number, height: number}} maxHwRes
1241
+ * The maximum resolution the hardware can handle.
1242
+ * This is applied separately from user restrictions because the setting
1243
+ * should not be easily replaced by the user's configuration.
1244
+ * @return {boolean}
1245
+ */
1246
+ static meetsRestrictions(variant, restrictions, maxHwRes) {}
1247
+ };
1248
+ /**
1249
+ * @summary
1250
+ * <p>
1251
+ * This defines the default ABR manager for the Player. An instance of this
1252
+ * class is used when no ABR manager is given.
1253
+ * </p>
1254
+ * <p>
1255
+ * The behavior of this class is to take throughput samples using
1256
+ * segmentDownloaded to estimate the current network bandwidth. Then it will
1257
+ * use that to choose the streams that best fit the current bandwidth. It will
1258
+ * always pick the highest bandwidth variant it thinks can be played.
1259
+ * </p>
1260
+ * <p>
1261
+ * After initial choices are made, this class will call switchCallback() when
1262
+ * there is a better choice. switchCallback() will not be called more than once
1263
+ * per ({@link shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS}).
1264
+ * </p>
1265
+ * @implements {shaka.extern.AbrManager}
1266
+ * @implements {shaka.util.IReleasable}
1267
+ */
1268
+ shaka.abr.SimpleAbrManager = class {
1269
+ /** */
1270
+ constructor() {}
1271
+ /**
1272
+ * @override
1273
+ */
1274
+ stop() {}
1275
+ /**
1276
+ * @override
1277
+ */
1278
+ release() {}
1279
+ /**
1280
+ * @override
1281
+ */
1282
+ init(switchCallback) {}
1283
+ /**
1284
+ * @param {boolean=} preferFastSwitching
1285
+ * @return {shaka.extern.Variant}
1286
+ * @override
1287
+ */
1288
+ chooseVariant(preferFastSwitching) {}
1289
+ /**
1290
+ * @override
1291
+ */
1292
+ enable() {}
1293
+ /**
1294
+ * @override
1295
+ */
1296
+ disable() {}
1297
+ /**
1298
+ * @param {number} deltaTimeMs The duration, in milliseconds, that the request
1299
+ * took to complete.
1300
+ * @param {number} numBytes The total number of bytes transferred.
1301
+ * @param {boolean} allowSwitch Indicate if the segment is allowed to switch
1302
+ * to another stream.
1303
+ * @param {shaka.extern.Request=} request
1304
+ * A reference to the request
1305
+ * @override
1306
+ */
1307
+ segmentDownloaded(deltaTimeMs, numBytes, allowSwitch, request) {}
1308
+ /**
1309
+ * @override
1310
+ */
1311
+ trySuggestStreams() {}
1312
+ /**
1313
+ * @override
1314
+ */
1315
+ getBandwidthEstimate() {}
1316
+ /**
1317
+ * @override
1318
+ */
1319
+ setVariants(variants) {}
1320
+ /**
1321
+ * @override
1322
+ */
1323
+ playbackRateChanged(rate) {}
1324
+ /**
1325
+ * @override
1326
+ */
1327
+ setMediaElement(mediaElement) {}
1328
+ /**
1329
+ * @override
1330
+ */
1331
+ setCmsdManager(cmsdManager) {}
1332
+ /**
1333
+ * @override
1334
+ */
1335
+ configure(config) {}
1336
+ };
1337
+ /**
1338
+ * @enum {number}
1339
+ */
1340
+ shaka.config.AutoShowText = {
1341
+ 'NEVER': 0,
1342
+ 'ALWAYS': 1,
1343
+ 'IF_PREFERRED_TEXT_LANGUAGE': 2,
1344
+ 'IF_SUBTITLES_MAY_BE_NEEDED': 3
1345
+ };
1346
+ /**
1347
+ * @enum {string}
1348
+ */
1349
+ shaka.config.CodecSwitchingStrategy = {
1350
+ RELOAD: 'reload',
1351
+ SMOOTH: 'smooth'
1352
+ };
1353
+ /**
1354
+ * @summary DataViewReader abstracts a DataView object.
1355
+ */
1356
+ shaka.util.DataViewReader = class {
1357
+ /**
1358
+ * @param {BufferSource} data
1359
+ * @param {shaka.util.DataViewReader.Endianness} endianness The endianness.
1360
+ */
1361
+ constructor(data, endianness) {}
1362
+ /**
1363
+ * @return {boolean} True if the reader has more data, false otherwise.
1364
+ */
1365
+ hasMoreData() {}
1366
+ /**
1367
+ * Gets the current byte position.
1368
+ * @return {number}
1369
+ */
1370
+ getPosition() {}
1371
+ /**
1372
+ * Gets the byte length of the DataView.
1373
+ * @return {number}
1374
+ */
1375
+ getLength() {}
1376
+ /**
1377
+ * Reads an unsigned 8 bit integer, and advances the reader.
1378
+ * @return {number} The integer.
1379
+ */
1380
+ readUint8() {}
1381
+ /**
1382
+ * Reads an unsigned 16 bit integer, and advances the reader.
1383
+ * @return {number} The integer.
1384
+ */
1385
+ readUint16() {}
1386
+ /**
1387
+ * Reads an unsigned 32 bit integer, and advances the reader.
1388
+ * @return {number} The integer.
1389
+ */
1390
+ readUint32() {}
1391
+ /**
1392
+ * Reads a signed 32 bit integer, and advances the reader.
1393
+ * @return {number} The integer.
1394
+ */
1395
+ readInt32() {}
1396
+ /**
1397
+ * Reads an unsigned 64 bit integer, and advances the reader.
1398
+ * @return {number} The integer.
1399
+ */
1400
+ readUint64() {}
1401
+ /**
1402
+ * Reads the specified number of raw bytes.
1403
+ * @param {number} bytes The number of bytes to read.
1404
+ * @return {!Uint8Array}
1405
+ */
1406
+ readBytes(bytes) {}
1407
+ /**
1408
+ * Skips the specified number of bytes.
1409
+ * @param {number} bytes The number of bytes to skip.
1410
+ */
1411
+ skip(bytes) {}
1412
+ /**
1413
+ * Rewinds the specified number of bytes.
1414
+ * @param {number} bytes The number of bytes to rewind.
1415
+ */
1416
+ rewind(bytes) {}
1417
+ /**
1418
+ * Seeks to a specified position.
1419
+ * @param {number} position The desired byte position within the DataView.
1420
+ */
1421
+ seek(position) {}
1422
+ /**
1423
+ * Keeps reading until it reaches a byte that equals to zero. The text is
1424
+ * assumed to be UTF-8.
1425
+ * @return {string}
1426
+ */
1427
+ readTerminatedString() {}
1428
+ };
1429
+ /**
1430
+ * Endianness.
1431
+ * @enum {number}
1432
+ */
1433
+ shaka.util.DataViewReader.Endianness = {
1434
+ 'BIG_ENDIAN': 0,
1435
+ 'LITTLE_ENDIAN': 1
1436
+ };
1437
+ /**
1438
+ */
1439
+ shaka.util.Mp4Parser = class {
1440
+ /** */
1441
+ constructor() {}
1442
+ /**
1443
+ * Declare a box type as a Box.
1444
+ * @param {string} type
1445
+ * @param {!shaka.util.Mp4Parser.CallbackType} definition
1446
+ * @return {!shaka.util.Mp4Parser}
1447
+ */
1448
+ box(type, definition) {}
1449
+ /**
1450
+ * Declare a box type as a Full Box.
1451
+ * @param {string} type
1452
+ * @param {!shaka.util.Mp4Parser.CallbackType} definition
1453
+ * @return {!shaka.util.Mp4Parser}
1454
+ */
1455
+ fullBox(type, definition) {}
1456
+ /**
1457
+ * Stop parsing. Useful for extracting information from partial segments and
1458
+ * avoiding an out-of-bounds error once you find what you are looking for.
1459
+ */
1460
+ stop() {}
1461
+ /**
1462
+ * Parse the given data using the added callbacks.
1463
+ * @param {!BufferSource} data
1464
+ * @param {boolean=} partialOkay If true, allow reading partial payloads
1465
+ * from some boxes. If the goal is a child box, we can sometimes find it
1466
+ * without enough data to find all child boxes.
1467
+ * @param {boolean=} stopOnPartial If true, stop reading if an incomplete
1468
+ * box is detected.
1469
+ */
1470
+ parse(data, partialOkay, stopOnPartial) {}
1471
+ /**
1472
+ * Parse the next box on the current level.
1473
+ * @param {number} absStart The absolute start position in the original
1474
+ * byte array.
1475
+ * @param {!shaka.util.DataViewReader} reader
1476
+ * @param {boolean=} partialOkay If true, allow reading partial payloads
1477
+ * from some boxes. If the goal is a child box, we can sometimes find it
1478
+ * without enough data to find all child boxes.
1479
+ * @param {boolean=} stopOnPartial If true, stop reading if an incomplete
1480
+ * box is detected.
1481
+ */
1482
+ parseNext(absStart, reader, partialOkay, stopOnPartial) {}
1483
+ /**
1484
+ * A callback that tells the Mp4 parser to treat the body of a box as a series
1485
+ * of boxes. The number of boxes is limited by the size of the parent box.
1486
+ * @param {!shaka.extern.ParsedBox} box
1487
+ */
1488
+ static children(box) {}
1489
+ /**
1490
+ * A callback that tells the Mp4 parser to treat the body of a box as a sample
1491
+ * description. A sample description box has a fixed number of children. The
1492
+ * number of children is represented by a 4 byte unsigned integer. Each child
1493
+ * is a box.
1494
+ * @param {!shaka.extern.ParsedBox} box
1495
+ */
1496
+ static sampleDescription(box) {}
1497
+ /**
1498
+ * A callback that tells the Mp4 parser to treat the body of a box as a visual
1499
+ * sample entry. A visual sample entry has some fixed-sized fields
1500
+ * describing the video codec parameters, followed by an arbitrary number of
1501
+ * appended children. Each child is a box.
1502
+ * @param {!shaka.extern.ParsedBox} box
1503
+ */
1504
+ static visualSampleEntry(box) {}
1505
+ /**
1506
+ * A callback that tells the Mp4 parser to treat the body of a box as a audio
1507
+ * sample entry. A audio sample entry has some fixed-sized fields
1508
+ * describing the audio codec parameters, followed by an arbitrary number of
1509
+ * appended children. Each child is a box.
1510
+ * @param {!shaka.extern.ParsedBox} box
1511
+ */
1512
+ static audioSampleEntry(box) {}
1513
+ /**
1514
+ * Create a callback that tells the Mp4 parser to treat the body of a box as a
1515
+ * binary blob and to parse the body's contents using the provided callback.
1516
+ * @param {function(!Uint8Array)} callback
1517
+ * @return {!shaka.util.Mp4Parser.CallbackType}
1518
+ */
1519
+ static allData(callback) {}
1520
+ /**
1521
+ * Convert an integer type from a box into an ascii string name.
1522
+ * Useful for debugging.
1523
+ * @param {number} type The type of the box, a uint32.
1524
+ * @return {string}
1525
+ */
1526
+ static typeToString(type) {}
1527
+ /**
1528
+ * Find the header size of the box.
1529
+ * Useful for modifying boxes in place or finding the exact offset of a field.
1530
+ * @param {shaka.extern.ParsedBox} box
1531
+ * @return {number}
1532
+ */
1533
+ static headerSize(box) {}
1534
+ };
1535
+ /**
1536
+ * @typedef {function(!shaka.extern.ParsedBox)}
1537
+ */
1538
+ shaka.util.Mp4Parser.CallbackType;
1539
+ /**
1540
+ * A utility to wrap abortable operations. Note that these are not cancelable.
1541
+ * Cancelation implies undoing what has been done so far, whereas aborting only
1542
+ * means that further work is stopped.
1543
+ * @implements {shaka.extern.IAbortableOperation.<T>}
1544
+ * @template T
1545
+ */
1546
+ shaka.util.AbortableOperation = class {
1547
+ /**
1548
+ * @param {!Promise.<T>} promise
1549
+ * A Promise which represents the underlying operation. It is resolved when
1550
+ * the operation is complete, and rejected if the operation fails or is
1551
+ * aborted. Aborted operations should be rejected with a shaka.util.Error
1552
+ * object using the error code OPERATION_ABORTED.
1553
+ * @param {function():!Promise} onAbort
1554
+ * Will be called by this object to abort the underlying operation.
1555
+ * This is not cancelation, and will not necessarily result in any work
1556
+ * being undone. abort() should return a Promise which is resolved when the
1557
+ * underlying operation has been aborted. The returned Promise should never
1558
+ * be rejected.
1559
+ */
1560
+ constructor(promise, onAbort) {}
1561
+ /**
1562
+ * @param {!shaka.util.Error} error
1563
+ * @return {!shaka.util.AbortableOperation} An operation which has already
1564
+ * failed with the error given by the caller.
1565
+ */
1566
+ static failed(error) {}
1567
+ /**
1568
+ * @return {!shaka.util.AbortableOperation} An operation which has already
1569
+ * failed with the error OPERATION_ABORTED.
1570
+ */
1571
+ static aborted() {}
1572
+ /**
1573
+ * @param {U} value
1574
+ * @return {!shaka.util.AbortableOperation.<U>} An operation which has already
1575
+ * completed with the given value.
1576
+ * @template U
1577
+ */
1578
+ static completed(value) {}
1579
+ /**
1580
+ * @param {!Promise.<U>} promise
1581
+ * @return {!shaka.util.AbortableOperation.<U>} An operation which cannot be
1582
+ * aborted. It will be completed when the given Promise is resolved, or
1583
+ * will be failed when the given Promise is rejected.
1584
+ * @template U
1585
+ */
1586
+ static notAbortable(promise) {}
1587
+ /**
1588
+ * @override
1589
+ */
1590
+ abort() {}
1591
+ /**
1592
+ * @param {!Array.<!shaka.util.AbortableOperation>} operations
1593
+ * @return {!shaka.util.AbortableOperation} An operation which is resolved
1594
+ * when all operations are successful and fails when any operation fails.
1595
+ * For this operation, abort() aborts all given operations.
1596
+ */
1597
+ static all(operations) {}
1598
+ /**
1599
+ * @override
1600
+ */
1601
+ finally(onFinal) {}
1602
+ /**
1603
+ * @param {(undefined|
1604
+ * function(T):U|
1605
+ * function(T):!Promise.<U>|
1606
+ * function(T):!shaka.util.AbortableOperation.<U>)} onSuccess
1607
+ * A callback to be invoked after this operation is complete, to chain to
1608
+ * another operation. The callback can return a plain value, a Promise to
1609
+ * an asynchronous value, or another AbortableOperation.
1610
+ * @param {function(*)=} onError
1611
+ * An optional callback to be invoked if this operation fails, to perform
1612
+ * some cleanup or error handling. Analogous to the second parameter of
1613
+ * Promise.prototype.then.
1614
+ * @return {!shaka.util.AbortableOperation.<U>} An operation which is resolved
1615
+ * when this operation and the operation started by the callback are both
1616
+ * complete.
1617
+ * @template U
1618
+ */
1619
+ chain(onSuccess, onError) {}
1620
+ };
1621
+ /**
1622
+ * @const {!Promise.<T>}
1623
+ */
1624
+ shaka.util.AbortableOperation.prototype.promise;
1625
+ /**
1626
+ * @summary Create an Event work-alike object based on the provided dictionary.
1627
+ * The event should contain all of the same properties from the dict.
1628
+ * @extends {Event}
1629
+ */
1630
+ shaka.util.FakeEvent = class {
1631
+ /**
1632
+ * @param {string} type
1633
+ * @param {Map.<string, Object>=} dict
1634
+ */
1635
+ constructor(type, dict) {}
1636
+ };
1637
+ /**
1638
+ * @summary A work-alike for EventTarget. Only DOM elements may be true
1639
+ * EventTargets, but this can be used as a base class to provide event dispatch
1640
+ * to non-DOM classes. Only FakeEvents should be dispatched.
1641
+ * @implements {EventTarget}
1642
+ * @implements {shaka.util.IReleasable}
1643
+ */
1644
+ shaka.util.FakeEventTarget = class {
1645
+ /** */
1646
+ constructor() {}
1647
+ /**
1648
+ * Add an event listener to this object.
1649
+ * @param {string} type The event type to listen for.
1650
+ * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or
1651
+ * listener object to invoke.
1652
+ * @param {(!AddEventListenerOptions|boolean)=} options Ignored.
1653
+ * @override
1654
+ */
1655
+ addEventListener(type, listener, options) {}
1656
+ /**
1657
+ * Add an event listener to this object that is invoked for all events types
1658
+ * the object fires.
1659
+ * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or
1660
+ * listener object to invoke.
1661
+ */
1662
+ listenToAllEvents(listener) {}
1663
+ /**
1664
+ * Remove an event listener from this object.
1665
+ * @param {string} type The event type for which you wish to remove a
1666
+ * listener.
1667
+ * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or
1668
+ * listener object to remove.
1669
+ * @param {(EventListenerOptions|boolean)=} options Ignored.
1670
+ * @override
1671
+ */
1672
+ removeEventListener(type, listener, options) {}
1673
+ /**
1674
+ * Dispatch an event from this object.
1675
+ * @param {!Event} event The event to be dispatched from this object.
1676
+ * @return {boolean} True if the default action was prevented.
1677
+ * @override
1678
+ */
1679
+ dispatchEvent(event) {}
1680
+ /**
1681
+ * @override
1682
+ */
1683
+ release() {}
1684
+ };
1685
+ /**
1686
+ * These are the listener types defined in the closure extern for EventTarget.
1687
+ * @typedef {EventListener|function(!Event):*}
1688
+ */
1689
+ shaka.util.FakeEventTarget.ListenerType;
1690
+ /**
1691
+ * NetworkingEngine wraps all networking operations. This accepts plugins that
1692
+ * handle the actual request. A plugin is registered using registerScheme.
1693
+ * Each scheme has at most one plugin to handle the request.
1694
+ * @implements {shaka.util.IDestroyable}
1695
+ */
1696
+ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1697
+ /**
1698
+ * @param {shaka.net.NetworkingEngine.onProgressUpdated=} onProgressUpdated
1699
+ * Called when
1700
+ * a progress event is triggered. Passed the duration, in milliseconds,
1701
+ * that the request took, the number of bytes transferred, and the boolean
1702
+ * of whether the switching is allowed.
1703
+ * @param {shaka.net.NetworkingEngine.OnHeadersReceived=} onHeadersReceived
1704
+ * Called when the headers are received for a download.
1705
+ * @param {shaka.net.NetworkingEngine.OnDownloadFailed=} onDownloadFailed
1706
+ * Called when a download fails, for any reason.
1707
+ * @param {shaka.net.NetworkingEngine.OnRequest=} onRequest
1708
+ * Called when a request is made
1709
+ * @param {shaka.net.NetworkingEngine.OnRetry=} onRetry
1710
+ * Called when a request retry is made
1711
+ * @param {shaka.net.NetworkingEngine.OnResponse=} onResponse
1712
+ * Called when receive the response
1713
+ */
1714
+ constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest, onRetry, onResponse) {}
1715
+ /**
1716
+ * @param {boolean} forceHTTPS
1717
+ */
1718
+ setForceHTTPS(forceHTTPS) {}
1719
+ /**
1720
+ * Registers a scheme plugin. This plugin will handle all requests with the
1721
+ * given scheme. If a plugin with the same scheme already exists, it is
1722
+ * replaced, unless the existing plugin is of higher priority.
1723
+ * If no priority is provided, this defaults to the highest priority of
1724
+ * APPLICATION.
1725
+ * @param {string} scheme
1726
+ * @param {shaka.extern.SchemePlugin} plugin
1727
+ * @param {number=} priority
1728
+ * @param {boolean=} progressSupport
1729
+ */
1730
+ static registerScheme(scheme, plugin, priority, progressSupport) {}
1731
+ /**
1732
+ * Removes a scheme plugin.
1733
+ * @param {string} scheme
1734
+ */
1735
+ static unregisterScheme(scheme) {}
1736
+ /**
1737
+ * Registers a new request filter. All filters are applied in the order they
1738
+ * are registered.
1739
+ * @param {shaka.extern.RequestFilter} filter
1740
+ */
1741
+ registerRequestFilter(filter) {}
1742
+ /**
1743
+ * Removes a request filter.
1744
+ * @param {shaka.extern.RequestFilter} filter
1745
+ */
1746
+ unregisterRequestFilter(filter) {}
1747
+ /**
1748
+ * Clears all request filters.
1749
+ */
1750
+ clearAllRequestFilters() {}
1751
+ /**
1752
+ * Registers a new response filter. All filters are applied in the order they
1753
+ * are registered.
1754
+ * @param {shaka.extern.ResponseFilter} filter
1755
+ */
1756
+ registerResponseFilter(filter) {}
1757
+ /**
1758
+ * Removes a response filter.
1759
+ * @param {shaka.extern.ResponseFilter} filter
1760
+ */
1761
+ unregisterResponseFilter(filter) {}
1762
+ /**
1763
+ * Clears all response filters.
1764
+ */
1765
+ clearAllResponseFilters() {}
1766
+ /**
1767
+ * Gets a copy of the default retry parameters.
1768
+ * @return {shaka.extern.RetryParameters}
1769
+ * NOTE: The implementation moved to shaka.net.Backoff to avoid a circular
1770
+ * dependency between the two classes.
1771
+ */
1772
+ static defaultRetryParameters() {}
1773
+ /**
1774
+ * Makes a simple network request for the given URIs.
1775
+ * @param {!Array.<string>} uris
1776
+ * @param {shaka.extern.RetryParameters} retryParams
1777
+ * @param {?function(BufferSource):!Promise=} streamDataCallback
1778
+ * @return {shaka.extern.Request}
1779
+ */
1780
+ static makeRequest(uris, retryParams, streamDataCallback) {}
1781
+ /**
1782
+ * @override
1783
+ */
1784
+ destroy() {}
1785
+ /**
1786
+ * Makes a network request and returns the resulting data.
1787
+ * @param {shaka.net.NetworkingEngine.RequestType} type
1788
+ * @param {shaka.extern.Request} request
1789
+ * @param {shaka.extern.RequestContext=} context
1790
+ * @return {!shaka.net.NetworkingEngine.PendingRequest}
1791
+ */
1792
+ request(type, request, context) {}
1793
+ };
1794
+ /**
1795
+ * A wrapper class for the number of bytes remaining to be downloaded for the
1796
+ * request.
1797
+ * Instead of using PendingRequest directly, this class is needed to be sent to
1798
+ * plugin as a parameter, and a Promise is returned, before PendingRequest is
1799
+ * created.
1800
+ */
1801
+ shaka.net.NetworkingEngine.NumBytesRemainingClass = class {
1802
+ /**
1803
+ * Constructor
1804
+ */
1805
+ constructor() {}
1806
+ };
1807
+ /**
1808
+ * A pending network request. This can track the current progress of the
1809
+ * download, and allows the request to be aborted if the network is slow.
1810
+ * @implements {shaka.extern.IAbortableOperation.<shaka.extern.Response>}
1811
+ * @extends {shaka.util.AbortableOperation}
1812
+ */
1813
+ shaka.net.NetworkingEngine.PendingRequest = class extends shaka.util.AbortableOperation {
1814
+ /**
1815
+ * @param {!Promise} promise
1816
+ * A Promise which represents the underlying operation. It is resolved
1817
+ * when the operation is complete, and rejected if the operation fails or
1818
+ * is aborted. Aborted operations should be rejected with a
1819
+ * shaka.util.Error object using the error code OPERATION_ABORTED.
1820
+ * @param {function():!Promise} onAbort
1821
+ * Will be called by this object to abort the underlying operation. This
1822
+ * is not cancelation, and will not necessarily result in any work being
1823
+ * undone. abort() should return a Promise which is resolved when the
1824
+ * underlying operation has been aborted. The returned Promise should
1825
+ * never be rejected.
1826
+ * @param {shaka.net.NetworkingEngine.NumBytesRemainingClass}
1827
+ * numBytesRemainingObj
1828
+ */
1829
+ constructor(promise, onAbort, numBytesRemainingObj) {}
1830
+ };
1831
+ /**
1832
+ * Request types. Allows a filter to decide which requests to read/alter.
1833
+ * @enum {number}
1834
+ */
1835
+ shaka.net.NetworkingEngine.RequestType = {
1836
+ 'MANIFEST': 0,
1837
+ 'SEGMENT': 1,
1838
+ 'LICENSE': 2,
1839
+ 'APP': 3,
1840
+ 'TIMING': 4,
1841
+ 'SERVER_CERTIFICATE': 5,
1842
+ 'KEY': 6,
1843
+ 'ADS': 7,
1844
+ 'CONTENT_STEERING': 8
1845
+ };
1846
+ /**
1847
+ * A more advanced form of the RequestType structure, meant to describe
1848
+ * sub-types of basic request types.
1849
+ * For example, an INIT_SEGMENT is a sub-type of SEGMENT.
1850
+ * This is meant to allow for more specificity to be added to the request type
1851
+ * data, without breaking backwards compatibility.
1852
+ * @enum {number}
1853
+ */
1854
+ shaka.net.NetworkingEngine.AdvancedRequestType = {
1855
+ 'INIT_SEGMENT': 0,
1856
+ 'MEDIA_SEGMENT': 1,
1857
+ 'MEDIA_PLAYLIST': 2,
1858
+ 'MASTER_PLAYLIST': 3,
1859
+ 'MPD': 4,
1860
+ 'MSS': 5
1861
+ };
1862
+ /**
1863
+ * Priority level for network scheme plugins.
1864
+ * If multiple plugins are provided for the same scheme, only the
1865
+ * highest-priority one is used.
1866
+ * @enum {number}
1867
+ */
1868
+ shaka.net.NetworkingEngine.PluginPriority = {
1869
+ 'FALLBACK': 1,
1870
+ 'PREFERRED': 2,
1871
+ 'APPLICATION': 3
1872
+ };
1873
+ /**
1874
+ * @typedef {function(
1875
+ * !Object.<string, string>,
1876
+ * !shaka.extern.Request,
1877
+ * !shaka.net.NetworkingEngine.RequestType)}
1878
+ * @description
1879
+ * A callback function that passes the shaka.extern.HeadersReceived along to
1880
+ * the player, plus some extra data.
1881
+ */
1882
+ shaka.net.NetworkingEngine.OnHeadersReceived;
1883
+ /**
1884
+ * @typedef {function(
1885
+ * number,
1886
+ * number,
1887
+ * boolean,
1888
+ * shaka.extern.Request=)}
1889
+ * @description
1890
+ * A callback that is passed the duration, in milliseconds,
1891
+ * that the request took, the number of bytes transferred, a boolean
1892
+ * representing whether the switching is allowed and a ref to the
1893
+ * original request.
1894
+ */
1895
+ shaka.net.NetworkingEngine.onProgressUpdated;
1896
+ /**
1897
+ * @typedef {function(
1898
+ * !shaka.extern.Request,
1899
+ * ?shaka.util.Error,
1900
+ * number,
1901
+ * boolean)}
1902
+ * @description
1903
+ * A callback function that notifies the player when a download fails, for any
1904
+ * reason (e.g. even if the download was aborted).
1905
+ */
1906
+ shaka.net.NetworkingEngine.OnDownloadFailed;
1907
+ /**
1908
+ * @typedef {function(
1909
+ * !shaka.net.NetworkingEngine.RequestType,
1910
+ * !shaka.extern.Request,
1911
+ * (shaka.extern.RequestContext|undefined))}
1912
+ * @description
1913
+ * A callback function called on every request
1914
+ */
1915
+ shaka.net.NetworkingEngine.OnRequest;
1916
+ /**
1917
+ * @typedef {function(
1918
+ * !shaka.net.NetworkingEngine.RequestType,
1919
+ * (shaka.extern.RequestContext|undefined),
1920
+ * string,
1921
+ * string)}
1922
+ * @description
1923
+ * A callback function called on every request retry. The first string is the
1924
+ * new URI and the second string is the old URI.
1925
+ */
1926
+ shaka.net.NetworkingEngine.OnRetry;
1927
+ /**
1928
+ * @typedef {function(
1929
+ * !shaka.net.NetworkingEngine.RequestType,
1930
+ * !shaka.extern.Response,
1931
+ * (shaka.extern.RequestContext|undefined))}
1932
+ * @description
1933
+ * A callback function called on every request
1934
+ */
1935
+ shaka.net.NetworkingEngine.OnResponse;
1936
+ /**
1937
+ * Creates an InitSegmentReference, which provides the location to an
1938
+ * initialization segment.
1939
+ */
1940
+ shaka.media.InitSegmentReference = class {
1941
+ /**
1942
+ * @param {function():!Array.<string>} uris A function that creates the URIs
1943
+ * of the resource containing the segment.
1944
+ * @param {number} startByte The offset from the start of the resource to the
1945
+ * start of the segment.
1946
+ * @param {?number} endByte The offset from the start of the resource
1947
+ * to the end of the segment, inclusive. A value of null indicates that the
1948
+ * segment extends to the end of the resource.
1949
+ * @param {null|shaka.extern.MediaQualityInfo=} mediaQuality Information about
1950
+ * the quality of the media associated with this init segment.
1951
+ * @param {(null|number)=} timescale
1952
+ * @param {(null|BufferSource)=} segmentData
1953
+ * @param {?shaka.extern.aesKey=} aesKey
1954
+ * The segment's AES-128-CBC full segment encryption key and iv.
1955
+ */
1956
+ constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData, aesKey) {}
1957
+ /**
1958
+ * Returns the offset from the start of the resource to the
1959
+ * start of the segment.
1960
+ * @return {number}
1961
+ */
1962
+ getStartByte() {}
1963
+ /**
1964
+ * Returns the offset from the start of the resource to the end of the
1965
+ * segment, inclusive. A value of null indicates that the segment extends
1966
+ * to the end of the resource.
1967
+ * @return {?number}
1968
+ */
1969
+ getEndByte() {}
1970
+ };
1971
+ /**
1972
+ * SegmentReference provides the start time, end time, and location to a media
1973
+ * segment.
1974
+ */
1975
+ shaka.media.SegmentReference = class {
1976
+ /**
1977
+ * @param {number} startTime The segment's start time in seconds.
1978
+ * @param {number} endTime The segment's end time in seconds. The segment
1979
+ * ends the instant before this time, so |endTime| must be strictly greater
1980
+ * than |startTime|.
1981
+ * @param {function():!Array.<string>} uris
1982
+ * A function that creates the URIs of the resource containing the segment.
1983
+ * @param {number} startByte The offset from the start of the resource to the
1984
+ * start of the segment.
1985
+ * @param {?number} endByte The offset from the start of the resource to the
1986
+ * end of the segment, inclusive. A value of null indicates that the
1987
+ * segment extends to the end of the resource.
1988
+ * @param {shaka.media.InitSegmentReference} initSegmentReference
1989
+ * The segment's initialization segment metadata, or null if the segments
1990
+ * are self-initializing.
1991
+ * @param {number} timestampOffset
1992
+ * The amount of time, in seconds, that must be added to the segment's
1993
+ * internal timestamps to align it to the presentation timeline.
1994
+ * <br>
1995
+ * For DASH, this value should equal the Period start time minus the first
1996
+ * presentation timestamp of the first frame/sample in the Period. For
1997
+ * example, for MP4 based streams, this value should equal Period start
1998
+ * minus the first segment's tfdt box's 'baseMediaDecodeTime' field (after
1999
+ * it has been converted to seconds).
2000
+ * <br>
2001
+ * For HLS, this value should be the start time of the most recent
2002
+ * discontinuity, or 0 if there is no preceding discontinuity. Only used
2003
+ * in segments mode.
2004
+ * @param {number} appendWindowStart
2005
+ * The start of the append window for this reference, relative to the
2006
+ * presentation. Any content from before this time will be removed by
2007
+ * MediaSource.
2008
+ * @param {number} appendWindowEnd
2009
+ * The end of the append window for this reference, relative to the
2010
+ * presentation. Any content from after this time will be removed by
2011
+ * MediaSource.
2012
+ * @param {!Array.<!shaka.media.SegmentReference>=} partialReferences
2013
+ * A list of SegmentReferences for the partial segments.
2014
+ * @param {?string=} tilesLayout
2015
+ * The value is a grid-item-dimension consisting of two positive decimal
2016
+ * integers in the format: column-x-row ('4x3'). It describes the
2017
+ * arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
2018
+ * @param {?number=} tileDuration
2019
+ * The explicit duration of an individual tile within the tiles grid.
2020
+ * If not provided, the duration should be automatically calculated based on
2021
+ * the duration of the reference.
2022
+ * @param {?number=} syncTime
2023
+ * A time value, expressed in seconds since 1970, which is used to
2024
+ * synchronize between streams. Both produced and consumed by the HLS
2025
+ * parser. Other components should not need this value.
2026
+ * @param {shaka.media.SegmentReference.Status=} status
2027
+ * The segment status is used to indicate that a segment does not exist or is
2028
+ * not available.
2029
+ * @param {?shaka.extern.aesKey=} aesKey
2030
+ * The segment's AES-128-CBC full segment encryption key and iv.
2031
+ * @param {boolean=} allPartialSegments
2032
+ * Indicate if the segment has all partial segments
2033
+ */
2034
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aesKey, allPartialSegments) {}
2035
+ /**
2036
+ * Creates and returns the URIs of the resource containing the segment.
2037
+ * @return {!Array.<string>}
2038
+ */
2039
+ getUris() {}
2040
+ /**
2041
+ * Returns the segment's start time in seconds.
2042
+ * @return {number}
2043
+ */
2044
+ getStartTime() {}
2045
+ /**
2046
+ * Returns the segment's end time in seconds.
2047
+ * @return {number}
2048
+ */
2049
+ getEndTime() {}
2050
+ /**
2051
+ * Returns the offset from the start of the resource to the
2052
+ * start of the segment.
2053
+ * @return {number}
2054
+ */
2055
+ getStartByte() {}
2056
+ /**
2057
+ * Returns the offset from the start of the resource to the end of the
2058
+ * segment, inclusive. A value of null indicates that the segment extends to
2059
+ * the end of the resource.
2060
+ * @return {?number}
2061
+ */
2062
+ getEndByte() {}
2063
+ /**
2064
+ * Returns the segment's tiles layout. Only defined in image segments.
2065
+ * @return {?string}
2066
+ */
2067
+ getTilesLayout() {}
2068
+ /**
2069
+ * Returns the segment's explicit tile duration.
2070
+ * Only defined in image segments.
2071
+ * @return {?number}
2072
+ */
2073
+ getTileDuration() {}
2074
+ /**
2075
+ * Returns the segment's status.
2076
+ * @return {shaka.media.SegmentReference.Status}
2077
+ */
2078
+ getStatus() {}
2079
+ /**
2080
+ * Mark the reference as unavailable.
2081
+ */
2082
+ markAsUnavailable() {}
2083
+ /**
2084
+ * Mark the reference as preload.
2085
+ */
2086
+ markAsPreload() {}
2087
+ /**
2088
+ * Returns true if the segment is preloaded.
2089
+ * @return {boolean}
2090
+ */
2091
+ isPreload() {}
2092
+ /**
2093
+ * Mark the reference as non-independent.
2094
+ */
2095
+ markAsNonIndependent() {}
2096
+ /**
2097
+ * Returns true if the segment is independent.
2098
+ * @return {boolean}
2099
+ */
2100
+ isIndependent() {}
2101
+ /**
2102
+ * Mark the reference as partial.
2103
+ */
2104
+ markAsPartial() {}
2105
+ /**
2106
+ * Returns true if the segment is partial.
2107
+ * @return {boolean}
2108
+ */
2109
+ isPartial() {}
2110
+ /**
2111
+ * Mark the reference as being the last part of the full segment
2112
+ */
2113
+ markAsLastPartial() {}
2114
+ /**
2115
+ * Returns true if reference as being the last part of the full segment.
2116
+ * @return {boolean}
2117
+ */
2118
+ isLastPartial() {}
2119
+ /**
2120
+ * Mark the reference as byterange optimization.
2121
+ * The "byterange optimization" means that it is playable using MP4 low
2122
+ * latency streaming with chunked data.
2123
+ */
2124
+ markAsByterangeOptimization() {}
2125
+ /**
2126
+ * Returns true if the segment has a byterange optimization.
2127
+ * @return {boolean}
2128
+ */
2129
+ hasByterangeOptimization() {}
2130
+ /**
2131
+ * Set the segment's thumbnail sprite.
2132
+ * @param {shaka.media.SegmentReference.ThumbnailSprite} thumbnailSprite
2133
+ */
2134
+ setThumbnailSprite(thumbnailSprite) {}
2135
+ /**
2136
+ * Returns the segment's thumbnail sprite.
2137
+ * @return {?shaka.media.SegmentReference.ThumbnailSprite}
2138
+ */
2139
+ getThumbnailSprite() {}
2140
+ /**
2141
+ * Offset the segment reference by a fixed amount.
2142
+ * @param {number} offset The amount to add to the segment's start and end
2143
+ * times.
2144
+ */
2145
+ offset(offset) {}
2146
+ /**
2147
+ * Sync this segment against a particular sync time that will serve as "0" in
2148
+ * the presentation timeline.
2149
+ * @param {number} lowestSyncTime
2150
+ */
2151
+ syncAgainst(lowestSyncTime) {}
2152
+ /**
2153
+ * Set the segment data.
2154
+ * @param {!BufferSource} segmentData
2155
+ */
2156
+ setSegmentData(segmentData) {}
2157
+ /**
2158
+ * Return the segment data.
2159
+ * @return {?BufferSource}
2160
+ */
2161
+ getSegmentData() {}
2162
+ };
2163
+ /**
2164
+ * Rather than using booleans to communicate what the state of the reference,
2165
+ * we have this enum.
2166
+ * @enum {number}
2167
+ */
2168
+ shaka.media.SegmentReference.Status = {
2169
+ AVAILABLE: 0,
2170
+ UNAVAILABLE: 1,
2171
+ MISSING: 2
2172
+ };
2173
+ /**
2174
+ * @typedef {{
2175
+ * height: number,
2176
+ * positionX: number,
2177
+ * positionY: number,
2178
+ * width: number
2179
+ * }}
2180
+ * @property {number} height
2181
+ * The thumbnail height in px.
2182
+ * @property {number} positionX
2183
+ * The thumbnail left position in px.
2184
+ * @property {number} positionY
2185
+ * The thumbnail top position in px.
2186
+ * @property {number} width
2187
+ * The thumbnail width in px.
2188
+ */
2189
+ shaka.media.SegmentReference.ThumbnailSprite;
2190
+ /**
2191
+ * SegmentIndex.
2192
+ * @implements {shaka.extern.SegmentIndex}
2193
+ * @implements {shaka.util.IReleasable}
2194
+ * @implements {Iterable.<!shaka.media.SegmentReference>}
2195
+ */
2196
+ shaka.media.SegmentIndex = class {
2197
+ /**
2198
+ * @param {!Array.<!shaka.media.SegmentReference>} references The list of
2199
+ * SegmentReferences, which must be sorted first by their start times
2200
+ * (ascending) and second by their end times (ascending).
2201
+ */
2202
+ constructor(references) {}
2203
+ /**
2204
+ * @override
2205
+ */
2206
+ getNumReferences() {}
2207
+ /**
2208
+ * @override
2209
+ */
2210
+ getNumEvicted() {}
2211
+ /**
2212
+ * @override
2213
+ */
2214
+ release() {}
2215
+ /**
2216
+ * Marks the index as immutable. Segments cannot be added or removed after
2217
+ * this point. This doesn't affect the references themselves. This also
2218
+ * makes the destroy/release methods do nothing.
2219
+ * This is mainly for testing.
2220
+ */
2221
+ markImmutable() {}
2222
+ /**
2223
+ * @override
2224
+ */
2225
+ find(time) {}
2226
+ /**
2227
+ * @override
2228
+ */
2229
+ get(position) {}
2230
+ /**
2231
+ * Offset all segment references by a fixed amount.
2232
+ * @param {number} offset The amount to add to each segment's start and end
2233
+ * times.
2234
+ */
2235
+ offset(offset) {}
2236
+ /**
2237
+ * Merges the given SegmentReferences and evicts the ones that end before the
2238
+ * given time. Supports extending the original references only.
2239
+ * Will not replace old references or interleave new ones.
2240
+ * Used, for example, by the DASH and HLS parser, where manifests may not list
2241
+ * all available references, so we must keep available references in memory to
2242
+ * fill the availability window.
2243
+ * @param {!Array.<!shaka.media.SegmentReference>} references The list of
2244
+ * SegmentReferences, which must be sorted first by their start times
2245
+ * (ascending) and second by their end times (ascending).
2246
+ * @param {number} windowStart The start of the availability window to filter
2247
+ * out the references that are no longer available.
2248
+ */
2249
+ mergeAndEvict(references, windowStart) {}
2250
+ /**
2251
+ * Removes all SegmentReferences that end before the given time.
2252
+ * @param {number} time The time in seconds.
2253
+ */
2254
+ evict(time) {}
2255
+ /**
2256
+ * Drops references that start after windowEnd, or end before windowStart,
2257
+ * and contracts the last reference so that it ends at windowEnd.
2258
+ * Do not call on the last period of a live presentation (unknown duration).
2259
+ * It is okay to call on the other periods of a live presentation, where the
2260
+ * duration is known and another period has been added.
2261
+ * @param {number} windowStart
2262
+ * @param {?number} windowEnd
2263
+ * @param {boolean=} isNew Whether this is a new SegmentIndex and we shouldn't
2264
+ * update the number of evicted elements.
2265
+ */
2266
+ fit(windowStart, windowEnd, isNew) {}
2267
+ /**
2268
+ * Updates the references every so often. Stops when the references list
2269
+ * returned by the callback is null.
2270
+ * @param {number} interval The interval in seconds.
2271
+ * @param {function():Array.<shaka.media.SegmentReference>} updateCallback
2272
+ */
2273
+ updateEvery(interval, updateCallback) {}
2274
+ /**
2275
+ * Returns a new iterator that initially points to the segment that contains
2276
+ * the given time, or the nearest independent segment before it.
2277
+ * Like the normal iterator, next() must be called first to get to the first
2278
+ * element. Returns null if we do not find a segment at the
2279
+ * requested time.
2280
+ * The first segment returned by the iterator _MUST_ be an independent
2281
+ * segment. Assumes that only partial references can be dependent, based on
2282
+ * RFC 8216 rev 13, section 8.1: "Each (non-Partial) Media Segment in a Media
2283
+ * Playlist will contain at least one independent frame."
2284
+ * @param {number} time
2285
+ * @param {boolean=} allowNonIndepedent
2286
+ * @param {boolean=} reverse
2287
+ * @return {?shaka.media.SegmentIterator}
2288
+ */
2289
+ getIteratorForTime(time, allowNonIndepedent, reverse) {}
2290
+ /**
2291
+ * Create a SegmentIndex for a single segment of the given start time and
2292
+ * duration at the given URIs.
2293
+ * @param {number} startTime
2294
+ * @param {number} duration
2295
+ * @param {!Array.<string>} uris
2296
+ * @return {!shaka.media.SegmentIndex}
2297
+ */
2298
+ static forSingleSegment(startTime, duration, uris) {}
2299
+ };
2300
+ /**
2301
+ * An iterator over a SegmentIndex's references.
2302
+ * @implements {Iterator.<shaka.media.SegmentReference>}
2303
+ */
2304
+ shaka.media.SegmentIterator = class {
2305
+ /**
2306
+ * @param {shaka.media.SegmentIndex} segmentIndex
2307
+ * @param {number} index
2308
+ * @param {number} partialSegmentIndex
2309
+ * @param {boolean} reverse
2310
+ */
2311
+ constructor(segmentIndex, index, partialSegmentIndex, reverse) {}
2312
+ /**
2313
+ * @param {boolean} reverse
2314
+ */
2315
+ setReverse(reverse) {}
2316
+ /**
2317
+ * @return {number}
2318
+ */
2319
+ currentPosition() {}
2320
+ /**
2321
+ * @return {shaka.media.SegmentReference}
2322
+ */
2323
+ current() {}
2324
+ /**
2325
+ * @override
2326
+ */
2327
+ next() {}
2328
+ };
2329
+ /**
2330
+ * A meta-SegmentIndex composed of multiple other SegmentIndexes.
2331
+ * Used in constructing multi-Period Streams for DASH.
2332
+ * @extends shaka.media.SegmentIndex
2333
+ * @implements {shaka.util.IReleasable}
2334
+ * @implements {Iterable.<!shaka.media.SegmentReference>}
2335
+ */
2336
+ shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
2337
+ /** */
2338
+ constructor() {}
2339
+ /**
2340
+ * @override
2341
+ */
2342
+ release() {}
2343
+ /**
2344
+ * @override
2345
+ */
2346
+ forEachTopLevelReference(fn) {}
2347
+ /**
2348
+ * @override
2349
+ */
2350
+ find(time) {}
2351
+ /**
2352
+ * @override
2353
+ */
2354
+ get(position) {}
2355
+ /**
2356
+ * @override
2357
+ */
2358
+ offset(offset) {}
2359
+ /**
2360
+ * @override
2361
+ */
2362
+ merge(references) {}
2363
+ /**
2364
+ * @override
2365
+ */
2366
+ evict(time) {}
2367
+ /**
2368
+ * @override
2369
+ */
2370
+ mergeAndEvict(references, windowStart) {}
2371
+ /**
2372
+ * @override
2373
+ */
2374
+ fit(windowStart, windowEnd) {}
2375
+ /**
2376
+ * @override
2377
+ */
2378
+ updateEvery(interval, updateCallback) {}
2379
+ };
2380
+ /**
2381
+ * @summary An interface to register manifest parsers.
2382
+ */
2383
+ shaka.media.ManifestParser = class {
2384
+ /**
2385
+ * Registers a manifest parser by file extension.
2386
+ * @param {string} extension The file extension of the manifest.
2387
+ * @param {shaka.extern.ManifestParser.Factory} parserFactory The factory
2388
+ * used to create parser instances.
2389
+ */
2390
+ static registerParserByExtension(extension, parserFactory) {}
2391
+ /**
2392
+ * Registers a manifest parser by MIME type.
2393
+ * @param {string} mimeType The MIME type of the manifest.
2394
+ * @param {shaka.extern.ManifestParser.Factory} parserFactory The factory
2395
+ * used to create parser instances.
2396
+ */
2397
+ static registerParserByMime(mimeType, parserFactory) {}
2398
+ /**
2399
+ * Unregisters a manifest parser by MIME type.
2400
+ * @param {string} mimeType The MIME type of the manifest.
2401
+ */
2402
+ static unregisterParserByMime(mimeType) {}
2403
+ };
2404
+ /**
2405
+ * @enum {string}
2406
+ */
2407
+ shaka.media.ManifestParser.AccessibilityPurpose = {
2408
+ VISUALLY_IMPAIRED: 'visually impaired',
2409
+ HARD_OF_HEARING: 'hard of hearing'
2410
+ };
2411
+ /**
2412
+ * PresentationTimeline.
2413
+ */
2414
+ shaka.media.PresentationTimeline = class {
2415
+ /**
2416
+ * @param {?number} presentationStartTime The wall-clock time, in seconds,
2417
+ * when the presentation started or will start. Only required for live.
2418
+ * @param {number} presentationDelay The delay to give the presentation, in
2419
+ * seconds. Only required for live.
2420
+ * @param {boolean=} autoCorrectDrift Whether to account for drift when
2421
+ * determining the availability window.
2422
+ * @see {shaka.extern.Manifest}
2423
+ * @see {@tutorial architecture}
2424
+ */
2425
+ constructor(presentationStartTime, presentationDelay, autoCorrectDrift) {}
2426
+ /**
2427
+ * @return {number} The presentation's duration in seconds.
2428
+ * Infinity indicates that the presentation continues indefinitely.
2429
+ */
2430
+ getDuration() {}
2431
+ /**
2432
+ * @return {number} The presentation's max segment duration in seconds.
2433
+ */
2434
+ getMaxSegmentDuration() {}
2435
+ /**
2436
+ * Sets the presentation's start time.
2437
+ * @param {number} presentationStartTime The wall-clock time, in seconds,
2438
+ * when the presentation started or will start. Only required for live.
2439
+ */
2440
+ setPresentationStartTime(presentationStartTime) {}
2441
+ /**
2442
+ * Sets the presentation's duration.
2443
+ * @param {number} duration The presentation's duration in seconds.
2444
+ * Infinity indicates that the presentation continues indefinitely.
2445
+ */
2446
+ setDuration(duration) {}
2447
+ /**
2448
+ * @return {?number} The presentation's start time in seconds.
2449
+ */
2450
+ getPresentationStartTime() {}
2451
+ /**
2452
+ * Sets the clock offset, which is the difference between the client's clock
2453
+ * and the server's clock, in milliseconds (i.e., serverTime = Date.now() +
2454
+ * clockOffset).
2455
+ * @param {number} offset The clock offset, in ms.
2456
+ */
2457
+ setClockOffset(offset) {}
2458
+ /**
2459
+ * Sets the presentation's static flag.
2460
+ * @param {boolean} isStatic If true, the presentation is static, meaning all
2461
+ * segments are available at once.
2462
+ */
2463
+ setStatic(isStatic) {}
2464
+ /**
2465
+ * Sets the presentation's segment availability duration. The segment
2466
+ * availability duration should only be set for live.
2467
+ * @param {number} segmentAvailabilityDuration The presentation's new segment
2468
+ * availability duration in seconds.
2469
+ */
2470
+ setSegmentAvailabilityDuration(segmentAvailabilityDuration) {}
2471
+ /**
2472
+ * Gets the presentation's segment availability duration.
2473
+ * @return {number}
2474
+ */
2475
+ getSegmentAvailabilityDuration() {}
2476
+ /**
2477
+ * Sets the presentation delay in seconds.
2478
+ * @param {number} delay
2479
+ */
2480
+ setDelay(delay) {}
2481
+ /**
2482
+ * Gets the presentation delay in seconds.
2483
+ * @return {number}
2484
+ */
2485
+ getDelay() {}
2486
+ /**
2487
+ * Gives PresentationTimeline a Stream's timeline so it can size and position
2488
+ * the segment availability window, and account for missing segment
2489
+ * information.
2490
+ * @param {!Array.<shaka.media.PresentationTimeline.TimeRange>} timeline
2491
+ * @param {number} startOffset
2492
+ */
2493
+ notifyTimeRange(timeline, startOffset) {}
2494
+ /**
2495
+ * Gives PresentationTimeline an array of segments so it can size and position
2496
+ * the segment availability window, and account for missing segment
2497
+ * information. These segments do not necessarily need to all be from the
2498
+ * same stream.
2499
+ * @param {!Array.<!shaka.media.SegmentReference>} references
2500
+ */
2501
+ notifySegments(references) {}
2502
+ /**
2503
+ * Lock the presentation timeline's start time. After this is called, no
2504
+ * further adjustments to presentationStartTime_ will be permitted.
2505
+ * This should be called after all Periods have been parsed, and all calls to
2506
+ * notifySegments() from the initial manifest parse have been made.
2507
+ * Without this, we can get assertion failures in SegmentIndex for certain
2508
+ * DAI content. If DAI adds ad segments to the manifest faster than
2509
+ * real-time, adjustments to presentationStartTime_ can cause availability
2510
+ * windows to jump around on updates.
2511
+ */
2512
+ lockStartTime() {}
2513
+ /**
2514
+ * Returns if the presentation timeline's start time is locked.
2515
+ * @return {boolean}
2516
+ */
2517
+ isStartTimeLocked() {}
2518
+ /**
2519
+ * Sets the initial program date time.
2520
+ * @param {number} initialProgramDateTime
2521
+ */
2522
+ setInitialProgramDateTime(initialProgramDateTime) {}
2523
+ /**
2524
+ * @return {?number} The initial program date time in seconds.
2525
+ */
2526
+ getInitialProgramDateTime() {}
2527
+ /**
2528
+ * Gives PresentationTimeline a Stream's minimum segment start time.
2529
+ * @param {number} startTime
2530
+ */
2531
+ notifyMinSegmentStartTime(startTime) {}
2532
+ /**
2533
+ * Gives PresentationTimeline a Stream's maximum segment duration so it can
2534
+ * size and position the segment availability window. This function should be
2535
+ * called once for each Stream (no more, no less), but does not have to be
2536
+ * called if notifySegments() is called instead for a particular stream.
2537
+ * @param {number} maxSegmentDuration The maximum segment duration for a
2538
+ * particular stream.
2539
+ */
2540
+ notifyMaxSegmentDuration(maxSegmentDuration) {}
2541
+ /**
2542
+ * Offsets the segment times by the given amount.
2543
+ * @param {number} offset The number of seconds to offset by. A positive
2544
+ * number adjusts the segment times forward.
2545
+ */
2546
+ offset(offset) {}
2547
+ /**
2548
+ * @return {boolean} True if the presentation is live; otherwise, return
2549
+ * false.
2550
+ */
2551
+ isLive() {}
2552
+ /**
2553
+ * @return {boolean} True if the presentation is in progress (meaning not
2554
+ * live, but also not completely available); otherwise, return false.
2555
+ */
2556
+ isInProgress() {}
2557
+ /**
2558
+ * Gets the presentation's current segment availability start time. Segments
2559
+ * ending at or before this time should be assumed to be unavailable.
2560
+ * @return {number} The current segment availability start time, in seconds,
2561
+ * relative to the start of the presentation.
2562
+ */
2563
+ getSegmentAvailabilityStart() {}
2564
+ /**
2565
+ * Sets the start time of the user-defined seek range. This is only used for
2566
+ * VOD content.
2567
+ * @param {number} time
2568
+ */
2569
+ setUserSeekStart(time) {}
2570
+ /**
2571
+ * Gets the presentation's current segment availability end time. Segments
2572
+ * starting after this time should be assumed to be unavailable.
2573
+ * @return {number} The current segment availability end time, in seconds,
2574
+ * relative to the start of the presentation. For VOD, the availability
2575
+ * end time is the content's duration. If the Player's playRangeEnd
2576
+ * configuration is used, this can override the duration.
2577
+ */
2578
+ getSegmentAvailabilityEnd() {}
2579
+ /**
2580
+ * Gets the seek range start time, offset by the given amount. This is used
2581
+ * to ensure that we don't "fall" back out of the seek window while we are
2582
+ * buffering.
2583
+ * @param {number} offset The offset to add to the start time for live
2584
+ * streams.
2585
+ * @return {number} The current seek start time, in seconds, relative to the
2586
+ * start of the presentation.
2587
+ */
2588
+ getSafeSeekRangeStart(offset) {}
2589
+ /**
2590
+ * Gets the seek range start time.
2591
+ * @return {number}
2592
+ */
2593
+ getSeekRangeStart() {}
2594
+ /**
2595
+ * Gets the seek range end.
2596
+ * @return {number}
2597
+ */
2598
+ getSeekRangeEnd() {}
2599
+ /**
2600
+ * True if the presentation start time is being used to calculate the live
2601
+ * edge.
2602
+ * Using the presentation start time means that the stream may be subject to
2603
+ * encoder drift. At runtime, we will avoid using the presentation start time
2604
+ * whenever possible.
2605
+ * @return {boolean}
2606
+ */
2607
+ usingPresentationStartTime() {}
2608
+ /**
2609
+ * Sets the presentation's segment availability time offset. This should be
2610
+ * only set for Low Latency Dash.
2611
+ * The segments are available earlier for download than the availability start
2612
+ * time, so we can move closer to the live edge.
2613
+ * @param {number} offset
2614
+ */
2615
+ setAvailabilityTimeOffset(offset) {}
2616
+ };
2617
+ /**
2618
+ * @typedef {{
2619
+ * start: number,
2620
+ * unscaledStart: number,
2621
+ * end: number,
2622
+ * partialSegments: number,
2623
+ * segmentPosition: number
2624
+ * }}
2625
+ * @description
2626
+ * Defines a time range of a media segment. Times are in seconds.
2627
+ * @property {number} start
2628
+ * The start time of the range.
2629
+ * @property {number} unscaledStart
2630
+ * The start time of the range in representation timescale units.
2631
+ * @property {number} end
2632
+ * The end time (exclusive) of the range.
2633
+ * @property {number} partialSegments
2634
+ * The number of partial segments
2635
+ * @property {number} segmentPosition
2636
+ * The segment position of the timeline entry as it appears in the manifest
2637
+ */
2638
+ shaka.media.PresentationTimeline.TimeRange;
2639
+ /**
2640
+ * A utility to combine streams across periods.
2641
+ * @implements {shaka.util.IReleasable}
2642
+ * @final
2643
+ */
2644
+ shaka.util.PeriodCombiner = class {
2645
+ /** */
2646
+ constructor() {}
2647
+ /**
2648
+ * @return {!Array.<shaka.extern.Variant>}
2649
+ */
2650
+ getVariants() {}
2651
+ /**
2652
+ * @return {!Array.<shaka.extern.Stream>}
2653
+ */
2654
+ getTextStreams() {}
2655
+ /**
2656
+ * @return {!Array.<shaka.extern.Stream>}
2657
+ */
2658
+ getImageStreams() {}
2659
+ /**
2660
+ * @param {!Array.<shaka.extern.Period>} periods
2661
+ * @param {boolean} isDynamic
2662
+ * @return {!Promise}
2663
+ */
2664
+ combinePeriods(periods, isDynamic) {}
2665
+ /**
2666
+ * @param {boolean} allowed If set to true, multi-mimeType or multi-codec
2667
+ * variants will be allowed.
2668
+ */
2669
+ setAllowMultiTypeVariants(allowed) {}
2670
+ /**
2671
+ * @param {boolean} useOnce if true, stream will be used only once in period
2672
+ * flattening algoritnm.
2673
+ */
2674
+ setUseStreamOnce(useOnce) {}
2675
+ };
2676
+ /** */
2677
+ shaka.util.ConfigUtils = class {
2678
+ /**
2679
+ * @param {!Object} destination
2680
+ * @param {!Object} source
2681
+ * @param {!Object} template supplies default values
2682
+ * @param {!Object} overrides
2683
+ * Supplies override type checking. When the current path matches
2684
+ * the key in this object, each sub-value must match the type in this
2685
+ * object. If this contains an Object, it is used as the template.
2686
+ * @param {string} path to this part of the config
2687
+ * @return {boolean}
2688
+ */
2689
+ static mergeConfigObjects(destination, source, template, overrides, path) {}
2690
+ /**
2691
+ * Convert config from ('fieldName', value) format to a partial config object.
2692
+ * E. g. from ('manifest.retryParameters.maxAttempts', 1) to
2693
+ * { manifest: { retryParameters: { maxAttempts: 1 }}}.
2694
+ * @param {string} fieldName
2695
+ * @param {*} value
2696
+ * @return {!Object}
2697
+ */
2698
+ static convertToConfigObject(fieldName, value) {}
2699
+ };
2700
+ /**
2701
+ * @summary A set of FairPlay utility functions.
2702
+ */
2703
+ shaka.util.FairPlayUtils = class {
2704
+ /**
2705
+ * Check if FairPlay is supported.
2706
+ * @return {!Promise.<boolean>}
2707
+ */
2708
+ static isFairPlaySupported() {}
2709
+ /**
2710
+ * Using the default method, extract a content ID from the init data. This is
2711
+ * based on the FairPlay example documentation.
2712
+ * @param {!BufferSource} initData
2713
+ * @return {string}
2714
+ */
2715
+ static defaultGetContentId(initData) {}
2716
+ /**
2717
+ * Transforms the init data buffer using the given data. The format is:
2718
+ * <pre>
2719
+ * [4 bytes] initDataSize
2720
+ * [initDataSize bytes] initData
2721
+ * [4 bytes] contentIdSize
2722
+ * [contentIdSize bytes] contentId
2723
+ * [4 bytes] certSize
2724
+ * [certSize bytes] cert
2725
+ * </pre>
2726
+ * @param {!BufferSource} initData
2727
+ * @param {!BufferSource|string} contentId
2728
+ * @param {?BufferSource} cert The server certificate; this will throw if not
2729
+ * provided.
2730
+ * @return {!Uint8Array}
2731
+ */
2732
+ static initDataTransform(initData, contentId, cert) {}
2733
+ /**
2734
+ * Verimatrix initDataTransform configuration.
2735
+ * @param {!Uint8Array} initData
2736
+ * @param {string} initDataType
2737
+ * @param {?shaka.extern.DrmInfo} drmInfo
2738
+ */
2739
+ static verimatrixInitDataTransform(initData, initDataType, drmInfo) {}
2740
+ /**
2741
+ * EZDRM initDataTransform configuration.
2742
+ * @param {!Uint8Array} initData
2743
+ * @param {string} initDataType
2744
+ * @param {?shaka.extern.DrmInfo} drmInfo
2745
+ */
2746
+ static ezdrmInitDataTransform(initData, initDataType, drmInfo) {}
2747
+ /**
2748
+ * Conax initDataTransform configuration.
2749
+ * @param {!Uint8Array} initData
2750
+ * @param {string} initDataType
2751
+ * @param {?shaka.extern.DrmInfo} drmInfo
2752
+ */
2753
+ static conaxInitDataTransform(initData, initDataType, drmInfo) {}
2754
+ /**
2755
+ * ExpressPlay initDataTransform configuration.
2756
+ * @param {!Uint8Array} initData
2757
+ * @param {string} initDataType
2758
+ * @param {?shaka.extern.DrmInfo} drmInfo
2759
+ */
2760
+ static expressplayInitDataTransform(initData, initDataType, drmInfo) {}
2761
+ /**
2762
+ * Verimatrix FairPlay request.
2763
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2764
+ * @param {shaka.extern.Request} request
2765
+ * @param {shaka.extern.RequestContext=} context
2766
+ */
2767
+ static verimatrixFairPlayRequest(type, request, context) {}
2768
+ /**
2769
+ * EZDRM FairPlay request.
2770
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2771
+ * @param {shaka.extern.Request} request
2772
+ * @param {shaka.extern.RequestContext=} context
2773
+ */
2774
+ static ezdrmFairPlayRequest(type, request, context) {}
2775
+ /**
2776
+ * Conax FairPlay request.
2777
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2778
+ * @param {shaka.extern.Request} request
2779
+ * @param {shaka.extern.RequestContext=} context
2780
+ */
2781
+ static conaxFairPlayRequest(type, request, context) {}
2782
+ /**
2783
+ * ExpressPlay FairPlay request.
2784
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2785
+ * @param {shaka.extern.Request} request
2786
+ * @param {shaka.extern.RequestContext=} context
2787
+ */
2788
+ static expressplayFairPlayRequest(type, request, context) {}
2789
+ /**
2790
+ * Common FairPlay response transform for some DRMs providers.
2791
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2792
+ * @param {shaka.extern.Response} response
2793
+ * @param {shaka.extern.RequestContext=} context
2794
+ */
2795
+ static commonFairPlayResponse(type, response, context) {}
2796
+ };
2797
+ /**
2798
+ * @final
2799
+ */
2800
+ shaka.util.PlayerConfiguration = class {
2801
+ /**
2802
+ * @return {shaka.extern.PlayerConfiguration}
2803
+ */
2804
+ static createDefault() {}
2805
+ /**
2806
+ * Merges the given configuration changes into the given destination. This
2807
+ * uses the default Player configurations as the template.
2808
+ * @param {shaka.extern.PlayerConfiguration} destination
2809
+ * @param {!Object} updates
2810
+ * @param {shaka.extern.PlayerConfiguration=} template
2811
+ * @return {boolean}
2812
+ */
2813
+ static mergeConfigObjects(destination, updates, template) {}
2814
+ };
2815
+ /**
2816
+ * Creates a new DASH parser.
2817
+ * @implements {shaka.extern.ManifestParser}
2818
+ */
2819
+ shaka.dash.DashParser = class {
2820
+ /** Creates a new DASH parser. */
2821
+ constructor() {}
2822
+ /**
2823
+ * @override
2824
+ */
2825
+ configure(config) {}
2826
+ /**
2827
+ * @override
2828
+ */
2829
+ start(uri, playerInterface) {}
2830
+ /**
2831
+ * @override
2832
+ */
2833
+ stop() {}
2834
+ /**
2835
+ * @override
2836
+ */
2837
+ update() {}
2838
+ /**
2839
+ * @override
2840
+ */
2841
+ onExpirationUpdated(sessionId, expiration) {}
2842
+ /**
2843
+ * @override
2844
+ */
2845
+ onInitialVariantChosen(variant) {}
2846
+ /**
2847
+ * @override
2848
+ */
2849
+ banLocation(uri) {}
2850
+ };
2851
+ /**
2852
+ */
2853
+ shaka.dependencies = class {
2854
+ /**
2855
+ * Registers a new dependency.
2856
+ * @param {shaka.dependencies.Allowed} key which is used for retrieving a
2857
+ * dependency
2858
+ * @param {?} dep a dependency
2859
+ */
2860
+ static add(key, dep) {}
2861
+ /**
2862
+ * Check if we have a dependency for the key.
2863
+ * @param {shaka.dependencies.Allowed} key key
2864
+ * @return {boolean}
2865
+ */
2866
+ static has(key) {}
2867
+ };
2868
+ /**
2869
+ * @enum {string}
2870
+ */
2871
+ shaka.dependencies.Allowed = {
2872
+ muxjs: 'muxjs',
2873
+ ISOBoxer: 'ISOBoxer'
2874
+ };
2875
+ /**
2876
+ * @summary
2877
+ * lcevcDec - (MPEG-5 Part 2 LCEVC - Decoder) provides
2878
+ * all the operations related to the enhancement and rendering
2879
+ * of LCEVC enabled streams and on to a canvas.
2880
+ * @implements {shaka.util.IReleasable}
2881
+ */
2882
+ shaka.lcevc.Dec = class {
2883
+ /**
2884
+ * @param {HTMLVideoElement} media The video element that will be attached to
2885
+ * LCEVC Decoder for input.
2886
+ * @param {HTMLCanvasElement} canvas The canvas element that will be attached
2887
+ * to LCEVC Decoder to render the enhanced frames.
2888
+ * @param {shaka.extern.LcevcConfiguration} lcevcConfig LCEVC configuration
2889
+ * object to initialize the LCEVC Decoder.
2890
+ */
2891
+ constructor(media, canvas, lcevcConfig) {}
2892
+ /**
2893
+ * Close LCEVC Decoder.
2894
+ * @override
2895
+ */
2896
+ release() {}
2897
+ };
2898
+ /**
2899
+ * @summary A set of Id3Utils utility functions.
2900
+ */
2901
+ shaka.util.Id3Utils = class {
2902
+ /**
2903
+ * Returns an array of ID3 frames found in all the ID3 tags in the id3Data
2904
+ * @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags
2905
+ * @return {!Array.<shaka.extern.MetadataFrame>}
2906
+ */
2907
+ static getID3Frames(id3Data) {}
2908
+ /**
2909
+ * Returns any adjacent ID3 tags found in data starting at offset, as one
2910
+ * block of data
2911
+ * @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags
2912
+ * @param {number=} offset - The offset at which to start searching
2913
+ * @return {!Uint8Array}
2914
+ */
2915
+ static getID3Data(id3Data, offset) {}
2916
+ };
2917
+ /**
2918
+ * @summary
2919
+ * Parser for exponential Golomb codes, a variable-bitwidth number encoding
2920
+ * scheme used by h264.
2921
+ * Based on https://github.com/videojs/mux.js/blob/main/lib/utils/exp-golomb.js
2922
+ */
2923
+ shaka.util.ExpGolomb = class {
2924
+ /**
2925
+ * @param {!Uint8Array} data
2926
+ * @param {boolean=} convertEbsp2rbsp
2927
+ */
2928
+ constructor(data, convertEbsp2rbsp) {}
2929
+ };
2930
+ /**
2931
+ * @see https://en.wikipedia.org/wiki/MPEG_transport_stream
2932
+ */
2933
+ shaka.util.TsParser = class {
2934
+ /** */
2935
+ constructor() {}
2936
+ /**
2937
+ * Clear previous data
2938
+ */
2939
+ clearData() {}
2940
+ /**
2941
+ * Parse the given data
2942
+ * @param {Uint8Array} data
2943
+ * @return {!shaka.util.TsParser}
2944
+ */
2945
+ parse(data) {}
2946
+ /**
2947
+ * Parse AVC Nalus
2948
+ * The code is based on hls.js
2949
+ * Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
2950
+ * @param {shaka.extern.MPEG_PES} pes
2951
+ * @param {?shaka.extern.MPEG_PES=} nextPes
2952
+ * @return {!Array.<shaka.extern.VideoNalu>}
2953
+ */
2954
+ parseAvcNalus(pes, nextPes) {}
2955
+ /**
2956
+ * Parse AVC and HVC Nalus
2957
+ * The code is based on hls.js
2958
+ * Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
2959
+ * @param {shaka.extern.MPEG_PES} pes
2960
+ * @param {?shaka.extern.VideoNalu=} lastNalu
2961
+ * @param {?number=} lastState
2962
+ * @return {!Array.<shaka.extern.VideoNalu>}
2963
+ */
2964
+ parseNalus(pes, lastNalu, lastState) {}
2965
+ /**
2966
+ * Return the ID3 metadata
2967
+ * @return {!Array.<shaka.extern.ID3Metadata>}
2968
+ */
2969
+ getMetadata() {}
2970
+ /**
2971
+ * Return the audio data
2972
+ * @return {!Array.<shaka.extern.MPEG_PES>}
2973
+ */
2974
+ getAudioData() {}
2975
+ /**
2976
+ * Return the audio data
2977
+ * @param {boolean=} naluProcessing
2978
+ * @return {!Array.<shaka.extern.MPEG_PES>}
2979
+ */
2980
+ getVideoData(naluProcessing) {}
2981
+ /**
2982
+ * Return the start time for the audio and video
2983
+ * @param {string} contentType
2984
+ * @return {?number}
2985
+ */
2986
+ getStartTime(contentType) {}
2987
+ /**
2988
+ * Return the audio and video codecs
2989
+ * @return {{audio: ?string, video: ?string}}
2990
+ */
2991
+ getCodecs() {}
2992
+ /**
2993
+ * Return the video data
2994
+ * @return {!Array.<shaka.extern.VideoNalu>}
2995
+ */
2996
+ getVideoNalus() {}
2997
+ /**
2998
+ * Return the video resolution
2999
+ * @return {{height: ?string, width: ?string}}
3000
+ */
3001
+ getVideoResolution() {}
3002
+ /**
3003
+ * Return the video information
3004
+ * @return {{height: ?string, width: ?string, codec: ?string}}
3005
+ */
3006
+ getVideoInfo() {}
3007
+ /**
3008
+ * Check if the passed data corresponds to an MPEG2-TS
3009
+ * @param {Uint8Array} data
3010
+ * @return {boolean}
3011
+ */
3012
+ static probe(data) {}
3013
+ /**
3014
+ * Returns the synchronization offset
3015
+ * @param {Uint8Array} data
3016
+ * @return {number}
3017
+ */
3018
+ static syncOffset(data) {}
3019
+ };
3020
+ /**
3021
+ * @const {number}
3022
+ */
3023
+ shaka.util.TsParser.Timescale;
3024
+ /**
3025
+ * @typedef {function(
3026
+ * !(shaka.media.InitSegmentReference|shaka.media.SegmentReference),
3027
+ * shaka.extern.Stream,
3028
+ * ?function(BufferSource):!Promise=
3029
+ * ):!shaka.net.NetworkingEngine.PendingRequest}
3030
+ * @description
3031
+ * A callback function that fetches a segment.
3032
+ */
3033
+ shaka.media.SegmentPrefetch.FetchDispatcher;
3034
+ /**
3035
+ * @implements {shaka.util.IDestroyable}
3036
+ */
3037
+ shaka.media.PreloadManager = class extends shaka.util.FakeEventTarget {
3038
+ /**
3039
+ * @param {string} assetUri
3040
+ * @param {?string} mimeType
3041
+ * @param {number} startTimeOfLoad
3042
+ * @param {?number} startTime
3043
+ * @param {*} playerInterface
3044
+ */
3045
+ constructor(assetUri, mimeType, startTimeOfLoad, startTime, playerInterface) {}
3046
+ /**
3047
+ * Waits for the loading to be finished (or to fail with an error).
3048
+ * @return {!Promise}
3049
+ */
3050
+ waitForFinish() {}
3051
+ /**
3052
+ * Releases or stops all non-entrusted resources.
3053
+ * @override
3054
+ */
3055
+ destroy() {}
3056
+ };
3057
+ /**
3058
+ * @summary A networking plugin to handle data URIs.
3059
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs
3060
+ */
3061
+ shaka.net.DataUriPlugin = class {
3062
+ /**
3063
+ * @param {string} uri
3064
+ * @param {shaka.extern.Request} request
3065
+ * @param {shaka.net.NetworkingEngine.RequestType} requestType
3066
+ * @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
3067
+ * progress event happened.
3068
+ * @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
3069
+ */
3070
+ static parse(uri, request, requestType, progressUpdated) {}
3071
+ };
3072
+ /**
3073
+ * @summary A networking plugin to handle http and https URIs via the Fetch API.
3074
+ */
3075
+ shaka.net.HttpFetchPlugin = class {
3076
+ /**
3077
+ * @param {string} uri
3078
+ * @param {shaka.extern.Request} request
3079
+ * @param {shaka.net.NetworkingEngine.RequestType} requestType
3080
+ * @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
3081
+ * progress event happened.
3082
+ * @param {shaka.extern.HeadersReceived} headersReceived Called when the
3083
+ * headers for the download are received, but before the body is.
3084
+ * @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
3085
+ */
3086
+ static parse(uri, request, requestType, progressUpdated, headersReceived) {}
3087
+ /**
3088
+ * Determine if the Fetch API is supported in the browser. Note: this is
3089
+ * deliberately exposed as a method to allow the client app to use the same
3090
+ * logic as Shaka when determining support.
3091
+ * @return {boolean}
3092
+ */
3093
+ static isSupported() {}
3094
+ };
3095
+ /**
3096
+ * @summary A networking plugin to handle http and https URIs via XHR.
3097
+ */
3098
+ shaka.net.HttpXHRPlugin = class {
3099
+ /**
3100
+ * @param {string} uri
3101
+ * @param {shaka.extern.Request} request
3102
+ * @param {shaka.net.NetworkingEngine.RequestType} requestType
3103
+ * @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
3104
+ * progress event happened.
3105
+ * @param {shaka.extern.HeadersReceived} headersReceived Called when the
3106
+ * headers for the download are received, but before the body is.
3107
+ * @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
3108
+ */
3109
+ static parse(uri, request, requestType, progressUpdated, headersReceived) {}
3110
+ };
3111
+ /**
3112
+ * A text displayer plugin using the browser's native VTTCue interface.
3113
+ * @implements {shaka.extern.TextDisplayer}
3114
+ */
3115
+ shaka.text.SimpleTextDisplayer = class {
3116
+ /**
3117
+ * @param {HTMLMediaElement} video
3118
+ * @param {string} label
3119
+ */
3120
+ constructor(video, label) {}
3121
+ /**
3122
+ * @override
3123
+ */
3124
+ configure(config) {}
3125
+ /**
3126
+ * @override
3127
+ */
3128
+ remove(start, end) {}
3129
+ /**
3130
+ * @override
3131
+ */
3132
+ append(cues) {}
3133
+ /**
3134
+ * @override
3135
+ */
3136
+ destroy() {}
3137
+ /**
3138
+ * @override
3139
+ */
3140
+ isTextVisible() {}
3141
+ /**
3142
+ * @override
3143
+ */
3144
+ setTextVisibility(on) {}
3145
+ };
3146
+ /**
3147
+ * A stub text displayer plugin that does nothing
3148
+ * @implements {shaka.extern.TextDisplayer}
3149
+ */
3150
+ shaka.text.StubTextDisplayer = class {
3151
+ /**
3152
+ * @override
3153
+ */
3154
+ configure(config) {}
3155
+ /**
3156
+ * @override
3157
+ */
3158
+ remove(start, end) {}
3159
+ /**
3160
+ * @override
3161
+ */
3162
+ append(cues) {}
3163
+ /**
3164
+ * @override
3165
+ */
3166
+ destroy() {}
3167
+ /**
3168
+ * @override
3169
+ */
3170
+ isTextVisible() {}
3171
+ /**
3172
+ * @override
3173
+ */
3174
+ setTextVisibility(on) {}
3175
+ };
3176
+ /** */
3177
+ shaka.util.Dom = class {
3178
+ /**
3179
+ * Remove all of the child nodes of an element.
3180
+ * @param {!Element} element
3181
+ */
3182
+ static removeAllChildren(element) {}
3183
+ };
3184
+ /**
3185
+ * The text displayer plugin for the Shaka Player UI. Can also be used directly
3186
+ * by providing an appropriate container element.
3187
+ * @implements {shaka.extern.TextDisplayer}
3188
+ * @final
3189
+ */
3190
+ shaka.text.UITextDisplayer = class {
3191
+ /**
3192
+ * Constructor.
3193
+ * @param {HTMLMediaElement} video
3194
+ * @param {HTMLElement} videoContainer
3195
+ * @param {shaka.extern.TextDisplayerConfiguration} config
3196
+ */
3197
+ constructor(video, videoContainer, config) {}
3198
+ /**
3199
+ * @override
3200
+ */
3201
+ configure(config) {}
3202
+ /**
3203
+ * @override
3204
+ */
3205
+ append(cues) {}
3206
+ /**
3207
+ * @override
3208
+ */
3209
+ destroy() {}
3210
+ /**
3211
+ * @override
3212
+ */
3213
+ remove(start, end) {}
3214
+ /**
3215
+ * @override
3216
+ */
3217
+ isTextVisible() {}
3218
+ /**
3219
+ * @override
3220
+ */
3221
+ setTextVisibility(on) {}
3222
+ };
3223
+ /**
3224
+ * @summary Manage the conversion to WebVTT.
3225
+ */
3226
+ shaka.text.WebVttGenerator = class {
3227
+ };
3228
+ /**
3229
+ * @enum {string}
3230
+ */
3231
+ shaka.util.CmcdManager.StreamingFormat = {
3232
+ DASH: 'd',
3233
+ HLS: 'h',
3234
+ SMOOTH: 's',
3235
+ OTHER: 'o'
3236
+ };
3237
+ /**
3238
+ * @summary
3239
+ * A CmsdManager maintains CMSD state as well as a collection of utility
3240
+ * functions.
3241
+ */
3242
+ shaka.util.CmsdManager = class {
3243
+ /**
3244
+ * @param {shaka.extern.CmsdConfiguration} config
3245
+ */
3246
+ constructor(config) {}
3247
+ /**
3248
+ * Returns the max bitrate in bits per second. If there is no max bitrate or
3249
+ * it's not enabled, it returns null.
3250
+ * @return {?number}
3251
+ */
3252
+ getMaxBitrate() {}
3253
+ /**
3254
+ * Returns the estimated throughput in bits per second. If there is no
3255
+ * estimated throughput or it's not enabled, it returns null.
3256
+ * @return {?number}
3257
+ */
3258
+ getEstimatedThroughput() {}
3259
+ /**
3260
+ * Returns the response delay in milliseconds. If there is no response delay
3261
+ * or it's not enabled, it returns null.
3262
+ * @return {?number}
3263
+ */
3264
+ getResponseDelay() {}
3265
+ /**
3266
+ * Returns the RTT in milliseconds. If there is no RTT or it's not enabled,
3267
+ * it returns null.
3268
+ * @return {?number}
3269
+ */
3270
+ getRoundTripTime() {}
3271
+ /**
3272
+ * Gets the current bandwidth estimate.
3273
+ * @param {number} defaultEstimate
3274
+ * @return {number} The bandwidth estimate in bits per second.
3275
+ */
3276
+ getBandwidthEstimate(defaultEstimate) {}
3277
+ };
3278
+ /**
3279
+ * @summary The main player object for Shaka Player.
3280
+ * @implements {shaka.util.IDestroyable}
3281
+ */
3282
+ shaka.Player = class extends shaka.util.FakeEventTarget {
3283
+ /**
3284
+ * @param {HTMLMediaElement=} mediaElement
3285
+ * When provided, the player will attach to <code>mediaElement</code>,
3286
+ * similar to calling <code>attach</code>. When not provided, the player
3287
+ * will remain detached.
3288
+ * @param {function(shaka.Player)=} dependencyInjector Optional callback
3289
+ * which is called to inject mocks into the Player. Used for testing.
3290
+ */
3291
+ constructor(mediaElement, dependencyInjector) {}
3292
+ /**
3293
+ * After destruction, a Player object cannot be used again.
3294
+ * @override
3295
+ */
3296
+ destroy() {}
3297
+ /**
3298
+ * Registers a plugin callback that will be called with
3299
+ * <code>support()</code>. The callback will return the value that will be
3300
+ * stored in the return value from <code>support()</code>.
3301
+ * @param {string} name
3302
+ * @param {function():*} callback
3303
+ */
3304
+ static registerSupportPlugin(name, callback) {}
3305
+ /**
3306
+ * Set a factory to create an ad manager during player construction time.
3307
+ * This method needs to be called bafore instantiating the Player class.
3308
+ * @param {!shaka.extern.IAdManager.Factory} factory
3309
+ */
3310
+ static setAdManagerFactory(factory) {}
3311
+ /**
3312
+ * Return whether the browser provides basic support. If this returns false,
3313
+ * Shaka Player cannot be used at all. In this case, do not construct a
3314
+ * Player instance and do not use the library.
3315
+ * @return {boolean}
3316
+ */
3317
+ static isBrowserSupported() {}
3318
+ /**
3319
+ * Probes the browser to determine what features are supported. This makes a
3320
+ * number of requests to EME/MSE/etc which may result in user prompts. This
3321
+ * should only be used for diagnostics.
3322
+ * <p>
3323
+ * NOTE: This may show a request to the user for permission.
3324
+ * @see https://bit.ly/2ywccmH
3325
+ * @param {boolean=} promptsOkay
3326
+ * @return {!Promise.<shaka.extern.SupportType>}
3327
+ */
3328
+ static probeSupport(promptsOkay) {}
3329
+ /**
3330
+ * Attaches the player to a media element.
3331
+ * If the player was already attached to a media element, first detaches from
3332
+ * that media element.
3333
+ * @param {!HTMLMediaElement} mediaElement
3334
+ * @param {boolean=} initializeMediaSource
3335
+ * @return {!Promise}
3336
+ */
3337
+ attach(mediaElement, initializeMediaSource) {}
3338
+ /**
3339
+ * Calling <code>attachCanvas</code> will tell the player to set canvas
3340
+ * element for LCEVC decoding.
3341
+ * @param {HTMLCanvasElement} canvas
3342
+ */
3343
+ attachCanvas(canvas) {}
3344
+ /**
3345
+ * Detach the player from the current media element. Leaves the player in a
3346
+ * state where it cannot play media, until it has been attached to something
3347
+ * else.
3348
+ * @param {boolean=} keepAdManager
3349
+ * @return {!Promise}
3350
+ */
3351
+ detach(keepAdManager) {}
3352
+ /**
3353
+ * Unloads the currently playing stream, if any.
3354
+ * @param {boolean=} initializeMediaSource
3355
+ * @param {boolean=} keepAdManager
3356
+ * @return {!Promise}
3357
+ */
3358
+ unload(initializeMediaSource, keepAdManager) {}
3359
+ /**
3360
+ * Provides a way to update the stream start position during the media loading
3361
+ * process. Can for example be called from the <code>manifestparsed</code>
3362
+ * event handler to update the start position based on information in the
3363
+ * manifest.
3364
+ * @param {number} startTime
3365
+ */
3366
+ updateStartTime(startTime) {}
3367
+ /**
3368
+ * Loads a new stream.
3369
+ * If another stream was already playing, first unloads that stream.
3370
+ * @param {string|shaka.media.PreloadManager} assetUriOrPreloader
3371
+ * @param {?number=} startTime
3372
+ * When <code>startTime</code> is <code>null</code> or
3373
+ * <code>undefined</code>, playback will start at the default start time (0
3374
+ * for VOD and liveEdge for LIVE).
3375
+ * @param {?string=} mimeType
3376
+ * @return {!Promise}
3377
+ */
3378
+ load(assetUriOrPreloader, startTime, mimeType) {}
3379
+ /**
3380
+ * Unloads the currently playing stream, if any, and returns a PreloadManager
3381
+ * that contains the loaded manifest of that asset, if any.
3382
+ * Allows for the asset to be re-loaded by this player faster, in the future.
3383
+ * When in src= mode, this unloads but does not make a PreloadManager.
3384
+ * @param {boolean=} initializeMediaSource
3385
+ * @param {boolean=} keepAdManager
3386
+ * @return {!Promise.<?shaka.media.PreloadManager>}
3387
+ */
3388
+ unloadAndSavePreload(initializeMediaSource, keepAdManager) {}
3389
+ /**
3390
+ * Starts to preload a given asset, and returns a PreloadManager object that
3391
+ * represents that preloading process.
3392
+ * The PreloadManager will load the manifest for that asset, as well as the
3393
+ * initialization segment. It will not preload anything more than that;
3394
+ * this feature is intended for reducing start-time latency, not for fully
3395
+ * downloading assets before playing them (for that, use
3396
+ * |shaka.offline.Storage|).
3397
+ * You can pass that PreloadManager object in to the |load| method on this
3398
+ * Player instance to finish loading that particular asset, or you can call
3399
+ * the |destroy| method on the manager if the preload is no longer necessary.
3400
+ * If this returns null rather than a PreloadManager, that indicates that the
3401
+ * asset must be played with src=, which cannot be preloaded.
3402
+ * @param {string} assetUri
3403
+ * @param {?number=} startTime
3404
+ * When <code>startTime</code> is <code>null</code> or
3405
+ * <code>undefined</code>, playback will start at the default start time (0
3406
+ * for VOD and liveEdge for LIVE).
3407
+ * @param {?string=} mimeType
3408
+ * @return {!Promise.<?shaka.media.PreloadManager>}
3409
+ */
3410
+ preload(assetUri, startTime, mimeType) {}
3411
+ /**
3412
+ * Releases all of the mutexes of the player. Meant for use by the tests.
3413
+ */
3414
+ releaseAllMutexes() {}
3415
+ /**
3416
+ * Changes configuration settings on the Player. This checks the names of
3417
+ * keys and the types of values to avoid coding errors. If there are errors,
3418
+ * this logs them to the console and returns false. Correct fields are still
3419
+ * applied even if there are other errors. You can pass an explicit
3420
+ * <code>undefined</code> value to restore the default value. This has two
3421
+ * modes of operation:
3422
+ * <p>
3423
+ * First, this can be passed a single "plain" object. This object should
3424
+ * follow the {@link shaka.extern.PlayerConfiguration} object. Not all fields
3425
+ * need to be set; unset fields retain their old values.
3426
+ * <p>
3427
+ * Second, this can be passed two arguments. The first is the name of the key
3428
+ * to set. This should be a '.' separated path to the key. For example,
3429
+ * <code>'streaming.alwaysStreamText'</code>. The second argument is the
3430
+ * value to set.
3431
+ * @param {string|!Object} config This should either be a field name or an
3432
+ * object.
3433
+ * @param {*=} value In the second mode, this is the value to set.
3434
+ * @return {boolean} True if the passed config object was valid, false if
3435
+ * there were invalid entries.
3436
+ */
3437
+ configure(config, value) {}
3438
+ /**
3439
+ * Return a copy of the current configuration. Modifications of the returned
3440
+ * value will not affect the Player's active configuration. You must call
3441
+ * <code>player.configure()</code> to make changes.
3442
+ * @return {shaka.extern.PlayerConfiguration}
3443
+ */
3444
+ getConfiguration() {}
3445
+ /**
3446
+ * Returns the ratio of video length buffered compared to buffering Goal
3447
+ * @return {number}
3448
+ */
3449
+ getBufferFullness() {}
3450
+ /**
3451
+ * Reset configuration to default.
3452
+ */
3453
+ resetConfiguration() {}
3454
+ /**
3455
+ * Get the current load mode.
3456
+ * @return {shaka.Player.LoadMode}
3457
+ */
3458
+ getLoadMode() {}
3459
+ /**
3460
+ * Get the current manifest type.
3461
+ * @return {?string}
3462
+ */
3463
+ getManifestType() {}
3464
+ /**
3465
+ * Get the media element that the player is currently using to play loaded
3466
+ * content. If the player has not loaded content, this will return
3467
+ * <code>null</code>.
3468
+ * @return {HTMLMediaElement}
3469
+ */
3470
+ getMediaElement() {}
3471
+ /**
3472
+ * @return {shaka.net.NetworkingEngine} A reference to the Player's networking
3473
+ * engine. Applications may use this to make requests through Shaka's
3474
+ * networking plugins.
3475
+ */
3476
+ getNetworkingEngine() {}
3477
+ /**
3478
+ * Get the uri to the asset that the player has loaded. If the player has not
3479
+ * loaded content, this will return <code>null</code>.
3480
+ * @return {?string}
3481
+ */
3482
+ getAssetUri() {}
3483
+ /**
3484
+ * Returns a shaka.ads.AdManager instance, responsible for Dynamic
3485
+ * Ad Insertion functionality.
3486
+ * @return {shaka.extern.IAdManager}
3487
+ */
3488
+ getAdManager() {}
3489
+ /**
3490
+ * Get if the player is playing live content. If the player has not loaded
3491
+ * content, this will return <code>false</code>.
3492
+ * @return {boolean}
3493
+ */
3494
+ isLive() {}
3495
+ /**
3496
+ * Get if the player is playing in-progress content. If the player has not
3497
+ * loaded content, this will return <code>false</code>.
3498
+ * @return {boolean}
3499
+ */
3500
+ isInProgress() {}
3501
+ /**
3502
+ * Check if the manifest contains only audio-only content. If the player has
3503
+ * not loaded content, this will return <code>false</code>.
3504
+ * <p>
3505
+ * The player does not support content that contain more than one type of
3506
+ * variants (i.e. mixing audio-only, video-only, audio-video). Content will be
3507
+ * filtered to only contain one type of variant.
3508
+ * @return {boolean}
3509
+ */
3510
+ isAudioOnly() {}
3511
+ /**
3512
+ * Get the range of time (in seconds) that seeking is allowed. If the player
3513
+ * has not loaded content and the manifest is HLS, this will return a range
3514
+ * from 0 to 0.
3515
+ * @return {{start: number, end: number}}
3516
+ */
3517
+ seekRange() {}
3518
+ /**
3519
+ * Go to live in a live stream.
3520
+ */
3521
+ goToLive() {}
3522
+ /**
3523
+ * Get the key system currently used by EME. If EME is not being used, this
3524
+ * will return an empty string. If the player has not loaded content, this
3525
+ * will return an empty string.
3526
+ * @return {string}
3527
+ */
3528
+ keySystem() {}
3529
+ /**
3530
+ * Get the drm info used to initialize EME. If EME is not being used, this
3531
+ * will return <code>null</code>. If the player is idle or has not initialized
3532
+ * EME yet, this will return <code>null</code>.
3533
+ * @return {?shaka.extern.DrmInfo}
3534
+ */
3535
+ drmInfo() {}
3536
+ /**
3537
+ * Get the next known expiration time for any EME session. If the session
3538
+ * never expires, this will return <code>Infinity</code>. If there are no EME
3539
+ * sessions, this will return <code>Infinity</code>. If the player has not
3540
+ * loaded content, this will return <code>Infinity</code>.
3541
+ * @return {number}
3542
+ */
3543
+ getExpiration() {}
3544
+ /**
3545
+ * Returns the active sessions metadata
3546
+ * @return {!Array.<shaka.extern.DrmSessionMetadata>}
3547
+ */
3548
+ getActiveSessionsMetadata() {}
3549
+ /**
3550
+ * Gets a map of EME key ID to the current key status.
3551
+ * @return {!Object<string, string>}
3552
+ */
3553
+ getKeyStatuses() {}
3554
+ /**
3555
+ * Check if the player is currently in a buffering state (has too little
3556
+ * content to play smoothly). If the player has not loaded content, this will
3557
+ * return <code>false</code>.
3558
+ * @return {boolean}
3559
+ */
3560
+ isBuffering() {}
3561
+ /**
3562
+ * Get the playback rate of what is playing right now. If we are using trick
3563
+ * play, this will return the trick play rate.
3564
+ * If no content is playing, this will return 0.
3565
+ * If content is buffering, this will return the expected playback rate once
3566
+ * the video starts playing.
3567
+ * <p>
3568
+ * If the player has not loaded content, this will return a playback rate of
3569
+ * 0.
3570
+ * @return {number}
3571
+ */
3572
+ getPlaybackRate() {}
3573
+ /**
3574
+ * Enable trick play to skip through content without playing by repeatedly
3575
+ * seeking. For example, a rate of 2.5 would result in 2.5 seconds of content
3576
+ * being skipped every second. A negative rate will result in moving
3577
+ * backwards.
3578
+ * <p>
3579
+ * If the player has not loaded content or is still loading content this will
3580
+ * be a no-op. Wait until <code>load</code> has completed before calling.
3581
+ * <p>
3582
+ * Trick play will be canceled automatically if the playhead hits the
3583
+ * beginning or end of the seekable range for the content.
3584
+ * @param {number} rate
3585
+ */
3586
+ trickPlay(rate) {}
3587
+ /**
3588
+ * Cancel trick-play. If the player has not loaded content or is still loading
3589
+ * content this will be a no-op.
3590
+ */
3591
+ cancelTrickPlay() {}
3592
+ /**
3593
+ * Return a list of variant tracks that can be switched to.
3594
+ * <p>
3595
+ * If the player has not loaded content, this will return an empty list.
3596
+ * @return {!Array.<shaka.extern.Track>}
3597
+ */
3598
+ getVariantTracks() {}
3599
+ /**
3600
+ * Return a list of text tracks that can be switched to.
3601
+ * <p>
3602
+ * If the player has not loaded content, this will return an empty list.
3603
+ * @return {!Array.<shaka.extern.Track>}
3604
+ */
3605
+ getTextTracks() {}
3606
+ /**
3607
+ * Return a list of image tracks that can be switched to.
3608
+ * If the player has not loaded content, this will return an empty list.
3609
+ * @return {!Array.<shaka.extern.Track>}
3610
+ */
3611
+ getImageTracks() {}
3612
+ /**
3613
+ * Returns Thumbnail objects for each thumbnail for a given image track ID.
3614
+ * If the player has not loaded content, this will return a null.
3615
+ * @param {number} trackId
3616
+ * @return {!Promise.<?Array<!shaka.extern.Thumbnail>>}
3617
+ */
3618
+ getAllThumbnails(trackId) {}
3619
+ /**
3620
+ * Return a Thumbnail object from a image track Id and time.
3621
+ * If the player has not loaded content, this will return a null.
3622
+ * @param {number} trackId
3623
+ * @param {number} time
3624
+ * @return {!Promise.<?shaka.extern.Thumbnail>}
3625
+ */
3626
+ getThumbnails(trackId, time) {}
3627
+ /**
3628
+ * Select a specific text track. <code>track</code> should come from a call to
3629
+ * <code>getTextTracks</code>. If the track is not found, this will be a
3630
+ * no-op. If the player has not loaded content, this will be a no-op.
3631
+ * <p>
3632
+ * Note that <code>AdaptationEvents</code> are not fired for manual track
3633
+ * selections.
3634
+ * @param {shaka.extern.Track} track
3635
+ */
3636
+ selectTextTrack(track) {}
3637
+ /**
3638
+ * Select a specific variant track to play. <code>track</code> should come
3639
+ * from a call to <code>getVariantTracks</code>. If <code>track</code> cannot
3640
+ * be found, this will be a no-op. If the player has not loaded content, this
3641
+ * will be a no-op.
3642
+ * <p>
3643
+ * Changing variants will take effect once the currently buffered content has
3644
+ * been played. To force the change to happen sooner, use
3645
+ * <code>clearBuffer</code> with <code>safeMargin</code>. Setting
3646
+ * <code>clearBuffer</code> to <code>true</code> will clear all buffered
3647
+ * content after <code>safeMargin</code>, allowing the new variant to start
3648
+ * playing sooner.
3649
+ * <p>
3650
+ * Note that <code>AdaptationEvents</code> are not fired for manual track
3651
+ * selections.
3652
+ * @param {shaka.extern.Track} track
3653
+ * @param {boolean=} clearBuffer
3654
+ * @param {number=} safeMargin Optional amount of buffer (in seconds) to
3655
+ * retain when clearing the buffer. Useful for switching variant quickly
3656
+ * without causing a buffering event. Defaults to 0 if not provided. Ignored
3657
+ * if clearBuffer is false. Can cause hiccups on some browsers if chosen too
3658
+ * small, e.g. The amount of two segments is a fair minimum to consider as
3659
+ * safeMargin value.
3660
+ */
3661
+ selectVariantTrack(track, clearBuffer, safeMargin) {}
3662
+ /**
3663
+ * Return a list of audio language-role combinations available. If the
3664
+ * player has not loaded any content, this will return an empty list.
3665
+ * @return {!Array.<shaka.extern.LanguageRole>}
3666
+ */
3667
+ getAudioLanguagesAndRoles() {}
3668
+ /**
3669
+ * Return a list of text language-role combinations available. If the player
3670
+ * has not loaded any content, this will be return an empty list.
3671
+ * @return {!Array.<shaka.extern.LanguageRole>}
3672
+ */
3673
+ getTextLanguagesAndRoles() {}
3674
+ /**
3675
+ * Return a list of audio languages available. If the player has not loaded
3676
+ * any content, this will return an empty list.
3677
+ * @return {!Array.<string>}
3678
+ */
3679
+ getAudioLanguages() {}
3680
+ /**
3681
+ * Return a list of text languages available. If the player has not loaded
3682
+ * any content, this will return an empty list.
3683
+ * @return {!Array.<string>}
3684
+ */
3685
+ getTextLanguages() {}
3686
+ /**
3687
+ * Sets the current audio language and current variant role to the selected
3688
+ * language, role and channel count, and chooses a new variant if need be.
3689
+ * If the player has not loaded any content, this will be a no-op.
3690
+ * @param {string} language
3691
+ * @param {string=} role
3692
+ * @param {number=} channelsCount
3693
+ * @param {number=} safeMargin
3694
+ */
3695
+ selectAudioLanguage(language, role, channelsCount, safeMargin) {}
3696
+ /**
3697
+ * Sets the current text language and current text role to the selected
3698
+ * language and role, and chooses a new variant if need be. If the player has
3699
+ * not loaded any content, this will be a no-op.
3700
+ * @param {string} language
3701
+ * @param {string=} role
3702
+ * @param {boolean=} forced
3703
+ */
3704
+ selectTextLanguage(language, role, forced) {}
3705
+ /**
3706
+ * Select variant tracks that have a given label. This assumes the
3707
+ * label uniquely identifies an audio stream, so all the variants
3708
+ * are expected to have the same variant.audio.
3709
+ * @param {string} label
3710
+ * @param {boolean=} clearBuffer Optional clear buffer or not when
3711
+ * switch to new variant
3712
+ * Defaults to true if not provided
3713
+ * @param {number=} safeMargin Optional amount of buffer (in seconds) to
3714
+ * retain when clearing the buffer.
3715
+ * Defaults to 0 if not provided. Ignored if clearBuffer is false.
3716
+ */
3717
+ selectVariantsByLabel(label, clearBuffer, safeMargin) {}
3718
+ /**
3719
+ * Check if the text displayer is enabled.
3720
+ * @return {boolean}
3721
+ */
3722
+ isTextTrackVisible() {}
3723
+ /**
3724
+ * Return a list of chapters tracks.
3725
+ * @return {!Array.<shaka.extern.Track>}
3726
+ */
3727
+ getChaptersTracks() {}
3728
+ /**
3729
+ * This returns the list of chapters.
3730
+ * @param {string} language
3731
+ * @return {!Array.<shaka.extern.Chapter>}
3732
+ */
3733
+ getChapters(language) {}
3734
+ /**
3735
+ * Enable or disable the text displayer. If the player is in an unloaded
3736
+ * state, the request will be applied next time content is loaded.
3737
+ * @param {boolean} isVisible
3738
+ */
3739
+ setTextTrackVisibility(isVisible) {}
3740
+ /**
3741
+ * Get the current playhead position as a date.
3742
+ * @return {Date}
3743
+ */
3744
+ getPlayheadTimeAsDate() {}
3745
+ /**
3746
+ * Get the presentation start time as a date.
3747
+ * @return {Date}
3748
+ */
3749
+ getPresentationStartTimeAsDate() {}
3750
+ /**
3751
+ * Get the presentation segment availability duration. This should only be
3752
+ * called when the player has loaded a live stream. If the player has not
3753
+ * loaded a live stream, this will return <code>null</code>.
3754
+ * @return {?number}
3755
+ */
3756
+ getSegmentAvailabilityDuration() {}
3757
+ /**
3758
+ * Get information about what the player has buffered. If the player has not
3759
+ * loaded content or is currently loading content, the buffered content will
3760
+ * be empty.
3761
+ * @return {shaka.extern.BufferedInfo}
3762
+ */
3763
+ getBufferedInfo() {}
3764
+ /**
3765
+ * Get statistics for the current playback session. If the player is not
3766
+ * playing content, this will return an empty stats object.
3767
+ * @return {shaka.extern.Stats}
3768
+ */
3769
+ getStats() {}
3770
+ /**
3771
+ * Adds the given text track to the loaded manifest. <code>load()</code> must
3772
+ * resolve before calling. The presentation must have a duration.
3773
+ * This returns the created track, which can immediately be selected by the
3774
+ * application. The track will not be automatically selected.
3775
+ * @param {string} uri
3776
+ * @param {string} language
3777
+ * @param {string} kind
3778
+ * @param {string=} mimeType
3779
+ * @param {string=} codec
3780
+ * @param {string=} label
3781
+ * @param {boolean=} forced
3782
+ * @return {!Promise.<shaka.extern.Track>}
3783
+ */
3784
+ addTextTrackAsync(uri, language, kind, mimeType, codec, label, forced) {}
3785
+ /**
3786
+ * Adds the given thumbnails track to the loaded manifest.
3787
+ * <code>load()</code> must resolve before calling. The presentation must
3788
+ * have a duration.
3789
+ * This returns the created track, which can immediately be used by the
3790
+ * application.
3791
+ * @param {string} uri
3792
+ * @param {string=} mimeType
3793
+ * @return {!Promise.<shaka.extern.Track>}
3794
+ */
3795
+ addThumbnailsTrack(uri, mimeType) {}
3796
+ /**
3797
+ * Adds the given chapters track to the loaded manifest. <code>load()</code>
3798
+ * must resolve before calling. The presentation must have a duration.
3799
+ * This returns the created track.
3800
+ * @param {string} uri
3801
+ * @param {string} language
3802
+ * @param {string=} mimeType
3803
+ * @return {!Promise.<shaka.extern.Track>}
3804
+ */
3805
+ addChaptersTrack(uri, language, mimeType) {}
3806
+ /**
3807
+ * Set the maximum resolution that the platform's hardware can handle.
3808
+ * @param {number} width
3809
+ * @param {number} height
3810
+ */
3811
+ setMaxHardwareResolution(width, height) {}
3812
+ /**
3813
+ * Retry streaming after a streaming failure has occurred. When the player has
3814
+ * not loaded content or is loading content, this will be a no-op and will
3815
+ * return <code>false</code>.
3816
+ * <p>
3817
+ * If the player has loaded content, and streaming has not seen an error, this
3818
+ * will return <code>false</code>.
3819
+ * <p>
3820
+ * If the player has loaded content, and streaming seen an error, but the
3821
+ * could not resume streaming, this will return <code>false</code>.
3822
+ * @param {number=} retryDelaySeconds
3823
+ * @return {boolean}
3824
+ */
3825
+ retryStreaming(retryDelaySeconds) {}
3826
+ /**
3827
+ * Get the manifest that the player has loaded. If the player has not loaded
3828
+ * any content, this will return <code>null</code>.
3829
+ * NOTE: This structure is NOT covered by semantic versioning compatibility
3830
+ * guarantees. It may change at any time!
3831
+ * This is marked as deprecated to warn Closure Compiler users at compile-time
3832
+ * to avoid using this method.
3833
+ * @return {?shaka.extern.Manifest}
3834
+ * @deprecated
3835
+ */
3836
+ getManifest() {}
3837
+ /**
3838
+ * Get the type of manifest parser that the player is using. If the player has
3839
+ * not loaded any content, this will return <code>null</code>.
3840
+ * @return {?shaka.extern.ManifestParser.Factory}
3841
+ */
3842
+ getManifestParserFactory() {}
3843
+ /**
3844
+ * Set the videoContainer to construct UITextDisplayer.
3845
+ * @param {HTMLElement} videoContainer
3846
+ */
3847
+ setVideoContainer(videoContainer) {}
3848
+ };
3849
+ /**
3850
+ * In order to know what method of loading the player used for some content, we
3851
+ * have this enum. It lets us know if content has not been loaded, loaded with
3852
+ * media source, or loaded with src equals.
3853
+ * This enum has a low resolution, because it is only meant to express the
3854
+ * outer limits of the various states that the player is in. For example, when
3855
+ * someone calls a public method on player, it should not matter if they have
3856
+ * initialized drm engine, it should only matter if they finished loading
3857
+ * content.
3858
+ * @enum {number}
3859
+ */
3860
+ shaka.Player.LoadMode = {
3861
+ 'DESTROYED': 0,
3862
+ 'NOT_LOADED': 1,
3863
+ 'MEDIA_SOURCE': 2,
3864
+ 'SRC_EQUALS': 3
3865
+ };
3866
+ /**
3867
+ * @define {string} A version number taken from git at compile time.
3868
+ */
3869
+ shaka.Player.version;
3870
+ /**
3871
+ * @summary A one-stop installer for all polyfills.
3872
+ * @see http://enwp.org/polyfill
3873
+ */
3874
+ shaka.polyfill = class {
3875
+ /**
3876
+ * Install all polyfills.
3877
+ */
3878
+ static installAll() {}
3879
+ /**
3880
+ * Registers a new polyfill to be installed.
3881
+ * @param {function()} polyfill
3882
+ * @param {number=} priority An optional number priority. Higher priorities
3883
+ * will be executed before lower priority ones. Default is 0.
3884
+ */
3885
+ static register(polyfill, priority) {}
3886
+ };