rx-player 4.2.0-dev.2024090300 → 4.2.0-dev.2024090500

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 (596) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/VERSION +1 -1
  3. package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  4. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
  5. package/dist/commonjs/compat/add_class_name.d.ts.map +1 -1
  6. package/dist/commonjs/compat/add_class_name.js +1 -2
  7. package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
  8. package/dist/commonjs/compat/browser_compatibility_types.js +4 -1
  9. package/dist/commonjs/compat/clear_element_src.js +1 -1
  10. package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
  11. package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
  12. package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
  13. package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
  14. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
  15. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
  16. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
  17. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
  18. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
  19. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
  20. package/dist/commonjs/compat/eme/eme-api-implementation.js +0 -2
  21. package/dist/commonjs/compat/event_listeners.d.ts.map +1 -1
  22. package/dist/commonjs/compat/event_listeners.js +2 -6
  23. package/dist/commonjs/compat/has_mse_in_worker.js +1 -1
  24. package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
  25. package/dist/commonjs/compat/is_codec_supported.js +0 -2
  26. package/dist/commonjs/compat/is_vtt_cue.d.ts.map +1 -1
  27. package/dist/commonjs/compat/is_vtt_cue.js +1 -2
  28. package/dist/commonjs/compat/on_height_width_change.d.ts.map +1 -1
  29. package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
  30. package/dist/commonjs/compat/patch_webkit_source_buffer.js +8 -18
  31. package/dist/commonjs/compat/remove_cue.js +2 -2
  32. package/dist/commonjs/core/fetchers/index.d.ts +4 -4
  33. package/dist/commonjs/core/fetchers/index.d.ts.map +1 -1
  34. package/dist/commonjs/core/fetchers/index.js +2 -2
  35. package/dist/commonjs/core/fetchers/segment/index.d.ts +6 -5
  36. package/dist/commonjs/core/fetchers/segment/index.d.ts.map +1 -1
  37. package/dist/commonjs/core/fetchers/segment/index.js +2 -2
  38. package/dist/{es2017/core/stream/representation/utils/downloading_queue.d.ts → commonjs/core/fetchers/segment/segment_queue.d.ts} +63 -80
  39. package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -0
  40. package/dist/commonjs/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +132 -111
  41. package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
  42. package/dist/commonjs/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
  43. package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +15 -9
  44. package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts +9 -0
  45. package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
  46. package/dist/commonjs/core/fetchers/segment/task_prioritizer.js +38 -8
  47. package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
  48. package/dist/commonjs/core/main/common/content_time_boundaries_observer.js +21 -10
  49. package/dist/commonjs/core/main/worker/content_preparer.d.ts +3 -3
  50. package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +1 -1
  51. package/dist/commonjs/core/main/worker/content_preparer.js +2 -2
  52. package/dist/commonjs/core/main/worker/send_message.js +1 -1
  53. package/dist/commonjs/core/main/worker/worker_main.js +2 -2
  54. package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
  55. package/dist/commonjs/core/segment_sinks/inventory/segment_inventory.js +39 -30
  56. package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
  57. package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +3 -2
  58. package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts +1 -1
  59. package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
  60. package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +3 -3
  61. package/dist/commonjs/core/stream/adaptation/types.d.ts +2 -2
  62. package/dist/commonjs/core/stream/adaptation/types.d.ts.map +1 -1
  63. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
  64. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +27 -6
  65. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
  66. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
  67. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
  68. package/dist/commonjs/core/stream/period/period_stream.d.ts +1 -1
  69. package/dist/commonjs/core/stream/period/period_stream.d.ts.map +1 -1
  70. package/dist/commonjs/core/stream/period/period_stream.js +2 -2
  71. package/dist/commonjs/core/stream/period/types.d.ts +2 -2
  72. package/dist/commonjs/core/stream/period/types.d.ts.map +1 -1
  73. package/dist/commonjs/core/stream/representation/representation_stream.d.ts +1 -1
  74. package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
  75. package/dist/commonjs/core/stream/representation/representation_stream.js +19 -28
  76. package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
  77. package/dist/commonjs/core/stream/representation/types.d.ts.map +1 -1
  78. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
  79. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +39 -18
  80. package/dist/commonjs/core/types.d.ts +2 -2
  81. package/dist/commonjs/core/types.d.ts.map +1 -1
  82. package/dist/commonjs/default_config.d.ts.map +1 -1
  83. package/dist/commonjs/default_config.js +0 -8
  84. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
  85. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
  86. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
  87. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
  88. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
  89. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
  90. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
  91. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
  92. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
  93. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
  94. package/dist/commonjs/features/add_features.d.ts.map +1 -1
  95. package/dist/commonjs/features/add_features.js +31 -10
  96. package/dist/commonjs/main_thread/api/option_utils.d.ts.map +1 -1
  97. package/dist/commonjs/main_thread/api/option_utils.js +2 -6
  98. package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
  99. package/dist/commonjs/main_thread/api/public_api.js +33 -27
  100. package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
  101. package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.js +4 -3
  102. package/dist/commonjs/main_thread/init/media_source_content_initializer.js +6 -6
  103. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  104. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +32 -37
  105. package/dist/commonjs/main_thread/text_displayer/html/html_text_displayer.js +1 -5
  106. package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +3 -7
  107. package/dist/commonjs/main_thread/tracks_store/track_dispatcher.js +1 -1
  108. package/dist/commonjs/main_thread/types.d.ts.map +1 -1
  109. package/dist/commonjs/manifest/classes/manifest.d.ts.map +1 -1
  110. package/dist/commonjs/manifest/classes/manifest.js +0 -6
  111. package/dist/commonjs/manifest/utils.d.ts.map +1 -1
  112. package/dist/commonjs/manifest/utils.js +72 -62
  113. package/dist/commonjs/mse/main_media_source_interface.js +1 -1
  114. package/dist/commonjs/multithread_types.d.ts +2 -2
  115. package/dist/commonjs/multithread_types.d.ts.map +1 -1
  116. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
  117. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
  118. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  119. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
  120. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
  121. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
  122. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
  123. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
  124. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
  125. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
  126. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  127. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
  128. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
  129. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
  130. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
  131. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
  132. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
  133. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
  134. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
  135. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
  136. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
  137. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
  138. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
  139. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
  140. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
  141. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
  142. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
  143. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
  144. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
  145. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
  146. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
  147. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
  148. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
  149. package/dist/commonjs/parsers/manifest/local/representation_index.d.ts.map +1 -1
  150. package/dist/commonjs/parsers/manifest/local/representation_index.js +29 -8
  151. package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
  152. package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +31 -10
  153. package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
  154. package/dist/commonjs/parsers/manifest/smooth/create_parser.js +2 -1
  155. package/dist/commonjs/parsers/manifest/smooth/shared_smooth_segment_timeline.js +26 -4
  156. package/dist/commonjs/parsers/manifest/utils/get_first_time_from_adaptation.js +29 -7
  157. package/dist/commonjs/parsers/manifest/utils/get_last_time_from_adaptation.js +29 -7
  158. package/dist/commonjs/parsers/texttracks/srt/html.js +28 -6
  159. package/dist/commonjs/parsers/texttracks/ttml/html/create_element.js +1 -1
  160. package/dist/commonjs/parsers/texttracks/ttml/html/parse_ttml_to_div.js +29 -7
  161. package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
  162. package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +26 -5
  163. package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
  164. package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.js +25 -4
  165. package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
  166. package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
  167. package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.js +9 -3
  168. package/dist/commonjs/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +30 -8
  169. package/dist/commonjs/public_types.d.ts +5 -7
  170. package/dist/commonjs/public_types.d.ts.map +1 -1
  171. package/dist/commonjs/transports/smooth/extract_timings_infos.js +30 -8
  172. package/dist/commonjs/utils/array_find.d.ts +1 -1
  173. package/dist/commonjs/utils/array_find.d.ts.map +1 -1
  174. package/dist/commonjs/utils/array_find.js +3 -1
  175. package/dist/commonjs/utils/array_find_index.d.ts +1 -1
  176. package/dist/commonjs/utils/array_find_index.d.ts.map +1 -1
  177. package/dist/commonjs/utils/array_find_index.js +3 -1
  178. package/dist/commonjs/utils/array_includes.d.ts.map +1 -1
  179. package/dist/commonjs/utils/array_includes.js +1 -3
  180. package/dist/commonjs/utils/assert.d.ts.map +1 -1
  181. package/dist/commonjs/utils/assert.js +0 -2
  182. package/dist/commonjs/utils/base64.d.ts +1 -1
  183. package/dist/commonjs/utils/base64.d.ts.map +1 -1
  184. package/dist/commonjs/utils/base64.js +3 -2
  185. package/dist/commonjs/utils/event_emitter.js +1 -1
  186. package/dist/commonjs/utils/flat_map.d.ts.map +1 -1
  187. package/dist/commonjs/utils/flat_map.js +1 -2
  188. package/dist/commonjs/utils/id_generator.d.ts.map +1 -1
  189. package/dist/commonjs/utils/id_generator.js +0 -1
  190. package/dist/commonjs/utils/logger.js +1 -1
  191. package/dist/commonjs/utils/monotonic_timestamp.js +2 -2
  192. package/dist/commonjs/utils/noop.js +1 -2
  193. package/dist/commonjs/utils/object_assign.d.ts.map +1 -1
  194. package/dist/commonjs/utils/object_assign.js +27 -6
  195. package/dist/commonjs/utils/object_values.d.ts.map +1 -1
  196. package/dist/commonjs/utils/object_values.js +1 -1
  197. package/dist/commonjs/utils/reference.js +1 -1
  198. package/dist/commonjs/utils/request/xhr.js +1 -1
  199. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  200. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  201. package/dist/es2017/compat/add_class_name.d.ts.map +1 -1
  202. package/dist/es2017/compat/add_class_name.js +1 -2
  203. package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
  204. package/dist/es2017/compat/browser_compatibility_types.js +4 -1
  205. package/dist/es2017/compat/clear_element_src.js +1 -1
  206. package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
  207. package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
  208. package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
  209. package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
  210. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
  211. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
  212. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
  213. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
  214. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
  215. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
  216. package/dist/es2017/compat/eme/eme-api-implementation.js +0 -2
  217. package/dist/es2017/compat/event_listeners.d.ts.map +1 -1
  218. package/dist/es2017/compat/event_listeners.js +2 -6
  219. package/dist/es2017/compat/has_mse_in_worker.js +1 -1
  220. package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
  221. package/dist/es2017/compat/is_codec_supported.js +0 -2
  222. package/dist/es2017/compat/is_vtt_cue.d.ts.map +1 -1
  223. package/dist/es2017/compat/is_vtt_cue.js +1 -2
  224. package/dist/es2017/compat/on_height_width_change.d.ts.map +1 -1
  225. package/dist/es2017/compat/patch_webkit_source_buffer.d.ts.map +1 -1
  226. package/dist/es2017/compat/patch_webkit_source_buffer.js +8 -18
  227. package/dist/es2017/compat/remove_cue.js +2 -2
  228. package/dist/es2017/core/fetchers/index.d.ts +4 -4
  229. package/dist/es2017/core/fetchers/index.d.ts.map +1 -1
  230. package/dist/es2017/core/fetchers/index.js +2 -2
  231. package/dist/es2017/core/fetchers/segment/index.d.ts +6 -5
  232. package/dist/es2017/core/fetchers/segment/index.d.ts.map +1 -1
  233. package/dist/es2017/core/fetchers/segment/index.js +2 -2
  234. package/dist/{commonjs/core/stream/representation/utils/downloading_queue.d.ts → es2017/core/fetchers/segment/segment_queue.d.ts} +63 -80
  235. package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -0
  236. package/dist/es2017/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +126 -105
  237. package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
  238. package/dist/es2017/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
  239. package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +12 -6
  240. package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts +9 -0
  241. package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
  242. package/dist/es2017/core/fetchers/segment/task_prioritizer.js +10 -2
  243. package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
  244. package/dist/es2017/core/main/common/content_time_boundaries_observer.js +4 -4
  245. package/dist/es2017/core/main/worker/content_preparer.d.ts +3 -3
  246. package/dist/es2017/core/main/worker/content_preparer.d.ts.map +1 -1
  247. package/dist/es2017/core/main/worker/content_preparer.js +3 -3
  248. package/dist/es2017/core/main/worker/send_message.js +1 -1
  249. package/dist/es2017/core/main/worker/worker_main.js +2 -2
  250. package/dist/es2017/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
  251. package/dist/es2017/core/segment_sinks/inventory/segment_inventory.js +1 -2
  252. package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
  253. package/dist/es2017/core/segment_sinks/segment_buffers_store.js +3 -2
  254. package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts +1 -1
  255. package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
  256. package/dist/es2017/core/stream/adaptation/adaptation_stream.js +3 -3
  257. package/dist/es2017/core/stream/adaptation/types.d.ts +2 -2
  258. package/dist/es2017/core/stream/adaptation/types.d.ts.map +1 -1
  259. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
  260. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
  261. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
  262. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
  263. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
  264. package/dist/es2017/core/stream/period/period_stream.d.ts +1 -1
  265. package/dist/es2017/core/stream/period/period_stream.d.ts.map +1 -1
  266. package/dist/es2017/core/stream/period/period_stream.js +2 -2
  267. package/dist/es2017/core/stream/period/types.d.ts +2 -2
  268. package/dist/es2017/core/stream/period/types.d.ts.map +1 -1
  269. package/dist/es2017/core/stream/representation/representation_stream.d.ts +1 -1
  270. package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
  271. package/dist/es2017/core/stream/representation/representation_stream.js +19 -28
  272. package/dist/es2017/core/stream/representation/types.d.ts +2 -2
  273. package/dist/es2017/core/stream/representation/types.d.ts.map +1 -1
  274. package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
  275. package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -2
  276. package/dist/es2017/core/types.d.ts +2 -2
  277. package/dist/es2017/core/types.d.ts.map +1 -1
  278. package/dist/es2017/default_config.d.ts.map +1 -1
  279. package/dist/es2017/default_config.js +0 -8
  280. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
  281. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
  282. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
  283. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
  284. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
  285. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
  286. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
  287. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
  288. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
  289. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
  290. package/dist/es2017/features/add_features.d.ts.map +1 -1
  291. package/dist/es2017/features/add_features.js +1 -2
  292. package/dist/es2017/main_thread/api/option_utils.d.ts.map +1 -1
  293. package/dist/es2017/main_thread/api/option_utils.js +2 -6
  294. package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
  295. package/dist/es2017/main_thread/api/public_api.js +29 -23
  296. package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
  297. package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.js +2 -1
  298. package/dist/es2017/main_thread/init/media_source_content_initializer.js +6 -6
  299. package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  300. package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +7 -12
  301. package/dist/es2017/main_thread/text_displayer/html/html_text_displayer.js +1 -5
  302. package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +3 -7
  303. package/dist/es2017/main_thread/tracks_store/track_dispatcher.js +1 -1
  304. package/dist/es2017/main_thread/types.d.ts.map +1 -1
  305. package/dist/es2017/manifest/classes/manifest.d.ts.map +1 -1
  306. package/dist/es2017/manifest/classes/manifest.js +0 -6
  307. package/dist/es2017/manifest/utils.d.ts.map +1 -1
  308. package/dist/es2017/manifest/utils.js +1 -2
  309. package/dist/es2017/mse/main_media_source_interface.js +1 -1
  310. package/dist/es2017/multithread_types.d.ts +2 -2
  311. package/dist/es2017/multithread_types.d.ts.map +1 -1
  312. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
  313. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
  314. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  315. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
  316. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
  317. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
  318. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
  319. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
  320. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
  321. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
  322. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  323. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
  324. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
  325. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
  326. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
  327. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
  328. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
  329. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
  330. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
  331. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
  332. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
  333. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -2
  334. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
  335. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
  336. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
  337. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
  338. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
  339. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
  340. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
  341. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
  342. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
  343. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
  344. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
  345. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
  346. package/dist/es2017/parsers/manifest/local/representation_index.d.ts.map +1 -1
  347. package/dist/es2017/parsers/manifest/local/representation_index.js +1 -2
  348. package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
  349. package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -3
  350. package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
  351. package/dist/es2017/parsers/manifest/smooth/create_parser.js +2 -1
  352. package/dist/es2017/parsers/manifest/smooth/shared_smooth_segment_timeline.js +2 -2
  353. package/dist/es2017/parsers/manifest/utils/get_first_time_from_adaptation.js +2 -2
  354. package/dist/es2017/parsers/manifest/utils/get_last_time_from_adaptation.js +2 -2
  355. package/dist/es2017/parsers/texttracks/srt/html.js +2 -2
  356. package/dist/es2017/parsers/texttracks/ttml/html/create_element.js +1 -1
  357. package/dist/es2017/parsers/texttracks/ttml/html/parse_ttml_to_div.js +3 -3
  358. package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
  359. package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +1 -2
  360. package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
  361. package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.js +1 -2
  362. package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
  363. package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
  364. package/dist/es2017/parsers/texttracks/webvtt/html/to_html.js +9 -3
  365. package/dist/es2017/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -2
  366. package/dist/es2017/public_types.d.ts +5 -7
  367. package/dist/es2017/public_types.d.ts.map +1 -1
  368. package/dist/es2017/transports/smooth/extract_timings_infos.js +3 -3
  369. package/dist/es2017/utils/array_find.d.ts +1 -1
  370. package/dist/es2017/utils/array_find.d.ts.map +1 -1
  371. package/dist/es2017/utils/array_find.js +3 -1
  372. package/dist/es2017/utils/array_find_index.d.ts +1 -1
  373. package/dist/es2017/utils/array_find_index.d.ts.map +1 -1
  374. package/dist/es2017/utils/array_find_index.js +3 -1
  375. package/dist/es2017/utils/array_includes.d.ts.map +1 -1
  376. package/dist/es2017/utils/array_includes.js +1 -3
  377. package/dist/es2017/utils/assert.d.ts.map +1 -1
  378. package/dist/es2017/utils/assert.js +0 -2
  379. package/dist/es2017/utils/base64.d.ts +1 -1
  380. package/dist/es2017/utils/base64.d.ts.map +1 -1
  381. package/dist/es2017/utils/base64.js +3 -2
  382. package/dist/es2017/utils/event_emitter.js +1 -1
  383. package/dist/es2017/utils/flat_map.d.ts.map +1 -1
  384. package/dist/es2017/utils/flat_map.js +1 -2
  385. package/dist/es2017/utils/id_generator.d.ts.map +1 -1
  386. package/dist/es2017/utils/id_generator.js +0 -1
  387. package/dist/es2017/utils/logger.js +1 -1
  388. package/dist/es2017/utils/monotonic_timestamp.js +2 -2
  389. package/dist/es2017/utils/noop.js +1 -2
  390. package/dist/es2017/utils/object_assign.d.ts.map +1 -1
  391. package/dist/es2017/utils/object_assign.js +1 -2
  392. package/dist/es2017/utils/object_values.d.ts.map +1 -1
  393. package/dist/es2017/utils/object_values.js +1 -2
  394. package/dist/es2017/utils/reference.js +1 -1
  395. package/dist/es2017/utils/request/xhr.js +1 -1
  396. package/dist/rx-player.js +39336 -18
  397. package/dist/rx-player.min.js +18 -0
  398. package/dist/worker.js +5 -5
  399. package/package.json +16 -9
  400. package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
  401. package/src/compat/__tests__/add_text_track.test.ts +8 -12
  402. package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -7
  403. package/src/compat/__tests__/browser_version.test.ts +20 -19
  404. package/src/compat/__tests__/can_patch_isobmff.test.ts +7 -10
  405. package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +17 -21
  406. package/src/compat/__tests__/can_reuse_media_keys.test.ts +13 -21
  407. package/src/compat/__tests__/clear_element_src.test.ts +37 -34
  408. package/src/compat/__tests__/enable_audio_track.test.ts +22 -21
  409. package/src/compat/__tests__/is_codec_supported.test.ts +17 -18
  410. package/src/compat/__tests__/is_seeking_approximate.test.ts +8 -14
  411. package/src/compat/__tests__/is_vtt_cue.test.ts +8 -13
  412. package/src/compat/__tests__/make_vtt_cue.test.ts +7 -12
  413. package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +44 -32
  414. package/src/compat/__tests__/remove_cue.test.ts +30 -31
  415. package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +21 -26
  416. package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +9 -17
  417. package/src/compat/__tests__/should_unset_media_keys.test.ts +7 -14
  418. package/src/compat/__tests__/should_validate_metadata.test.ts +7 -17
  419. package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +17 -26
  420. package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +10 -15
  421. package/src/compat/add_class_name.ts +1 -2
  422. package/src/compat/browser_compatibility_types.ts +4 -2
  423. package/src/compat/clear_element_src.ts +1 -1
  424. package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -2
  425. package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -2
  426. package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +3 -6
  427. package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +2 -17
  428. package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -4
  429. package/src/compat/eme/eme-api-implementation.ts +0 -2
  430. package/src/compat/event_listeners.ts +2 -6
  431. package/src/compat/has_mse_in_worker.ts +1 -1
  432. package/src/compat/is_codec_supported.ts +0 -2
  433. package/src/compat/is_debug_mode_enabled.ts +1 -1
  434. package/src/compat/is_vtt_cue.ts +1 -2
  435. package/src/compat/on_height_width_change.ts +1 -2
  436. package/src/compat/patch_webkit_source_buffer.ts +48 -29
  437. package/src/compat/remove_cue.ts +2 -2
  438. package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +21 -26
  439. package/src/core/fetchers/README.md +13 -12
  440. package/src/core/fetchers/index.ts +5 -8
  441. package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +17 -23
  442. package/src/core/fetchers/segment/index.ts +6 -5
  443. package/src/core/{stream/representation/utils/downloading_queue.ts → fetchers/segment/segment_queue.ts} +204 -166
  444. package/src/core/fetchers/segment/{segment_fetcher_creator.ts → segment_queue_creator.ts} +31 -14
  445. package/src/core/fetchers/segment/task_prioritizer.ts +10 -2
  446. package/src/core/fetchers/utils/schedule_request.ts +1 -1
  447. package/src/core/main/common/content_time_boundaries_observer.ts +4 -4
  448. package/src/core/main/worker/content_preparer.ts +5 -5
  449. package/src/core/main/worker/send_message.ts +1 -1
  450. package/src/core/main/worker/worker_main.ts +2 -2
  451. package/src/core/segment_sinks/implementations/text/text_segment_buffer.ts +1 -5
  452. package/src/core/segment_sinks/inventory/segment_inventory.ts +1 -2
  453. package/src/core/segment_sinks/segment_buffers_store.ts +3 -2
  454. package/src/core/stream/adaptation/adaptation_stream.ts +3 -3
  455. package/src/core/stream/adaptation/types.ts +2 -2
  456. package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +1 -2
  457. package/src/core/stream/orchestrator/stream_orchestrator.ts +4 -4
  458. package/src/core/stream/period/period_stream.ts +2 -2
  459. package/src/core/stream/period/types.ts +2 -2
  460. package/src/core/stream/representation/representation_stream.ts +59 -56
  461. package/src/core/stream/representation/types.ts +3 -4
  462. package/src/core/stream/representation/utils/get_needed_segments.ts +1 -2
  463. package/src/core/types.ts +2 -4
  464. package/src/default_config.ts +0 -8
  465. package/src/errors/__tests__/format_error.test.ts +18 -18
  466. package/src/experimental/features/__tests__/multi_thread.test.ts +5 -5
  467. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +11 -11
  468. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +18 -26
  469. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +13 -21
  470. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +24 -20
  471. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +28 -30
  472. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +32 -38
  473. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +64 -51
  474. package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -17
  475. package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -4
  476. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
  477. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +16 -14
  478. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
  479. package/src/features/__tests__/add_features.test.ts +12 -11
  480. package/src/features/add_features.ts +1 -2
  481. package/src/features/list/__tests__/dash_wasm.test.ts +4 -4
  482. package/src/main_thread/api/__tests__/option_utils.test.ts +114 -70
  483. package/src/main_thread/api/__tests__/public_api.test.ts +85 -48
  484. package/src/main_thread/api/option_utils.ts +2 -6
  485. package/src/main_thread/api/public_api.ts +24 -18
  486. package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +12 -18
  487. package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +128 -101
  488. package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +26 -33
  489. package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +46 -48
  490. package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +33 -34
  491. package/src/main_thread/decrypt/__tests__/__global__/utils.ts +13 -17
  492. package/src/main_thread/decrypt/session_events_listener.ts +1 -1
  493. package/src/main_thread/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -5
  494. package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +14 -17
  495. package/src/main_thread/decrypt/utils/persistent_sessions_store.ts +2 -1
  496. package/src/main_thread/init/media_source_content_initializer.ts +7 -7
  497. package/src/main_thread/init/multi_thread_content_initializer.ts +7 -12
  498. package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +11 -16
  499. package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +48 -18
  500. package/src/main_thread/text_displayer/html/__tests__/text_track_cues_store.test.ts +32 -17
  501. package/src/main_thread/text_displayer/html/html_text_displayer.ts +1 -5
  502. package/src/main_thread/text_displayer/native/native_text_displayer.ts +3 -7
  503. package/src/main_thread/tracks_store/__tests__/media_element_tracks_store.test.ts +33 -28
  504. package/src/main_thread/tracks_store/track_dispatcher.ts +1 -1
  505. package/src/main_thread/types.ts +0 -1
  506. package/src/manifest/classes/__tests__/adaptation.test.ts +167 -62
  507. package/src/manifest/classes/__tests__/manifest.test.ts +130 -74
  508. package/src/manifest/classes/__tests__/period.test.ts +293 -211
  509. package/src/manifest/classes/__tests__/update_period_in_place.test.ts +0 -2
  510. package/src/manifest/classes/__tests__/update_periods.test.ts +57 -57
  511. package/src/manifest/classes/manifest.ts +0 -6
  512. package/src/manifest/utils.ts +1 -2
  513. package/src/mse/main_media_source_interface.ts +1 -1
  514. package/src/mse/types.ts +1 -1
  515. package/src/multithread_types.ts +2 -2
  516. package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +5 -10
  517. package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +38 -30
  518. package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -3
  519. package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +12 -6
  520. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.ts +14 -7
  521. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.ts +8 -4
  522. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Period.ts +10 -5
  523. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.ts +10 -5
  524. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
  525. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
  526. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
  527. package/src/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.ts +14 -7
  528. package/src/parsers/manifest/dash/native-parser/node_parsers/EventStream.ts +2 -1
  529. package/src/parsers/manifest/dash/native-parser/node_parsers/MPD.ts +8 -4
  530. package/src/parsers/manifest/dash/native-parser/node_parsers/Period.ts +10 -5
  531. package/src/parsers/manifest/dash/native-parser/node_parsers/Representation.ts +10 -5
  532. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
  533. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
  534. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentTimeline.test.ts +9 -14
  535. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
  536. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -2
  537. package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +2 -1
  538. package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +2 -1
  539. package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +4 -2
  540. package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +10 -5
  541. package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +2 -1
  542. package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +2 -1
  543. package/src/parsers/manifest/local/representation_index.ts +1 -2
  544. package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +2 -3
  545. package/src/parsers/manifest/smooth/create_parser.ts +2 -1
  546. package/src/parsers/manifest/smooth/shared_smooth_segment_timeline.ts +2 -2
  547. package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +3 -8
  548. package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +2 -2
  549. package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +2 -2
  550. package/src/parsers/texttracks/srt/html.ts +2 -2
  551. package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +3 -7
  552. package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +4 -4
  553. package/src/parsers/texttracks/ttml/html/create_element.ts +1 -1
  554. package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +3 -3
  555. package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +1 -2
  556. package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +1 -2
  557. package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +11 -11
  558. package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +5 -18
  559. package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +23 -28
  560. package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +9 -14
  561. package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +11 -11
  562. package/src/parsers/texttracks/webvtt/html/to_html.ts +9 -3
  563. package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +2 -2
  564. package/src/public_types.ts +7 -8
  565. package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
  566. package/src/transports/smooth/extract_timings_infos.ts +3 -3
  567. package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +30 -28
  568. package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +38 -44
  569. package/src/utils/__tests__/array_find.test.ts +12 -12
  570. package/src/utils/__tests__/array_find_index.test.ts +13 -12
  571. package/src/utils/__tests__/array_includes.test.ts +7 -7
  572. package/src/utils/__tests__/assert.test.ts +19 -25
  573. package/src/utils/__tests__/base64.test.ts +18 -13
  574. package/src/utils/__tests__/event_emitter.test.ts +225 -50
  575. package/src/utils/__tests__/flat_map.test.ts +2 -6
  576. package/src/utils/__tests__/starts_with.test.ts +7 -8
  577. package/src/utils/array_find.ts +3 -7
  578. package/src/utils/array_find_index.ts +3 -7
  579. package/src/utils/array_includes.ts +1 -3
  580. package/src/utils/assert.ts +0 -2
  581. package/src/utils/base64.ts +3 -2
  582. package/src/utils/event_emitter.ts +1 -1
  583. package/src/utils/flat_map.ts +1 -2
  584. package/src/utils/id_generator.ts +0 -2
  585. package/src/utils/is_worker.ts +1 -1
  586. package/src/utils/logger.ts +1 -1
  587. package/src/utils/monotonic_timestamp.ts +2 -2
  588. package/src/utils/noop.ts +1 -2
  589. package/src/utils/object_assign.ts +1 -2
  590. package/src/utils/object_values.ts +1 -2
  591. package/src/utils/reference.ts +1 -1
  592. package/src/utils/request/xhr.ts +1 -1
  593. package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
  594. package/dist/commonjs/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
  595. package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
  596. package/dist/es2017/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
@@ -13,100 +13,82 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IManifest, IAdaptation, ISegment, IPeriod, IRepresentation } from "../../../../manifest";
17
- import type { IPlayerError } from "../../../../public_types";
18
- import type { ISegmentParserParsedInitChunk, ISegmentParserParsedMediaChunk } from "../../../../transports";
19
- import EventEmitter from "../../../../utils/event_emitter";
20
- import type { IReadOnlySharedReference } from "../../../../utils/reference";
21
- import type { IPrioritizedSegmentFetcher } from "../../../fetchers";
22
- import type { IQueuedSegment } from "../types";
16
+ import type { IManifest, IAdaptation, ISegment, IPeriod, IRepresentation } from "../../../manifest";
17
+ import type { IPlayerError } from "../../../public_types";
18
+ import type { ISegmentParserParsedInitChunk, ISegmentParserParsedMediaChunk } from "../../../transports";
19
+ import EventEmitter from "../../../utils/event_emitter";
20
+ import SharedReference from "../../../utils/reference";
21
+ import type { IPrioritizedSegmentFetcher } from "./prioritized_segment_fetcher";
22
+ /** Information about a Segment waiting to be loaded by the SegmentQueue. */
23
+ export interface IQueuedSegment {
24
+ /** Priority of the segment request (lower number = higher priority). */
25
+ priority: number;
26
+ /** Segment wanted. */
27
+ segment: ISegment;
28
+ }
23
29
  /**
24
- * Class scheduling segment downloads for a single Representation.
25
- *
26
- * TODO The request scheduling abstractions might be simplified by integrating
27
- * the `DownloadingQueue` in the segment fetchers code, instead of having it as
28
- * an utilis of the `RepresentationStream` like here.
29
- * @class DownloadingQueue
30
+ * Class scheduling segment downloads as a FIFO queue.
30
31
  */
31
- export default class DownloadingQueue<T> extends EventEmitter<IDownloadingQueueEvent<T>> {
32
- /** Context of the Representation that will be loaded through this DownloadingQueue. */
33
- private _content;
34
- /**
35
- * Current queue of segments scheduled for download.
36
- *
37
- * Segments whose request are still pending are still in that queue. Segments
38
- * are only removed from it once their request has succeeded.
39
- */
40
- private _downloadQueue;
41
- /**
42
- * Allows to stop listening to queue updates and stop performing requests.
43
- * Set to `null` if the DownloadingQueue is not started right now.
44
- */
45
- private _currentCanceller;
32
+ export default class SegmentQueue<T> extends EventEmitter<ISegmentQueueEvent<T>> {
33
+ /** Interface used to load segments. */
34
+ private _segmentFetcher;
46
35
  /**
47
- * Pending request for the initialization segment.
48
- * `null` if no request is pending for it.
36
+ * Metadata on the content for which segments are currently loaded.
37
+ * `null` if no queue is active.
49
38
  */
50
- private _initSegmentRequest;
39
+ private _currentContentInfo;
51
40
  /**
52
- * Pending request for a media (i.e. non-initialization) segment.
53
- * `null` if no request is pending for it.
41
+ * Create a new `SegmentQueue`.
42
+ *
43
+ * @param {Object} segmentFetcher - Interface to facilitate the download of
44
+ * segments.
54
45
  */
55
- private _mediaSegmentRequest;
56
- /** Interface used to load segments. */
57
- private _segmentFetcher;
46
+ constructor(segmentFetcher: IPrioritizedSegmentFetcher<T>);
58
47
  /**
59
- * Emit the timescale anounced in the initialization segment once parsed.
60
- * `undefined` when this is not yet known.
61
- * `null` when no initialization segment or timescale exists.
48
+ * Returns the initialization segment currently being requested.
49
+ * Returns `null` if no initialization segment request is pending.
50
+ * @returns {Object | null}
62
51
  */
63
- private _initSegmentInfoRef;
52
+ getRequestedInitSegment(): ISegment | null;
64
53
  /**
65
- * Some media segment might have been loaded and are only awaiting for the
66
- * initialization segment to be parsed before being parsed themselves.
67
- * This string will contain the `id` property of that segment if one exist or
68
- * `null` if no segment is awaiting an init segment.
54
+ * Returns the media segment currently being requested.
55
+ * Returns `null` if no media segment request is pending.
56
+ * @returns {Object | null}
69
57
  */
70
- private _mediaSegmentAwaitingInitMetadata;
58
+ getRequestedMediaSegment(): ISegment | null;
71
59
  /**
72
- * Create a new `DownloadingQueue`.
60
+ * Return an object allowing to schedule segment requests linked to the given
61
+ * content.
62
+ * The `SegmentQueue` will emit events as it loads and parses initialization
63
+ * and media segments.
64
+ *
65
+ * Calling this method resets all previous queues that were previously started
66
+ * on the same instance.
73
67
  *
74
68
  * @param {Object} content - The context of the Representation you want to
75
69
  * load segments for.
76
- * @param {Object} downloadQueue - Queue of segments you want to load.
77
- * @param {Object} segmentFetcher - Interface to facilitate the download of
78
- * segments.
79
70
  * @param {boolean} hasInitSegment - Declare that an initialization segment
80
71
  * will need to be downloaded.
81
72
  *
82
- * A `DownloadingQueue` ALWAYS wait for the initialization segment to be
73
+ * A `SegmentQueue` ALWAYS wait for the initialization segment to be
83
74
  * loaded and parsed before parsing a media segment.
84
75
  *
85
76
  * In cases where no initialization segment exist, this would lead to the
86
- * `DownloadingQueue` waiting indefinitely for it.
77
+ * `SegmentQueue` waiting indefinitely for it.
87
78
  *
88
- * By setting that value to `false`, you anounce to the `DownloadingQueue`
79
+ * By setting that value to `false`, you anounce to the `SegmentQueue`
89
80
  * that it should not wait for an initialization segment before parsing a
90
81
  * media segment.
82
+ * @returns {Object} - `SharedReference` on which the queue of segment for
83
+ * that content can be communicated and updated. See type for more
84
+ * information.
91
85
  */
92
- constructor(content: IDownloadingQueueContext, downloadQueue: IReadOnlySharedReference<IDownloadQueueItem>, segmentFetcher: IPrioritizedSegmentFetcher<T>, hasInitSegment: boolean);
86
+ resetForContent(content: ISegmentQueueContext, hasInitSegment: boolean): SharedReference<ISegmentQueueItem>;
93
87
  /**
94
- * Returns the initialization segment currently being requested.
95
- * Returns `null` if no initialization segment request is pending.
96
- * @returns {Object | null}
97
- */
98
- getRequestedInitSegment(): ISegment | null;
99
- /**
100
- * Returns the media segment currently being requested.
101
- * Returns `null` if no media segment request is pending.
102
- * @returns {Object | null}
103
- */
104
- getRequestedMediaSegment(): ISegment | null;
105
- /**
106
- * Start the current downloading queue, emitting events as it loads and parses
107
- * initialization and media segments.
88
+ * Stop the currently-active `SegmentQueue`.
89
+ *
90
+ * Do nothing if no queue is active.
108
91
  */
109
- start(): void;
110
92
  stop(): void;
111
93
  /**
112
94
  * Internal logic performing media segment requests.
@@ -114,24 +96,25 @@ export default class DownloadingQueue<T> extends EventEmitter<IDownloadingQueueE
114
96
  private _restartMediaSegmentDownloadingQueue;
115
97
  /**
116
98
  * Internal logic performing initialization segment requests.
99
+ * @param {Object} contentInfo
117
100
  * @param {Object} queuedInitSegment
118
101
  */
119
102
  private _restartInitSegmentDownloadingQueue;
120
103
  }
121
104
  /**
122
- * Events sent by the `DownloadingQueue`.
105
+ * Events sent by the `SegmentQueue`.
123
106
  *
124
107
  * The key is the event's name and the value the format of the corresponding
125
108
  * event's payload.
126
109
  */
127
- export interface IDownloadingQueueEvent<T> {
110
+ export interface ISegmentQueueEvent<T> {
128
111
  /**
129
112
  * Notify that the initialization segment has been fully loaded and parsed.
130
113
  *
131
114
  * You can now push that segment to its corresponding buffer and use its parsed
132
115
  * metadata.
133
116
  *
134
- * Only sent if an initialization segment exists (when the `DownloadingQueue`'s
117
+ * Only sent if an initialization segment exists (when the `SegmentQueue`'s
135
118
  * `hasInitSegment` constructor option has been set to `true`).
136
119
  * In that case, an `IParsedInitSegmentEvent` will always be sent before any
137
120
  * `IParsedSegmentEvent` event is sent.
@@ -141,7 +124,7 @@ export interface IDownloadingQueueEvent<T> {
141
124
  * Notify that a media chunk (decodable sub-part of a media segment) has been
142
125
  * loaded and parsed.
143
126
  *
144
- * If an initialization segment exists (when the `DownloadingQueue`'s
127
+ * If an initialization segment exists (when the `SegmentQueue`'s
145
128
  * `hasInitSegment` constructor option has been set to `true`), an
146
129
  * `IParsedSegmentEvent` will always be sent AFTER the `IParsedInitSegmentEvent`
147
130
  * event.
@@ -187,10 +170,10 @@ export interface IRequestRetryPayload {
187
170
  error: IPlayerError;
188
171
  }
189
172
  /**
190
- * Structure of the object that has to be emitted through the `downloadQueue`
173
+ * Structure of the object that has to be emitted through the `SegmentQueue`
191
174
  * shared reference, to signal which segments are currently needed.
192
175
  */
193
- export interface IDownloadQueueItem {
176
+ export interface ISegmentQueueItem {
194
177
  /**
195
178
  * A potential initialization segment that needs to be loaded and parsed.
196
179
  * It will generally be requested in parralel of the first media segments.
@@ -198,7 +181,7 @@ export interface IDownloadQueueItem {
198
181
  * Can be set to `null` if you don't need to load the initialization segment
199
182
  * for now.
200
183
  *
201
- * If the `DownloadingQueue`'s `hasInitSegment` constructor option has been
184
+ * If the `SegmentQueue`'s `hasInitSegment` constructor option has been
202
185
  * set to `true`, no media segment will be parsed before the initialization
203
186
  * segment has been loaded and parsed.
204
187
  */
@@ -212,14 +195,14 @@ export interface IDownloadQueueItem {
212
195
  * Note that any media segments in the segment queue will only be parsed once
213
196
  * either of these is true:
214
197
  * - An initialization segment has been loaded and parsed by this
215
- * `DownloadingQueue` instance.
216
- * - The `DownloadingQueue`'s `hasInitSegment` constructor option has been
198
+ * `SegmentQueue` instance.
199
+ * - The `SegmentQueue`'s `hasInitSegment` constructor option has been
217
200
  * set to `false`.
218
201
  */
219
202
  segmentQueue: IQueuedSegment[];
220
203
  }
221
- /** Context for segments downloaded through the DownloadingQueue. */
222
- export interface IDownloadingQueueContext {
204
+ /** Context for segments downloaded through the SegmentQueue. */
205
+ export interface ISegmentQueueContext {
223
206
  /** Adaptation linked to the segments you want to load. */
224
207
  adaptation: IAdaptation;
225
208
  /** Manifest linked to the segments you want to load. */
@@ -229,4 +212,4 @@ export interface IDownloadingQueueContext {
229
212
  /** Representation linked to the segments you want to load. */
230
213
  representation: IRepresentation;
231
214
  }
232
- //# sourceMappingURL=downloading_queue.d.ts.map
215
+ //# sourceMappingURL=segment_queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment_queue.d.ts","sourceRoot":"","sources":["../../../../../src/core/fetchers/segment/segment_queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,QAAQ,EACR,OAAO,EACP,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EACV,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAGxD,OAAO,eAAe,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,OAAO,EAAE,QAAQ,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY,CAAC,CAAC,CAAE,SAAQ,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC9E,uCAAuC;IACvC,OAAO,CAAC,eAAe,CAAgC;IAEvD;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAAkC;IAE7D;;;;;OAKG;gBACS,cAAc,EAAE,0BAA0B,CAAC,CAAC,CAAC;IAMzD;;;;OAIG;IACI,uBAAuB,IAAI,QAAQ,GAAG,IAAI;IAIjD;;;;OAIG;IACI,wBAAwB,IAAI,QAAQ,GAAG,IAAI;IAIlD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACI,eAAe,CACpB,OAAO,EAAE,oBAAoB,EAC7B,cAAc,EAAE,OAAO,GACtB,eAAe,CAAC,iBAAiB,CAAC;IAsHrC;;;;OAIG;IACI,IAAI;IAKX;;OAEG;IACH,OAAO,CAAC,oCAAoC;IAkL5C;;;;OAIG;IACH,OAAO,CAAC,mCAAmC;CAgF5C;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC;;;;;;;;;;OAUG;IACH,iBAAiB,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAChD;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAC7C,2EAA2E;IAC3E,kBAAkB,EAAE,QAAQ,CAAC;IAC7B;;;OAGG;IACH,YAAY,EAAE,oBAAoB,CAAC;IACnC;;;OAGG;IACH,UAAU,EAAE,IAAI,CAAC;IACjB;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,+CAA+C;AAC/C,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI,6BAA6B,CAAC,CAAC,CAAC,GAAG;IAC5E,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AACF,gDAAgD;AAChD,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,8BAA8B,CAAC,CAAC,CAAC,GAAG;IACzE,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AACF,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;OAUG;IACH,WAAW,EAAE,cAAc,GAAG,IAAI,CAAC;IAEnC;;;;;;;;;;;;OAYG;IACH,YAAY,EAAE,cAAc,EAAE,CAAC;CAChC;AAcD,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,UAAU,EAAE,WAAW,CAAC;IACxB,wDAAwD;IACxD,QAAQ,EAAE,SAAS,CAAC;IACpB,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,cAAc,EAAE,eAAe,CAAC;CACjC"}