rx-player 4.2.0-dev.2024082600 → 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 (628) hide show
  1. package/CHANGELOG.md +12 -3
  2. package/VERSION +1 -1
  3. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
  4. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  5. package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  6. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
  7. package/dist/commonjs/compat/add_class_name.d.ts.map +1 -1
  8. package/dist/commonjs/compat/add_class_name.js +1 -2
  9. package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
  10. package/dist/commonjs/compat/browser_compatibility_types.js +4 -1
  11. package/dist/commonjs/compat/browser_detection.d.ts +3 -1
  12. package/dist/commonjs/compat/browser_detection.d.ts.map +1 -1
  13. package/dist/commonjs/compat/browser_detection.js +8 -1
  14. package/dist/commonjs/compat/can_reuse_media_keys.d.ts +2 -0
  15. package/dist/commonjs/compat/can_reuse_media_keys.d.ts.map +1 -1
  16. package/dist/commonjs/compat/can_reuse_media_keys.js +3 -1
  17. package/dist/commonjs/compat/clear_element_src.js +1 -1
  18. package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
  19. package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
  20. package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
  21. package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
  22. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
  23. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
  24. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
  25. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
  26. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
  27. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
  28. package/dist/commonjs/compat/eme/eme-api-implementation.js +0 -2
  29. package/dist/commonjs/compat/event_listeners.d.ts.map +1 -1
  30. package/dist/commonjs/compat/event_listeners.js +2 -6
  31. package/dist/commonjs/compat/has_mse_in_worker.js +1 -1
  32. package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
  33. package/dist/commonjs/compat/is_codec_supported.js +0 -2
  34. package/dist/commonjs/compat/is_vtt_cue.d.ts.map +1 -1
  35. package/dist/commonjs/compat/is_vtt_cue.js +1 -2
  36. package/dist/commonjs/compat/on_height_width_change.d.ts.map +1 -1
  37. package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
  38. package/dist/commonjs/compat/patch_webkit_source_buffer.js +8 -18
  39. package/dist/commonjs/compat/remove_cue.js +2 -2
  40. package/dist/commonjs/core/cmcd/cmcd_data_builder.js +1 -1
  41. package/dist/commonjs/core/fetchers/index.d.ts +4 -4
  42. package/dist/commonjs/core/fetchers/index.d.ts.map +1 -1
  43. package/dist/commonjs/core/fetchers/index.js +2 -2
  44. package/dist/commonjs/core/fetchers/segment/index.d.ts +6 -5
  45. package/dist/commonjs/core/fetchers/segment/index.d.ts.map +1 -1
  46. package/dist/commonjs/core/fetchers/segment/index.js +2 -2
  47. package/dist/commonjs/core/{stream/representation/utils/downloading_queue.d.ts → fetchers/segment/segment_queue.d.ts} +63 -80
  48. package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -0
  49. package/dist/commonjs/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +132 -111
  50. package/dist/{es2017/core/fetchers/segment/segment_fetcher_creator.d.ts → commonjs/core/fetchers/segment/segment_queue_creator.d.ts} +25 -12
  51. package/dist/commonjs/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
  52. package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +15 -9
  53. package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts +9 -0
  54. package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
  55. package/dist/commonjs/core/fetchers/segment/task_prioritizer.js +38 -8
  56. package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
  57. package/dist/commonjs/core/main/common/content_time_boundaries_observer.js +21 -10
  58. package/dist/commonjs/core/main/worker/content_preparer.d.ts +3 -3
  59. package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +1 -1
  60. package/dist/commonjs/core/main/worker/content_preparer.js +2 -2
  61. package/dist/commonjs/core/main/worker/send_message.js +1 -1
  62. package/dist/commonjs/core/main/worker/worker_main.js +3 -2
  63. package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
  64. package/dist/commonjs/core/segment_sinks/inventory/segment_inventory.js +39 -30
  65. package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
  66. package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +3 -2
  67. package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts +1 -1
  68. package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
  69. package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +3 -3
  70. package/dist/commonjs/core/stream/adaptation/types.d.ts +2 -2
  71. package/dist/commonjs/core/stream/adaptation/types.d.ts.map +1 -1
  72. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
  73. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +27 -6
  74. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
  75. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
  76. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
  77. package/dist/commonjs/core/stream/period/period_stream.d.ts +1 -1
  78. package/dist/commonjs/core/stream/period/period_stream.d.ts.map +1 -1
  79. package/dist/commonjs/core/stream/period/period_stream.js +2 -2
  80. package/dist/commonjs/core/stream/period/types.d.ts +2 -2
  81. package/dist/commonjs/core/stream/period/types.d.ts.map +1 -1
  82. package/dist/commonjs/core/stream/representation/representation_stream.d.ts +1 -1
  83. package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
  84. package/dist/commonjs/core/stream/representation/representation_stream.js +19 -28
  85. package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
  86. package/dist/commonjs/core/stream/representation/types.d.ts.map +1 -1
  87. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
  88. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +39 -18
  89. package/dist/commonjs/core/types.d.ts +2 -2
  90. package/dist/commonjs/core/types.d.ts.map +1 -1
  91. package/dist/commonjs/default_config.d.ts.map +1 -1
  92. package/dist/commonjs/default_config.js +0 -8
  93. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
  94. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
  95. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
  96. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
  97. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
  98. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
  99. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
  100. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
  101. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
  102. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
  103. package/dist/commonjs/features/add_features.d.ts.map +1 -1
  104. package/dist/commonjs/features/add_features.js +31 -10
  105. package/dist/commonjs/main_thread/api/option_utils.d.ts.map +1 -1
  106. package/dist/commonjs/main_thread/api/option_utils.js +2 -6
  107. package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
  108. package/dist/commonjs/main_thread/api/public_api.js +33 -27
  109. package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
  110. package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.js +4 -3
  111. package/dist/commonjs/main_thread/init/media_source_content_initializer.js +6 -6
  112. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  113. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +32 -37
  114. package/dist/commonjs/main_thread/text_displayer/html/html_text_displayer.js +1 -5
  115. package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +3 -7
  116. package/dist/commonjs/main_thread/tracks_store/track_dispatcher.js +1 -1
  117. package/dist/commonjs/main_thread/types.d.ts.map +1 -1
  118. package/dist/commonjs/manifest/classes/adaptation.d.ts +13 -13
  119. package/dist/commonjs/manifest/classes/manifest.d.ts.map +1 -1
  120. package/dist/commonjs/manifest/classes/manifest.js +0 -6
  121. package/dist/commonjs/manifest/classes/representation.d.ts +20 -12
  122. package/dist/commonjs/manifest/classes/representation.d.ts.map +1 -1
  123. package/dist/commonjs/manifest/utils.d.ts.map +1 -1
  124. package/dist/commonjs/manifest/utils.js +72 -62
  125. package/dist/commonjs/mse/main_media_source_interface.js +1 -1
  126. package/dist/commonjs/multithread_types.d.ts +2 -2
  127. package/dist/commonjs/multithread_types.d.ts.map +1 -1
  128. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
  129. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
  130. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  131. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
  132. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
  133. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
  134. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
  135. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
  136. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
  137. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
  138. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  139. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
  140. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
  141. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
  142. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
  143. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
  144. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
  145. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
  146. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
  147. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
  148. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
  149. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
  150. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
  151. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
  152. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
  153. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
  154. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
  155. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
  156. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
  157. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
  158. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
  159. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
  160. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
  161. package/dist/commonjs/parsers/manifest/local/representation_index.d.ts.map +1 -1
  162. package/dist/commonjs/parsers/manifest/local/representation_index.js +29 -8
  163. package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
  164. package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +31 -10
  165. package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
  166. package/dist/commonjs/parsers/manifest/smooth/create_parser.js +2 -1
  167. package/dist/commonjs/parsers/manifest/smooth/shared_smooth_segment_timeline.js +26 -4
  168. package/dist/commonjs/parsers/manifest/utils/get_first_time_from_adaptation.js +29 -7
  169. package/dist/commonjs/parsers/manifest/utils/get_last_time_from_adaptation.js +29 -7
  170. package/dist/commonjs/parsers/texttracks/srt/html.js +28 -6
  171. package/dist/commonjs/parsers/texttracks/ttml/html/create_element.js +1 -1
  172. package/dist/commonjs/parsers/texttracks/ttml/html/parse_ttml_to_div.js +29 -7
  173. package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
  174. package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +26 -5
  175. package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
  176. package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.js +25 -4
  177. package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
  178. package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
  179. package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.js +9 -3
  180. package/dist/commonjs/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +30 -8
  181. package/dist/commonjs/public_types.d.ts +5 -7
  182. package/dist/commonjs/public_types.d.ts.map +1 -1
  183. package/dist/commonjs/transports/smooth/extract_timings_infos.js +30 -8
  184. package/dist/commonjs/utils/array_find.d.ts +1 -1
  185. package/dist/commonjs/utils/array_find.d.ts.map +1 -1
  186. package/dist/commonjs/utils/array_find.js +3 -1
  187. package/dist/commonjs/utils/array_find_index.d.ts +1 -1
  188. package/dist/commonjs/utils/array_find_index.d.ts.map +1 -1
  189. package/dist/commonjs/utils/array_find_index.js +3 -1
  190. package/dist/commonjs/utils/array_includes.d.ts.map +1 -1
  191. package/dist/commonjs/utils/array_includes.js +1 -3
  192. package/dist/commonjs/utils/assert.d.ts.map +1 -1
  193. package/dist/commonjs/utils/assert.js +0 -2
  194. package/dist/commonjs/utils/base64.d.ts +1 -1
  195. package/dist/commonjs/utils/base64.d.ts.map +1 -1
  196. package/dist/commonjs/utils/base64.js +3 -2
  197. package/dist/commonjs/utils/event_emitter.js +1 -1
  198. package/dist/commonjs/utils/flat_map.d.ts.map +1 -1
  199. package/dist/commonjs/utils/flat_map.js +1 -2
  200. package/dist/commonjs/utils/id_generator.d.ts.map +1 -1
  201. package/dist/commonjs/utils/id_generator.js +0 -1
  202. package/dist/commonjs/utils/logger.js +1 -1
  203. package/dist/commonjs/utils/monotonic_timestamp.js +2 -2
  204. package/dist/commonjs/utils/noop.js +1 -2
  205. package/dist/commonjs/utils/object_assign.d.ts.map +1 -1
  206. package/dist/commonjs/utils/object_assign.js +27 -6
  207. package/dist/commonjs/utils/object_values.d.ts.map +1 -1
  208. package/dist/commonjs/utils/object_values.js +1 -1
  209. package/dist/commonjs/utils/reference.js +1 -1
  210. package/dist/commonjs/utils/request/xhr.js +1 -1
  211. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
  212. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  213. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  214. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  215. package/dist/es2017/compat/add_class_name.d.ts.map +1 -1
  216. package/dist/es2017/compat/add_class_name.js +1 -2
  217. package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
  218. package/dist/es2017/compat/browser_compatibility_types.js +4 -1
  219. package/dist/es2017/compat/browser_detection.d.ts +3 -1
  220. package/dist/es2017/compat/browser_detection.d.ts.map +1 -1
  221. package/dist/es2017/compat/browser_detection.js +7 -1
  222. package/dist/es2017/compat/can_reuse_media_keys.d.ts +2 -0
  223. package/dist/es2017/compat/can_reuse_media_keys.d.ts.map +1 -1
  224. package/dist/es2017/compat/can_reuse_media_keys.js +4 -2
  225. package/dist/es2017/compat/clear_element_src.js +1 -1
  226. package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
  227. package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
  228. package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
  229. package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
  230. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
  231. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
  232. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
  233. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
  234. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
  235. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
  236. package/dist/es2017/compat/eme/eme-api-implementation.js +0 -2
  237. package/dist/es2017/compat/event_listeners.d.ts.map +1 -1
  238. package/dist/es2017/compat/event_listeners.js +2 -6
  239. package/dist/es2017/compat/has_mse_in_worker.js +1 -1
  240. package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
  241. package/dist/es2017/compat/is_codec_supported.js +0 -2
  242. package/dist/es2017/compat/is_vtt_cue.d.ts.map +1 -1
  243. package/dist/es2017/compat/is_vtt_cue.js +1 -2
  244. package/dist/es2017/compat/on_height_width_change.d.ts.map +1 -1
  245. package/dist/es2017/compat/patch_webkit_source_buffer.d.ts.map +1 -1
  246. package/dist/es2017/compat/patch_webkit_source_buffer.js +8 -18
  247. package/dist/es2017/compat/remove_cue.js +2 -2
  248. package/dist/es2017/core/cmcd/cmcd_data_builder.js +1 -1
  249. package/dist/es2017/core/fetchers/index.d.ts +4 -4
  250. package/dist/es2017/core/fetchers/index.d.ts.map +1 -1
  251. package/dist/es2017/core/fetchers/index.js +2 -2
  252. package/dist/es2017/core/fetchers/segment/index.d.ts +6 -5
  253. package/dist/es2017/core/fetchers/segment/index.d.ts.map +1 -1
  254. package/dist/es2017/core/fetchers/segment/index.js +2 -2
  255. package/dist/es2017/core/{stream/representation/utils/downloading_queue.d.ts → fetchers/segment/segment_queue.d.ts} +63 -80
  256. package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -0
  257. package/dist/es2017/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +126 -105
  258. package/dist/{commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts → es2017/core/fetchers/segment/segment_queue_creator.d.ts} +25 -12
  259. package/dist/es2017/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
  260. package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +12 -6
  261. package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts +9 -0
  262. package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
  263. package/dist/es2017/core/fetchers/segment/task_prioritizer.js +10 -2
  264. package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
  265. package/dist/es2017/core/main/common/content_time_boundaries_observer.js +4 -4
  266. package/dist/es2017/core/main/worker/content_preparer.d.ts +3 -3
  267. package/dist/es2017/core/main/worker/content_preparer.d.ts.map +1 -1
  268. package/dist/es2017/core/main/worker/content_preparer.js +3 -3
  269. package/dist/es2017/core/main/worker/send_message.js +1 -1
  270. package/dist/es2017/core/main/worker/worker_main.js +3 -2
  271. package/dist/es2017/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
  272. package/dist/es2017/core/segment_sinks/inventory/segment_inventory.js +1 -2
  273. package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
  274. package/dist/es2017/core/segment_sinks/segment_buffers_store.js +3 -2
  275. package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts +1 -1
  276. package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
  277. package/dist/es2017/core/stream/adaptation/adaptation_stream.js +3 -3
  278. package/dist/es2017/core/stream/adaptation/types.d.ts +2 -2
  279. package/dist/es2017/core/stream/adaptation/types.d.ts.map +1 -1
  280. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
  281. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
  282. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
  283. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
  284. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
  285. package/dist/es2017/core/stream/period/period_stream.d.ts +1 -1
  286. package/dist/es2017/core/stream/period/period_stream.d.ts.map +1 -1
  287. package/dist/es2017/core/stream/period/period_stream.js +2 -2
  288. package/dist/es2017/core/stream/period/types.d.ts +2 -2
  289. package/dist/es2017/core/stream/period/types.d.ts.map +1 -1
  290. package/dist/es2017/core/stream/representation/representation_stream.d.ts +1 -1
  291. package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
  292. package/dist/es2017/core/stream/representation/representation_stream.js +19 -28
  293. package/dist/es2017/core/stream/representation/types.d.ts +2 -2
  294. package/dist/es2017/core/stream/representation/types.d.ts.map +1 -1
  295. package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
  296. package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -2
  297. package/dist/es2017/core/types.d.ts +2 -2
  298. package/dist/es2017/core/types.d.ts.map +1 -1
  299. package/dist/es2017/default_config.d.ts.map +1 -1
  300. package/dist/es2017/default_config.js +0 -8
  301. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
  302. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
  303. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
  304. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
  305. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
  306. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
  307. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
  308. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
  309. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
  310. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
  311. package/dist/es2017/features/add_features.d.ts.map +1 -1
  312. package/dist/es2017/features/add_features.js +1 -2
  313. package/dist/es2017/main_thread/api/option_utils.d.ts.map +1 -1
  314. package/dist/es2017/main_thread/api/option_utils.js +2 -6
  315. package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
  316. package/dist/es2017/main_thread/api/public_api.js +29 -23
  317. package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
  318. package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.js +2 -1
  319. package/dist/es2017/main_thread/init/media_source_content_initializer.js +6 -6
  320. package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  321. package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +7 -12
  322. package/dist/es2017/main_thread/text_displayer/html/html_text_displayer.js +1 -5
  323. package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +3 -7
  324. package/dist/es2017/main_thread/tracks_store/track_dispatcher.js +1 -1
  325. package/dist/es2017/main_thread/types.d.ts.map +1 -1
  326. package/dist/es2017/manifest/classes/adaptation.d.ts +13 -13
  327. package/dist/es2017/manifest/classes/manifest.d.ts.map +1 -1
  328. package/dist/es2017/manifest/classes/manifest.js +0 -6
  329. package/dist/es2017/manifest/classes/representation.d.ts +20 -12
  330. package/dist/es2017/manifest/classes/representation.d.ts.map +1 -1
  331. package/dist/es2017/manifest/utils.d.ts.map +1 -1
  332. package/dist/es2017/manifest/utils.js +1 -2
  333. package/dist/es2017/mse/main_media_source_interface.js +1 -1
  334. package/dist/es2017/multithread_types.d.ts +2 -2
  335. package/dist/es2017/multithread_types.d.ts.map +1 -1
  336. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
  337. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
  338. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  339. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
  340. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
  341. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
  342. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
  343. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
  344. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
  345. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
  346. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  347. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
  348. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
  349. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
  350. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
  351. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
  352. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
  353. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
  354. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
  355. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
  356. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
  357. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -2
  358. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
  359. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
  360. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
  361. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
  362. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
  363. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
  364. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
  365. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
  366. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
  367. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
  368. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
  369. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
  370. package/dist/es2017/parsers/manifest/local/representation_index.d.ts.map +1 -1
  371. package/dist/es2017/parsers/manifest/local/representation_index.js +1 -2
  372. package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
  373. package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -3
  374. package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
  375. package/dist/es2017/parsers/manifest/smooth/create_parser.js +2 -1
  376. package/dist/es2017/parsers/manifest/smooth/shared_smooth_segment_timeline.js +2 -2
  377. package/dist/es2017/parsers/manifest/utils/get_first_time_from_adaptation.js +2 -2
  378. package/dist/es2017/parsers/manifest/utils/get_last_time_from_adaptation.js +2 -2
  379. package/dist/es2017/parsers/texttracks/srt/html.js +2 -2
  380. package/dist/es2017/parsers/texttracks/ttml/html/create_element.js +1 -1
  381. package/dist/es2017/parsers/texttracks/ttml/html/parse_ttml_to_div.js +3 -3
  382. package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
  383. package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +1 -2
  384. package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
  385. package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.js +1 -2
  386. package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
  387. package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
  388. package/dist/es2017/parsers/texttracks/webvtt/html/to_html.js +9 -3
  389. package/dist/es2017/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -2
  390. package/dist/es2017/public_types.d.ts +5 -7
  391. package/dist/es2017/public_types.d.ts.map +1 -1
  392. package/dist/es2017/transports/smooth/extract_timings_infos.js +3 -3
  393. package/dist/es2017/utils/array_find.d.ts +1 -1
  394. package/dist/es2017/utils/array_find.d.ts.map +1 -1
  395. package/dist/es2017/utils/array_find.js +3 -1
  396. package/dist/es2017/utils/array_find_index.d.ts +1 -1
  397. package/dist/es2017/utils/array_find_index.d.ts.map +1 -1
  398. package/dist/es2017/utils/array_find_index.js +3 -1
  399. package/dist/es2017/utils/array_includes.d.ts.map +1 -1
  400. package/dist/es2017/utils/array_includes.js +1 -3
  401. package/dist/es2017/utils/assert.d.ts.map +1 -1
  402. package/dist/es2017/utils/assert.js +0 -2
  403. package/dist/es2017/utils/base64.d.ts +1 -1
  404. package/dist/es2017/utils/base64.d.ts.map +1 -1
  405. package/dist/es2017/utils/base64.js +3 -2
  406. package/dist/es2017/utils/event_emitter.js +1 -1
  407. package/dist/es2017/utils/flat_map.d.ts.map +1 -1
  408. package/dist/es2017/utils/flat_map.js +1 -2
  409. package/dist/es2017/utils/id_generator.d.ts.map +1 -1
  410. package/dist/es2017/utils/id_generator.js +0 -1
  411. package/dist/es2017/utils/logger.js +1 -1
  412. package/dist/es2017/utils/monotonic_timestamp.js +2 -2
  413. package/dist/es2017/utils/noop.js +1 -2
  414. package/dist/es2017/utils/object_assign.d.ts.map +1 -1
  415. package/dist/es2017/utils/object_assign.js +1 -2
  416. package/dist/es2017/utils/object_values.d.ts.map +1 -1
  417. package/dist/es2017/utils/object_values.js +1 -2
  418. package/dist/es2017/utils/reference.js +1 -1
  419. package/dist/es2017/utils/request/xhr.js +1 -1
  420. package/dist/mpd-parser.wasm +0 -0
  421. package/dist/rx-player.js +39336 -18
  422. package/dist/rx-player.min.js +18 -0
  423. package/dist/worker.js +5 -5
  424. package/package.json +16 -9
  425. package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
  426. package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
  427. package/src/compat/__tests__/add_text_track.test.ts +8 -12
  428. package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -7
  429. package/src/compat/__tests__/browser_version.test.ts +20 -19
  430. package/src/compat/__tests__/can_patch_isobmff.test.ts +7 -10
  431. package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +17 -21
  432. package/src/compat/__tests__/can_reuse_media_keys.test.ts +38 -15
  433. package/src/compat/__tests__/clear_element_src.test.ts +37 -34
  434. package/src/compat/__tests__/enable_audio_track.test.ts +22 -21
  435. package/src/compat/__tests__/is_codec_supported.test.ts +17 -18
  436. package/src/compat/__tests__/is_seeking_approximate.test.ts +8 -14
  437. package/src/compat/__tests__/is_vtt_cue.test.ts +8 -13
  438. package/src/compat/__tests__/make_vtt_cue.test.ts +7 -12
  439. package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +44 -32
  440. package/src/compat/__tests__/remove_cue.test.ts +30 -31
  441. package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +21 -26
  442. package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +9 -17
  443. package/src/compat/__tests__/should_unset_media_keys.test.ts +7 -14
  444. package/src/compat/__tests__/should_validate_metadata.test.ts +7 -17
  445. package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +17 -26
  446. package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +10 -15
  447. package/src/compat/add_class_name.ts +1 -2
  448. package/src/compat/browser_compatibility_types.ts +4 -2
  449. package/src/compat/browser_detection.ts +9 -0
  450. package/src/compat/can_reuse_media_keys.ts +4 -2
  451. package/src/compat/clear_element_src.ts +1 -1
  452. package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -2
  453. package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -2
  454. package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +3 -6
  455. package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +2 -17
  456. package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -4
  457. package/src/compat/eme/eme-api-implementation.ts +0 -2
  458. package/src/compat/event_listeners.ts +2 -6
  459. package/src/compat/has_mse_in_worker.ts +1 -1
  460. package/src/compat/is_codec_supported.ts +0 -2
  461. package/src/compat/is_debug_mode_enabled.ts +1 -1
  462. package/src/compat/is_vtt_cue.ts +1 -2
  463. package/src/compat/on_height_width_change.ts +1 -2
  464. package/src/compat/patch_webkit_source_buffer.ts +48 -29
  465. package/src/compat/remove_cue.ts +2 -2
  466. package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +21 -26
  467. package/src/core/cmcd/cmcd_data_builder.ts +1 -1
  468. package/src/core/fetchers/README.md +13 -12
  469. package/src/core/fetchers/index.ts +5 -8
  470. package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +17 -23
  471. package/src/core/fetchers/segment/index.ts +6 -5
  472. package/src/core/{stream/representation/utils/downloading_queue.ts → fetchers/segment/segment_queue.ts} +204 -166
  473. package/src/core/fetchers/segment/{segment_fetcher_creator.ts → segment_queue_creator.ts} +31 -14
  474. package/src/core/fetchers/segment/task_prioritizer.ts +10 -2
  475. package/src/core/fetchers/utils/schedule_request.ts +1 -1
  476. package/src/core/main/common/content_time_boundaries_observer.ts +4 -4
  477. package/src/core/main/worker/content_preparer.ts +5 -5
  478. package/src/core/main/worker/send_message.ts +1 -1
  479. package/src/core/main/worker/worker_main.ts +3 -2
  480. package/src/core/segment_sinks/implementations/text/text_segment_buffer.ts +1 -5
  481. package/src/core/segment_sinks/inventory/segment_inventory.ts +1 -2
  482. package/src/core/segment_sinks/segment_buffers_store.ts +3 -2
  483. package/src/core/stream/adaptation/adaptation_stream.ts +3 -3
  484. package/src/core/stream/adaptation/types.ts +2 -2
  485. package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +1 -2
  486. package/src/core/stream/orchestrator/stream_orchestrator.ts +4 -4
  487. package/src/core/stream/period/period_stream.ts +2 -2
  488. package/src/core/stream/period/types.ts +2 -2
  489. package/src/core/stream/representation/representation_stream.ts +59 -56
  490. package/src/core/stream/representation/types.ts +3 -4
  491. package/src/core/stream/representation/utils/get_needed_segments.ts +1 -2
  492. package/src/core/types.ts +2 -4
  493. package/src/default_config.ts +0 -8
  494. package/src/errors/__tests__/format_error.test.ts +18 -18
  495. package/src/experimental/features/__tests__/multi_thread.test.ts +5 -5
  496. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +11 -11
  497. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +18 -26
  498. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +13 -21
  499. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +24 -20
  500. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +28 -30
  501. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +32 -38
  502. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +64 -51
  503. package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -17
  504. package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -4
  505. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
  506. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +16 -14
  507. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
  508. package/src/features/__tests__/add_features.test.ts +12 -11
  509. package/src/features/add_features.ts +1 -2
  510. package/src/features/list/__tests__/dash_wasm.test.ts +4 -4
  511. package/src/main_thread/api/__tests__/option_utils.test.ts +114 -70
  512. package/src/main_thread/api/__tests__/public_api.test.ts +85 -48
  513. package/src/main_thread/api/option_utils.ts +2 -6
  514. package/src/main_thread/api/public_api.ts +24 -18
  515. package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +12 -18
  516. package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +128 -101
  517. package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +26 -33
  518. package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +46 -48
  519. package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +33 -34
  520. package/src/main_thread/decrypt/__tests__/__global__/utils.ts +13 -17
  521. package/src/main_thread/decrypt/session_events_listener.ts +1 -1
  522. package/src/main_thread/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -5
  523. package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +14 -17
  524. package/src/main_thread/decrypt/utils/persistent_sessions_store.ts +2 -1
  525. package/src/main_thread/init/media_source_content_initializer.ts +7 -7
  526. package/src/main_thread/init/multi_thread_content_initializer.ts +7 -12
  527. package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +11 -16
  528. package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +48 -18
  529. package/src/main_thread/text_displayer/html/__tests__/text_track_cues_store.test.ts +32 -17
  530. package/src/main_thread/text_displayer/html/html_text_displayer.ts +1 -5
  531. package/src/main_thread/text_displayer/native/native_text_displayer.ts +3 -7
  532. package/src/main_thread/tracks_store/__tests__/media_element_tracks_store.test.ts +33 -28
  533. package/src/main_thread/tracks_store/track_dispatcher.ts +1 -1
  534. package/src/main_thread/types.ts +0 -1
  535. package/src/manifest/classes/__tests__/adaptation.test.ts +167 -62
  536. package/src/manifest/classes/__tests__/manifest.test.ts +130 -74
  537. package/src/manifest/classes/__tests__/period.test.ts +293 -211
  538. package/src/manifest/classes/__tests__/update_period_in_place.test.ts +0 -2
  539. package/src/manifest/classes/__tests__/update_periods.test.ts +57 -57
  540. package/src/manifest/classes/adaptation.ts +13 -13
  541. package/src/manifest/classes/manifest.ts +0 -6
  542. package/src/manifest/classes/representation.ts +20 -12
  543. package/src/manifest/utils.ts +1 -2
  544. package/src/mse/main_media_source_interface.ts +1 -1
  545. package/src/mse/types.ts +1 -1
  546. package/src/multithread_types.ts +2 -2
  547. package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +5 -10
  548. package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +38 -30
  549. package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -3
  550. package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +12 -6
  551. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.ts +14 -7
  552. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.ts +8 -4
  553. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Period.ts +10 -5
  554. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.ts +10 -5
  555. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
  556. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
  557. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
  558. package/src/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.ts +14 -7
  559. package/src/parsers/manifest/dash/native-parser/node_parsers/EventStream.ts +2 -1
  560. package/src/parsers/manifest/dash/native-parser/node_parsers/MPD.ts +8 -4
  561. package/src/parsers/manifest/dash/native-parser/node_parsers/Period.ts +10 -5
  562. package/src/parsers/manifest/dash/native-parser/node_parsers/Representation.ts +10 -5
  563. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
  564. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
  565. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentTimeline.test.ts +9 -14
  566. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
  567. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -2
  568. package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +2 -1
  569. package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +2 -1
  570. package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +4 -2
  571. package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +10 -5
  572. package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +2 -1
  573. package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +2 -1
  574. package/src/parsers/manifest/local/representation_index.ts +1 -2
  575. package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +2 -3
  576. package/src/parsers/manifest/smooth/create_parser.ts +2 -1
  577. package/src/parsers/manifest/smooth/shared_smooth_segment_timeline.ts +2 -2
  578. package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +3 -8
  579. package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +2 -2
  580. package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +2 -2
  581. package/src/parsers/texttracks/srt/html.ts +2 -2
  582. package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +3 -7
  583. package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +4 -4
  584. package/src/parsers/texttracks/ttml/html/create_element.ts +1 -1
  585. package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +3 -3
  586. package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +1 -2
  587. package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +1 -2
  588. package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +11 -11
  589. package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +5 -18
  590. package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +23 -28
  591. package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +9 -14
  592. package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +11 -11
  593. package/src/parsers/texttracks/webvtt/html/to_html.ts +9 -3
  594. package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +2 -2
  595. package/src/public_types.ts +7 -8
  596. package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
  597. package/src/transports/smooth/extract_timings_infos.ts +3 -3
  598. package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +30 -28
  599. package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +38 -44
  600. package/src/utils/__tests__/array_find.test.ts +12 -12
  601. package/src/utils/__tests__/array_find_index.test.ts +13 -12
  602. package/src/utils/__tests__/array_includes.test.ts +7 -7
  603. package/src/utils/__tests__/assert.test.ts +19 -25
  604. package/src/utils/__tests__/base64.test.ts +18 -13
  605. package/src/utils/__tests__/event_emitter.test.ts +225 -50
  606. package/src/utils/__tests__/flat_map.test.ts +2 -6
  607. package/src/utils/__tests__/starts_with.test.ts +7 -8
  608. package/src/utils/array_find.ts +3 -7
  609. package/src/utils/array_find_index.ts +3 -7
  610. package/src/utils/array_includes.ts +1 -3
  611. package/src/utils/assert.ts +0 -2
  612. package/src/utils/base64.ts +3 -2
  613. package/src/utils/event_emitter.ts +1 -1
  614. package/src/utils/flat_map.ts +1 -2
  615. package/src/utils/id_generator.ts +0 -2
  616. package/src/utils/is_worker.ts +1 -1
  617. package/src/utils/logger.ts +1 -1
  618. package/src/utils/monotonic_timestamp.ts +2 -2
  619. package/src/utils/noop.ts +1 -2
  620. package/src/utils/object_assign.ts +1 -2
  621. package/src/utils/object_values.ts +1 -2
  622. package/src/utils/reference.ts +1 -1
  623. package/src/utils/request/xhr.ts +1 -1
  624. package/.vscode/settings.json +0 -7
  625. package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
  626. package/dist/commonjs/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
  627. package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
  628. package/dist/es2017/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
package/src/core/types.ts CHANGED
@@ -5,7 +5,7 @@ import type {
5
5
  } from "./adaptive";
6
6
  import type {
7
7
  IManifestFetcherSettings,
8
- ISegmentFetcherCreatorBackoffOptions,
8
+ ISegmentQueueCreatorBackoffOptions,
9
9
  } from "./fetchers";
10
10
  import type {
11
11
  IBufferedChunk,
@@ -33,16 +33,14 @@ export type {
33
33
  IAdaptiveRepresentationSelectorArguments,
34
34
  IABRThrottlers,
35
35
  IResolutionInfo,
36
-
37
36
  // Fetchers Metadata
38
37
  IManifestFetcherSettings,
39
- ISegmentFetcherCreatorBackoffOptions,
38
+ ISegmentQueueCreatorBackoffOptions,
40
39
 
41
40
  // Media Sinks Metadata
42
41
  IBufferType,
43
42
  IBufferedChunk,
44
43
  ITextDisplayerInterface,
45
-
46
44
  // Stream Metadata
47
45
  IAdaptationChoice,
48
46
  IInbandEvent,
@@ -137,7 +137,6 @@ const DEFAULT_CONFIG = {
137
137
  */
138
138
  DEFAULT_MAX_VIDEO_BUFFER_SIZE: Infinity,
139
139
 
140
- /* eslint-disable @typescript-eslint/consistent-type-assertions */
141
140
  /**
142
141
  * Maximum possible buffer ahead for each type of buffer, to avoid too much
143
142
  * memory usage when playing for a long time.
@@ -147,9 +146,7 @@ const DEFAULT_CONFIG = {
147
146
  MAXIMUM_MAX_BUFFER_AHEAD: {
148
147
  text: 5 * 60 * 60,
149
148
  } as Partial<Record<"audio" | "video" | "text", number>>,
150
- /* eslint-enable @typescript-eslint/consistent-type-assertions */
151
149
 
152
- /* eslint-disable @typescript-eslint/consistent-type-assertions */
153
150
  /**
154
151
  * Minimum possible buffer ahead for each type of buffer, to avoid Garbage
155
152
  * Collecting too much data when it would have adverse effects.
@@ -164,9 +161,7 @@ const DEFAULT_CONFIG = {
164
161
  // same text track.
165
162
  text: 2 * 60,
166
163
  } as Partial<Record<"audio" | "video" | "image" | "text", number>>,
167
- /* eslint-enable @typescript-eslint/consistent-type-assertions */
168
164
 
169
- /* eslint-disable @typescript-eslint/consistent-type-assertions */
170
165
  /**
171
166
  * Maximum possible buffer behind for each type of buffer, to avoid too much
172
167
  * memory usage when playing for a long time.
@@ -176,7 +171,6 @@ const DEFAULT_CONFIG = {
176
171
  MAXIMUM_MAX_BUFFER_BEHIND: {
177
172
  text: 5 * 60 * 60,
178
173
  } as Partial<Record<"audio" | "video" | "text", number>>,
179
- /* eslint-enable @typescript-eslint/consistent-type-assertions */
180
174
 
181
175
  /**
182
176
  * Default bitrate ceils initially set as the first content begins.
@@ -893,7 +887,6 @@ const DEFAULT_CONFIG = {
893
887
  * or "playready" as a keySystem.
894
888
  * @type {Object}
895
889
  */
896
- /* eslint-disable @typescript-eslint/consistent-type-assertions */
897
890
  EME_KEY_SYSTEMS: {
898
891
  clearkey: ["webkit-org.w3.clearkey", "org.w3.clearkey"],
899
892
  widevine: ["com.widevine.alpha"],
@@ -905,7 +898,6 @@ const DEFAULT_CONFIG = {
905
898
  ],
906
899
  fairplay: ["com.apple.fps.1_0"],
907
900
  } as Partial<Record<string, string[]>>,
908
- /* eslint-enable @typescript-eslint/consistent-type-assertions */
909
901
 
910
902
  /**
911
903
  * The Manifest parsing logic has a notion of "unsafeMode" which allows to
@@ -1,10 +1,5 @@
1
1
  import { describe, beforeEach, it, expect, vi } from "vitest";
2
-
3
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
- /* eslint-disable @typescript-eslint/no-unsafe-call */
5
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
6
- /* eslint-disable @typescript-eslint/no-unsafe-return */
7
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import type IFormatError from "../format_error";
8
3
 
9
4
  describe("errors - formatError", () => {
10
5
  beforeEach(() => {
@@ -15,40 +10,45 @@ describe("errors - formatError", () => {
15
10
  vi.doMock("../is_known_error", () => ({
16
11
  default: () => true,
17
12
  }));
18
- const formatError = ((await vi.importActual("../format_error")) as any).default;
13
+ const formatError = (await vi.importActual("../format_error"))
14
+ .default as typeof IFormatError;
19
15
  const error1 = new Error("Aaaaaa");
20
- expect(formatError(error1, { defaultCode: "toto", defaultReason: "a" })).toBe(error1);
16
+ expect(formatError(error1, { defaultCode: "NONE", defaultReason: "a" })).toBe(error1);
21
17
  });
22
18
 
23
19
  it("should stringify error if it is an Error but not a Custom Error", async () => {
24
20
  vi.doMock("../is_known_error", () => ({
25
21
  default: () => false,
26
22
  }));
27
- const OtherError = ((await vi.importActual("../other_error")) as any).default;
28
- const formatError = ((await vi.importActual("../format_error")) as any).default;
23
+ const OtherError = (await vi.importActual("../other_error"))
24
+ .default as typeof IFormatError;
25
+ const formatError = (await vi.importActual("../format_error"))
26
+ .default as typeof IFormatError;
29
27
  const error1 = new Error("Abcdef");
30
28
  const formattedError = formatError(error1, {
31
- defaultCode: "toto",
29
+ defaultCode: "NONE",
32
30
  defaultReason: "a",
33
31
  });
34
32
  expect(formattedError).toBeInstanceOf(OtherError);
35
- expect(formattedError.message).toBe("toto: Error: Abcdef");
36
- expect(formattedError.code).toBe("toto");
33
+ expect(formattedError.message).toBe("NONE: Error: Abcdef");
34
+ expect(formattedError.code).toBe("NONE");
37
35
  });
38
36
 
39
37
  it("should stringify error if it is an Error but not a Custom Error", async () => {
40
38
  vi.doMock("../is_known_error", () => ({
41
39
  default: () => false,
42
40
  }));
43
- const OtherError = ((await vi.importActual("../other_error")) as any).default;
44
- const formatError = ((await vi.importActual("../format_error")) as any).default;
41
+ const OtherError = (await vi.importActual("../other_error"))
42
+ .default as typeof IFormatError;
43
+ const formatError = (await vi.importActual("../format_error"))
44
+ .default as typeof IFormatError;
45
45
  const error1 = {};
46
46
  const formattedError = formatError(error1, {
47
- defaultCode: "toto",
47
+ defaultCode: "NONE",
48
48
  defaultReason: "a",
49
49
  });
50
50
  expect(formattedError).toBeInstanceOf(OtherError);
51
- expect(formattedError.message).toBe("toto: a");
52
- expect(formattedError.code).toBe("toto");
51
+ expect(formattedError.message).toBe("NONE: a");
52
+ expect(formattedError.code).toBe("NONE");
53
53
  });
54
54
  });
@@ -1,18 +1,18 @@
1
1
  import { describe, it, expect } from "vitest";
2
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
4
-
2
+ import type { IFeaturesObject } from "../../../features/types";
5
3
  import MultiThreadContentInitializer from "../../../main_thread/init/multi_thread_content_initializer";
6
4
  import addMultiThreadFeature from "../multi_thread";
7
5
 
8
6
  describe("Features list - EME", () => {
9
7
  it("should add the ContentDecryptor in the current features", () => {
10
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
- const featureObject: any = {};
9
+ const featureObject: IFeaturesObject = {} as IFeaturesObject;
12
10
  addMultiThreadFeature(featureObject);
13
11
  expect(featureObject).toEqual({
14
12
  multithread: { init: MultiThreadContentInitializer },
15
13
  });
16
- expect(featureObject.multithread.init).toBe(MultiThreadContentInitializer);
14
+ expect(featureObject.multithread).not.toBe(null);
15
+ expect(featureObject.multithread).not.toBe(undefined);
16
+ expect(featureObject.multithread?.init).toBe(MultiThreadContentInitializer);
17
17
  });
18
18
  });
@@ -1,10 +1,6 @@
1
1
  import { describe, it, expect, vi } from "vitest";
2
-
3
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
- /* eslint-disable @typescript-eslint/no-unsafe-call */
5
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
6
- /* eslint-disable @typescript-eslint/no-unsafe-return */
7
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import type IGetProbedConfiguration from "../capabilities";
3
+ import type { ICapabilitiesTypes } from "../capabilities";
8
4
 
9
5
  describe("MediaCapabilitiesProber - getProbedConfiguration", () => {
10
6
  it("should return result from filtered configuration", async () => {
@@ -15,10 +11,14 @@ describe("MediaCapabilitiesProber - getProbedConfiguration", () => {
15
11
  extend: mockExtend,
16
12
  filterConfigurationWithCapabilities: mockFilterConfigurationWithCapabilities,
17
13
  }));
18
- const getProbedConfiguration = ((await vi.importActual("../capabilities")) as any)
19
- .default;
20
- expect(getProbedConfiguration({}, ["Athos", "Portos", "Aramis"])).toEqual(
21
- expectedResult,
22
- );
14
+ const getProbedConfiguration = (await vi.importActual("../capabilities"))
15
+ .default as typeof IGetProbedConfiguration;
16
+ expect(
17
+ getProbedConfiguration({}, [
18
+ "Athos",
19
+ "Portos",
20
+ "Aramis",
21
+ ] as unknown as ICapabilitiesTypes[]),
22
+ ).toEqual(expectedResult);
23
23
  });
24
24
  });
@@ -1,13 +1,7 @@
1
1
  import { describe, afterEach, it, expect, vi } from "vitest";
2
+ import type IProbeDRMInfos from "../../probers/DRMInfos";
2
3
  import { ProberStatus } from "../../types";
3
4
 
4
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
5
- /* eslint-disable @typescript-eslint/no-unsafe-call */
6
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
7
- /* eslint-disable @typescript-eslint/no-unsafe-return */
8
- /* eslint-disable @typescript-eslint/no-explicit-any */
9
- /* eslint-disable no-restricted-properties */
10
-
11
5
  describe("MediaCapabilitiesProber probers - DRMInfos", () => {
12
6
  afterEach(() => {
13
7
  vi.resetModules();
@@ -15,28 +9,26 @@ describe("MediaCapabilitiesProber probers - DRMInfos", () => {
15
9
 
16
10
  it("should throw if no keySystem provided", async () => {
17
11
  const configuration = {};
18
- const probeDRMInfos = ((await vi.importActual("../../probers/DRMInfos")) as any)
19
- .default;
20
- /* eslint-disable @typescript-eslint/no-floating-promises */
12
+ const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
13
+ .default as typeof IProbeDRMInfos;
14
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
21
15
  expect(probeDRMInfos(configuration)).rejects.toEqual(
22
16
  "MediaCapabilitiesProber >>> API_CALL: " +
23
17
  "Missing a type argument to request a media key system access.",
24
18
  );
25
- /* eslint-enable @typescript-eslint/no-floating-promises */
26
19
  });
27
20
 
28
21
  it("should throw if no type of keySystem provided", async () => {
29
22
  const configuration = {
30
23
  keySystem: {},
31
24
  };
32
- const probeDRMInfos = ((await vi.importActual("../../probers/DRMInfos")) as any)
33
- .default;
34
- /* eslint-disable @typescript-eslint/no-floating-promises */
25
+ const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
26
+ .default as typeof IProbeDRMInfos;
27
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
35
28
  expect(probeDRMInfos(configuration)).rejects.toEqual(
36
29
  "MediaCapabilitiesProber >>> API_CALL: " +
37
30
  "Missing a type argument to request a media key system access.",
38
31
  );
39
- /* eslint-enable @typescript-eslint/no-floating-promises */
40
32
  });
41
33
 
42
34
  it("should resolve with `NotSupported` if no requestMediaKeySystemAccess", async () => {
@@ -48,13 +40,13 @@ describe("MediaCapabilitiesProber probers - DRMInfos", () => {
48
40
  vi.doMock("../../../../../compat/eme", () => ({
49
41
  default: {},
50
42
  }));
51
- const probeDRMInfos = ((await vi.importActual("../../probers/DRMInfos")) as any)
52
- .default;
53
- /* eslint-disable @typescript-eslint/no-floating-promises */
54
- expect(probeDRMInfos(configuration)).resolves.toEqual(
55
- [ProberStatus.NotSupported, { configuration: {}, type: "clearkick" }],
56
- /* eslint-enable @typescript-eslint/no-floating-promises */
57
- );
43
+ const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
44
+ .default as typeof IProbeDRMInfos;
45
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
46
+ expect(probeDRMInfos(configuration)).resolves.toEqual([
47
+ ProberStatus.NotSupported,
48
+ { configuration: {}, type: "clearkick" },
49
+ ]);
58
50
  });
59
51
 
60
52
  it("should resolve with `Supported` if config is supported", async () => {
@@ -71,8 +63,8 @@ describe("MediaCapabilitiesProber probers - DRMInfos", () => {
71
63
  vi.doMock("../../../../../compat/eme", () => ({
72
64
  default: { requestMediaKeySystemAccess: mockRequestMediaKeySystemAccess },
73
65
  }));
74
- const probeDRMInfos = ((await vi.importActual("../../probers/DRMInfos")) as any)
75
- .default;
66
+ const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
67
+ .default as typeof IProbeDRMInfos;
76
68
  await probeDRMInfos(configuration)
77
69
  .then((res: unknown) => {
78
70
  expect(res).toEqual([
@@ -99,8 +91,8 @@ describe("MediaCapabilitiesProber probers - DRMInfos", () => {
99
91
  default: { requestMediaKeySystemAccess: mockRequestMediaKeySystemAccess },
100
92
  }));
101
93
 
102
- const probeDRMInfos = ((await vi.importActual("../../probers/DRMInfos")) as any)
103
- .default;
94
+ const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
95
+ .default as typeof IProbeDRMInfos;
104
96
  await probeDRMInfos(configuration)
105
97
  .then((res: unknown) => {
106
98
  expect(res).toEqual([
@@ -1,13 +1,7 @@
1
1
  import { describe, afterEach, it, expect, vi } from "vitest";
2
+ import type IProbeHDCPPolicy from "../../probers/HDCPPolicy";
2
3
  import { ProberStatus } from "../../types";
3
4
 
4
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
5
- /* eslint-disable @typescript-eslint/no-unsafe-call */
6
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
7
- /* eslint-disable @typescript-eslint/no-unsafe-return */
8
- /* eslint-disable @typescript-eslint/no-explicit-any */
9
- /* eslint-disable no-restricted-properties */
10
-
11
5
  describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
12
6
  afterEach(() => {
13
7
  vi.resetModules();
@@ -17,13 +11,12 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
17
11
  vi.doMock("../../../../../compat/eme", () => ({
18
12
  default: vi.fn(),
19
13
  }));
20
- const probeHDCPPolicy = ((await vi.importActual("../../probers/HDCPPolicy")) as any)
21
- .default;
22
- /* eslint-disable @typescript-eslint/no-floating-promises */
14
+ const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
15
+ .default as typeof IProbeHDCPPolicy;
16
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
23
17
  expect(probeHDCPPolicy({})).rejects.toEqual(
24
18
  "MediaCapabilitiesProber >>> API_CALL: API not available",
25
19
  );
26
- /* eslint-enable @typescript-eslint/no-floating-promises */
27
20
  });
28
21
 
29
22
  it("should throw if no hdcp attribute in config", async () => {
@@ -37,14 +30,13 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
37
30
  requestMediaKeySystemAccess: mockRequestMediaKeySystemAccess,
38
31
  },
39
32
  }));
40
- const probeHDCPPolicy = ((await vi.importActual("../../probers/HDCPPolicy")) as any)
41
- .default;
42
- /* eslint-disable @typescript-eslint/no-floating-promises */
33
+ const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
34
+ .default as typeof IProbeHDCPPolicy;
35
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
43
36
  expect(probeHDCPPolicy({})).rejects.toEqual(
44
37
  "MediaCapabilitiesProber >>> API_CALL: " +
45
38
  "Missing policy argument for calling getStatusForPolicy.",
46
39
  );
47
- /* eslint-enable @typescript-eslint/no-floating-promises */
48
40
  });
49
41
 
50
42
  it("should resolve with `Unknown` if no getStatusForPolicy API", async () => {
@@ -62,8 +54,8 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
62
54
  },
63
55
  }));
64
56
 
65
- const probeHDCPPolicy = ((await vi.importActual("../../probers/HDCPPolicy")) as any)
66
- .default;
57
+ const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
58
+ .default as typeof IProbeHDCPPolicy;
67
59
 
68
60
  await probeHDCPPolicy({ hdcp: "1.1" }).then(([res]: [unknown]) => {
69
61
  expect(res).toEqual(ProberStatus.Unknown);
@@ -89,8 +81,8 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
89
81
  },
90
82
  }));
91
83
 
92
- const probeHDCPPolicy = ((await vi.importActual("../../probers/HDCPPolicy")) as any)
93
- .default;
84
+ const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
85
+ .default as typeof IProbeHDCPPolicy;
94
86
 
95
87
  await probeHDCPPolicy({ hdcp: "1.1" }).then(([res]: [unknown]) => {
96
88
  expect(res).toEqual(ProberStatus.Supported);
@@ -116,8 +108,8 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
116
108
  },
117
109
  }));
118
110
 
119
- const probeHDCPPolicy = ((await vi.importActual("../../probers/HDCPPolicy")) as any)
120
- .default;
111
+ const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
112
+ .default as typeof IProbeHDCPPolicy;
121
113
  await probeHDCPPolicy({ hdcp: "1.1" }).then(([res]: [unknown]) => {
122
114
  expect(res).toEqual(ProberStatus.NotSupported);
123
115
  expect(mockCreateMediaKeys).toHaveBeenCalledTimes(1);
@@ -1,17 +1,11 @@
1
1
  import { describe, beforeEach, afterEach, it, expect, vi } from "vitest";
2
+ import isNullOrUndefined from "../../../../../utils/is_null_or_undefined";
2
3
  import probeDecodingInfos from "../../probers/decodingInfo";
3
4
  import type { IMediaConfiguration } from "../../types";
4
5
  import { ProberStatus } from "../../types";
5
6
 
6
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
7
- /* eslint-disable @typescript-eslint/no-unsafe-call */
8
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
9
- /* eslint-disable @typescript-eslint/no-unsafe-return */
10
- /* eslint-disable @typescript-eslint/strict-boolean-expressions */
11
- /* eslint-disable @typescript-eslint/no-explicit-any */
12
-
13
- const origDecodingInfo = (navigator as any).mediaCapabilities;
14
- const origMediaCapabilities = (navigator as any).mediaCapabilities;
7
+ const origDecodingInfo = navigator.mediaCapabilities;
8
+ const origMediaCapabilities = navigator.mediaCapabilities;
15
9
 
16
10
  /**
17
11
  * Stub decodingInfo API to resolve.
@@ -33,7 +27,9 @@ function stubDecodingInfo(isSupported: boolean, mustReject?: boolean) {
33
27
  decodingInfo: decodingInfoStub,
34
28
  };
35
29
 
36
- (navigator as any).mediaCapabilities = mockMediaCapabilities;
30
+ // @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
31
+ // now, we're going through JSDom through so that's OK.
32
+ navigator.mediaCapabilities = mockMediaCapabilities;
37
33
  return decodingInfoStub;
38
34
  }
39
35
 
@@ -41,7 +37,9 @@ function stubDecodingInfo(isSupported: boolean, mustReject?: boolean) {
41
37
  * Reset decodingInfo to native implementation.
42
38
  */
43
39
  function resetDecodingInfos(): void {
44
- (navigator as any).mediaCapabilities = origDecodingInfo;
40
+ // @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
41
+ // now, we're going through JSDom through so that's OK.
42
+ navigator.mediaCapabilities = origDecodingInfo;
45
43
  }
46
44
 
47
45
  describe("MediaCapabilitiesProber probers - decodingInfo", () => {
@@ -49,7 +47,9 @@ describe("MediaCapabilitiesProber probers - decodingInfo", () => {
49
47
  vi.resetModules();
50
48
  });
51
49
  afterEach(() => {
52
- (navigator as any).mediaCapabilities = origMediaCapabilities;
50
+ // @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
51
+ // now, we're going through JSDom through so that's OK.
52
+ navigator.mediaCapabilities = origMediaCapabilities;
53
53
  });
54
54
 
55
55
  it("should throw if no video and audio config", () => {
@@ -163,25 +163,29 @@ describe("MediaCapabilitiesProber probers - decodingInfo", () => {
163
163
  });
164
164
 
165
165
  it("should throw if API mediaCapabilities not available", () => {
166
- delete (navigator as any).mediaCapabilities;
167
- /* eslint-disable @typescript-eslint/no-floating-promises */
166
+ // @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
167
+ // now, we're going through JSDom through so that's OK.
168
+ delete navigator.mediaCapabilities;
169
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
168
170
  expect(probeDecodingInfos({})).rejects.toThrowError(
169
171
  "MediaCapabilitiesProber >>> API_CALL: MediaCapabilities API not available",
170
172
  );
171
- /* eslint-enable @typescript-eslint/no-floating-promises */
172
173
  });
173
174
 
174
175
  it("should throw if API decodingInfo not available", () => {
175
- if ((navigator as any).mediaCapabilities) {
176
- delete (navigator as any).mediaCapabilities.decodingInfo;
176
+ if (!isNullOrUndefined(navigator.mediaCapabilities)) {
177
+ // @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
178
+ // now, we're going through JSDom through so that's OK.
179
+ delete navigator.mediaCapabilities.decodingInfo;
177
180
  } else {
178
- (navigator as any).mediaCapabilities = {};
181
+ // @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
182
+ // now, we're going through JSDom through so that's OK.
183
+ navigator.mediaCapabilities = {};
179
184
  }
180
- /* eslint-disable @typescript-eslint/no-floating-promises */
185
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
181
186
  expect(probeDecodingInfos({})).rejects.toThrowError(
182
187
  "MediaCapabilitiesProber >>> API_CALL: Decoding Info not available",
183
188
  );
184
- /* eslint-enable @typescript-eslint/no-floating-promises */
185
189
  });
186
190
 
187
191
  it("should resolve with `Supported` if decodingInfo supports (video only)", () => {
@@ -1,10 +1,8 @@
1
1
  import { describe, beforeEach, it, expect, vi } from "vitest";
2
-
3
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
- /* eslint-disable @typescript-eslint/no-unsafe-call */
5
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
6
- /* eslint-disable @typescript-eslint/no-unsafe-return */
7
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import type {
3
+ findDefaultVideoCodec as IFindDefaultVideoCodec,
4
+ findDefaultAudioCodec as IFindDefaultAudioCodec,
5
+ } from "../../probers/defaultCodecsFinder";
8
6
 
9
7
  describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
10
8
  beforeEach(() => {
@@ -24,9 +22,9 @@ describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
24
22
  isTypeSupported: mockIsTypeSupported,
25
23
  },
26
24
  }));
27
- const { findDefaultVideoCodec } = (await vi.importActual(
28
- "../../probers/defaultCodecsFinder",
29
- )) as any;
25
+ const findDefaultVideoCodec = (
26
+ await vi.importActual("../../probers/defaultCodecsFinder")
27
+ ).findDefaultVideoCodec as typeof IFindDefaultVideoCodec;
30
28
  expect(findDefaultVideoCodec()).toBe('video/mp4;codecs="avc1.4d401e"');
31
29
  expect(mockIsTypeSupported).toHaveBeenCalledTimes(1);
32
30
  });
@@ -38,9 +36,9 @@ describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
38
36
  isTypeSupported: mockIsTypeSupported,
39
37
  },
40
38
  }));
41
- const { findDefaultVideoCodec } = (await vi.importActual(
42
- "../../probers/defaultCodecsFinder",
43
- )) as any;
39
+ const findDefaultVideoCodec = (
40
+ await vi.importActual("../../probers/defaultCodecsFinder")
41
+ ).findDefaultVideoCodec as typeof IFindDefaultVideoCodec;
44
42
  expect(() => {
45
43
  findDefaultVideoCodec();
46
44
  }).toThrowError("No default video codec found.");
@@ -51,9 +49,9 @@ describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
51
49
  vi.doMock("../../../../../compat/browser_compatibility_types", () => ({
52
50
  MediaSource_: null,
53
51
  }));
54
- const { findDefaultVideoCodec } = (await vi.importActual(
55
- "../../probers/defaultCodecsFinder",
56
- )) as any;
52
+ const findDefaultVideoCodec = (
53
+ await vi.importActual("../../probers/defaultCodecsFinder")
54
+ ).findDefaultVideoCodec as typeof IFindDefaultVideoCodec;
57
55
  expect(() => {
58
56
  findDefaultVideoCodec();
59
57
  }).toThrowError("Cannot check video codec support: No API available.");
@@ -63,9 +61,9 @@ describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
63
61
  vi.doMock("../../../../../compat/browser_compatibility_types", () => ({
64
62
  MediaSource_: {},
65
63
  }));
66
- const { findDefaultVideoCodec } = (await vi.importActual(
67
- "../../probers/defaultCodecsFinder",
68
- )) as any;
64
+ const findDefaultVideoCodec = (
65
+ await vi.importActual("../../probers/defaultCodecsFinder")
66
+ ).findDefaultVideoCodec as typeof IFindDefaultVideoCodec;
69
67
  expect(() => {
70
68
  findDefaultVideoCodec();
71
69
  }).toThrowError("Cannot check video codec support: No API available.");
@@ -88,9 +86,9 @@ describe("MediaCapabilitiesProber probers - findDefaultAudioCodec", () => {
88
86
  isTypeSupported: mockIsTypeSupported,
89
87
  },
90
88
  }));
91
- const { findDefaultAudioCodec } = (await vi.importActual(
92
- "../../probers/defaultCodecsFinder",
93
- )) as any;
89
+ const findDefaultAudioCodec = (
90
+ await vi.importActual("../../probers/defaultCodecsFinder")
91
+ ).findDefaultAudioCodec as typeof IFindDefaultAudioCodec;
94
92
  expect(findDefaultAudioCodec()).toBe('audio/mp4;codecs="mp4a.40.2"');
95
93
  expect(mockIsTypeSupported).toHaveBeenCalledTimes(1);
96
94
  });
@@ -102,9 +100,9 @@ describe("MediaCapabilitiesProber probers - findDefaultAudioCodec", () => {
102
100
  isTypeSupported: mockIsTypeSupported,
103
101
  },
104
102
  }));
105
- const { findDefaultAudioCodec } = (await vi.importActual(
106
- "../../probers/defaultCodecsFinder",
107
- )) as any;
103
+ const findDefaultAudioCodec = (
104
+ await vi.importActual("../../probers/defaultCodecsFinder")
105
+ ).findDefaultAudioCodec as typeof IFindDefaultAudioCodec;
108
106
  expect(() => {
109
107
  findDefaultAudioCodec();
110
108
  }).toThrowError("No default audio codec found.");
@@ -115,9 +113,9 @@ describe("MediaCapabilitiesProber probers - findDefaultAudioCodec", () => {
115
113
  vi.doMock("../../../../../compat/browser_compatibility_types", () => ({
116
114
  MediaSource_: null,
117
115
  }));
118
- const { findDefaultAudioCodec } = (await vi.importActual(
119
- "../../probers/defaultCodecsFinder",
120
- )) as any;
116
+ const findDefaultAudioCodec = (
117
+ await vi.importActual("../../probers/defaultCodecsFinder")
118
+ ).findDefaultAudioCodec as typeof IFindDefaultAudioCodec;
121
119
  expect(() => {
122
120
  findDefaultAudioCodec();
123
121
  }).toThrowError("Cannot check audio codec support: No API available.");
@@ -127,9 +125,9 @@ describe("MediaCapabilitiesProber probers - findDefaultAudioCodec", () => {
127
125
  vi.doMock("../../../../../compat/browser_compatibility_types", () => ({
128
126
  MediaSource_: {},
129
127
  }));
130
- const { findDefaultAudioCodec } = (await vi.importActual(
131
- "../../probers/defaultCodecsFinder",
132
- )) as any;
128
+ const findDefaultAudioCodec = (
129
+ await vi.importActual("../../probers/defaultCodecsFinder")
130
+ ).findDefaultAudioCodec as typeof IFindDefaultAudioCodec;
133
131
  expect(() => {
134
132
  findDefaultAudioCodec();
135
133
  }).toThrow("Cannot check audio codec support: No API available.");