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

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 (613) hide show
  1. package/CHANGELOG.md +5 -2
  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/browser_detection.d.ts +3 -1
  10. package/dist/commonjs/compat/browser_detection.d.ts.map +1 -1
  11. package/dist/commonjs/compat/browser_detection.js +7 -1
  12. package/dist/commonjs/compat/can_reuse_media_keys.d.ts +4 -0
  13. package/dist/commonjs/compat/can_reuse_media_keys.d.ts.map +1 -1
  14. package/dist/commonjs/compat/can_reuse_media_keys.js +5 -1
  15. package/dist/commonjs/compat/clear_element_src.js +1 -1
  16. package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
  17. package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
  18. package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
  19. package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
  20. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
  21. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
  22. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
  23. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
  24. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
  25. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
  26. package/dist/commonjs/compat/eme/eme-api-implementation.js +0 -2
  27. package/dist/commonjs/compat/event_listeners.d.ts.map +1 -1
  28. package/dist/commonjs/compat/event_listeners.js +2 -6
  29. package/dist/commonjs/compat/has_mse_in_worker.js +1 -1
  30. package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
  31. package/dist/commonjs/compat/is_codec_supported.js +0 -2
  32. package/dist/commonjs/compat/is_vtt_cue.d.ts.map +1 -1
  33. package/dist/commonjs/compat/is_vtt_cue.js +1 -2
  34. package/dist/commonjs/compat/on_height_width_change.d.ts.map +1 -1
  35. package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
  36. package/dist/commonjs/compat/patch_webkit_source_buffer.js +8 -18
  37. package/dist/commonjs/compat/remove_cue.js +2 -2
  38. package/dist/commonjs/core/fetchers/index.d.ts +4 -4
  39. package/dist/commonjs/core/fetchers/index.d.ts.map +1 -1
  40. package/dist/commonjs/core/fetchers/index.js +2 -2
  41. package/dist/commonjs/core/fetchers/segment/index.d.ts +6 -5
  42. package/dist/commonjs/core/fetchers/segment/index.d.ts.map +1 -1
  43. package/dist/commonjs/core/fetchers/segment/index.js +2 -2
  44. package/dist/{es2017/core/stream/representation/utils/downloading_queue.d.ts → commonjs/core/fetchers/segment/segment_queue.d.ts} +63 -80
  45. package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -0
  46. package/dist/commonjs/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +132 -111
  47. package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
  48. package/dist/commonjs/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
  49. package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +15 -9
  50. package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts +9 -0
  51. package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
  52. package/dist/commonjs/core/fetchers/segment/task_prioritizer.js +38 -8
  53. package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
  54. package/dist/commonjs/core/main/common/content_time_boundaries_observer.js +21 -10
  55. package/dist/commonjs/core/main/worker/content_preparer.d.ts +3 -3
  56. package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +1 -1
  57. package/dist/commonjs/core/main/worker/content_preparer.js +2 -2
  58. package/dist/commonjs/core/main/worker/send_message.js +1 -1
  59. package/dist/commonjs/core/main/worker/worker_main.js +6 -2
  60. package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
  61. package/dist/commonjs/core/segment_sinks/inventory/segment_inventory.js +39 -30
  62. package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
  63. package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +3 -2
  64. package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts +1 -1
  65. package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
  66. package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +3 -3
  67. package/dist/commonjs/core/stream/adaptation/types.d.ts +2 -2
  68. package/dist/commonjs/core/stream/adaptation/types.d.ts.map +1 -1
  69. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
  70. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +27 -6
  71. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
  72. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
  73. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
  74. package/dist/commonjs/core/stream/period/period_stream.d.ts +1 -1
  75. package/dist/commonjs/core/stream/period/period_stream.d.ts.map +1 -1
  76. package/dist/commonjs/core/stream/period/period_stream.js +2 -2
  77. package/dist/commonjs/core/stream/period/types.d.ts +2 -2
  78. package/dist/commonjs/core/stream/period/types.d.ts.map +1 -1
  79. package/dist/commonjs/core/stream/representation/representation_stream.d.ts +1 -1
  80. package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
  81. package/dist/commonjs/core/stream/representation/representation_stream.js +19 -28
  82. package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
  83. package/dist/commonjs/core/stream/representation/types.d.ts.map +1 -1
  84. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
  85. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +39 -18
  86. package/dist/commonjs/core/types.d.ts +2 -2
  87. package/dist/commonjs/core/types.d.ts.map +1 -1
  88. package/dist/commonjs/default_config.d.ts.map +1 -1
  89. package/dist/commonjs/default_config.js +0 -8
  90. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
  91. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
  92. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
  93. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
  94. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
  95. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
  96. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
  97. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
  98. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
  99. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
  100. package/dist/commonjs/features/add_features.d.ts.map +1 -1
  101. package/dist/commonjs/features/add_features.js +31 -10
  102. package/dist/commonjs/main_thread/api/option_utils.d.ts.map +1 -1
  103. package/dist/commonjs/main_thread/api/option_utils.js +2 -6
  104. package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
  105. package/dist/commonjs/main_thread/api/public_api.js +33 -27
  106. package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
  107. package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.js +4 -3
  108. package/dist/commonjs/main_thread/init/media_source_content_initializer.js +6 -6
  109. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  110. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +32 -37
  111. package/dist/commonjs/main_thread/text_displayer/html/html_text_displayer.js +1 -5
  112. package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +3 -7
  113. package/dist/commonjs/main_thread/tracks_store/track_dispatcher.js +1 -1
  114. package/dist/commonjs/main_thread/types.d.ts.map +1 -1
  115. package/dist/commonjs/manifest/classes/manifest.d.ts.map +1 -1
  116. package/dist/commonjs/manifest/classes/manifest.js +0 -6
  117. package/dist/commonjs/manifest/utils.d.ts.map +1 -1
  118. package/dist/commonjs/manifest/utils.js +72 -62
  119. package/dist/commonjs/mse/main_media_source_interface.js +1 -1
  120. package/dist/commonjs/multithread_types.d.ts +2 -2
  121. package/dist/commonjs/multithread_types.d.ts.map +1 -1
  122. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
  123. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
  124. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  125. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
  126. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
  127. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
  128. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
  129. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
  130. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
  131. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
  132. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  133. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
  134. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
  135. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
  136. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
  137. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
  138. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
  139. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
  140. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
  141. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
  142. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
  143. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
  144. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
  145. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
  146. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
  147. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
  148. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
  149. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
  150. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
  151. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
  152. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
  153. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
  154. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
  155. package/dist/commonjs/parsers/manifest/local/representation_index.d.ts.map +1 -1
  156. package/dist/commonjs/parsers/manifest/local/representation_index.js +29 -8
  157. package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
  158. package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +31 -10
  159. package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
  160. package/dist/commonjs/parsers/manifest/smooth/create_parser.js +2 -1
  161. package/dist/commonjs/parsers/manifest/smooth/shared_smooth_segment_timeline.js +26 -4
  162. package/dist/commonjs/parsers/manifest/utils/get_first_time_from_adaptation.js +29 -7
  163. package/dist/commonjs/parsers/manifest/utils/get_last_time_from_adaptation.js +29 -7
  164. package/dist/commonjs/parsers/texttracks/srt/html.js +28 -6
  165. package/dist/commonjs/parsers/texttracks/ttml/html/create_element.js +1 -1
  166. package/dist/commonjs/parsers/texttracks/ttml/html/parse_ttml_to_div.js +29 -7
  167. package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
  168. package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +26 -5
  169. package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
  170. package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.js +25 -4
  171. package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
  172. package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
  173. package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.js +9 -3
  174. package/dist/commonjs/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +30 -8
  175. package/dist/commonjs/public_types.d.ts +5 -7
  176. package/dist/commonjs/public_types.d.ts.map +1 -1
  177. package/dist/commonjs/transports/smooth/extract_timings_infos.js +30 -8
  178. package/dist/commonjs/utils/array_find.d.ts +1 -1
  179. package/dist/commonjs/utils/array_find.d.ts.map +1 -1
  180. package/dist/commonjs/utils/array_find.js +3 -1
  181. package/dist/commonjs/utils/array_find_index.d.ts +1 -1
  182. package/dist/commonjs/utils/array_find_index.d.ts.map +1 -1
  183. package/dist/commonjs/utils/array_find_index.js +3 -1
  184. package/dist/commonjs/utils/array_includes.d.ts.map +1 -1
  185. package/dist/commonjs/utils/array_includes.js +1 -3
  186. package/dist/commonjs/utils/assert.d.ts.map +1 -1
  187. package/dist/commonjs/utils/assert.js +0 -2
  188. package/dist/commonjs/utils/base64.d.ts +1 -1
  189. package/dist/commonjs/utils/base64.d.ts.map +1 -1
  190. package/dist/commonjs/utils/base64.js +3 -2
  191. package/dist/commonjs/utils/event_emitter.js +1 -1
  192. package/dist/commonjs/utils/flat_map.d.ts.map +1 -1
  193. package/dist/commonjs/utils/flat_map.js +1 -2
  194. package/dist/commonjs/utils/id_generator.d.ts.map +1 -1
  195. package/dist/commonjs/utils/id_generator.js +0 -1
  196. package/dist/commonjs/utils/logger.d.ts.map +1 -1
  197. package/dist/commonjs/utils/logger.js +7 -8
  198. package/dist/commonjs/utils/monotonic_timestamp.js +2 -2
  199. package/dist/commonjs/utils/noop.js +1 -2
  200. package/dist/commonjs/utils/object_assign.d.ts.map +1 -1
  201. package/dist/commonjs/utils/object_assign.js +27 -6
  202. package/dist/commonjs/utils/object_values.d.ts.map +1 -1
  203. package/dist/commonjs/utils/object_values.js +1 -1
  204. package/dist/commonjs/utils/reference.js +1 -1
  205. package/dist/commonjs/utils/request/xhr.js +1 -1
  206. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  207. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  208. package/dist/es2017/compat/add_class_name.d.ts.map +1 -1
  209. package/dist/es2017/compat/add_class_name.js +1 -2
  210. package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
  211. package/dist/es2017/compat/browser_compatibility_types.js +4 -1
  212. package/dist/es2017/compat/browser_detection.d.ts +3 -1
  213. package/dist/es2017/compat/browser_detection.d.ts.map +1 -1
  214. package/dist/es2017/compat/browser_detection.js +10 -1
  215. package/dist/es2017/compat/can_reuse_media_keys.d.ts +4 -0
  216. package/dist/es2017/compat/can_reuse_media_keys.d.ts.map +1 -1
  217. package/dist/es2017/compat/can_reuse_media_keys.js +6 -2
  218. package/dist/es2017/compat/clear_element_src.js +1 -1
  219. package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
  220. package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
  221. package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
  222. package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
  223. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
  224. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
  225. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
  226. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
  227. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
  228. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
  229. package/dist/es2017/compat/eme/eme-api-implementation.js +0 -2
  230. package/dist/es2017/compat/event_listeners.d.ts.map +1 -1
  231. package/dist/es2017/compat/event_listeners.js +2 -6
  232. package/dist/es2017/compat/has_mse_in_worker.js +1 -1
  233. package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
  234. package/dist/es2017/compat/is_codec_supported.js +0 -2
  235. package/dist/es2017/compat/is_vtt_cue.d.ts.map +1 -1
  236. package/dist/es2017/compat/is_vtt_cue.js +1 -2
  237. package/dist/es2017/compat/on_height_width_change.d.ts.map +1 -1
  238. package/dist/es2017/compat/patch_webkit_source_buffer.d.ts.map +1 -1
  239. package/dist/es2017/compat/patch_webkit_source_buffer.js +8 -18
  240. package/dist/es2017/compat/remove_cue.js +2 -2
  241. package/dist/es2017/core/fetchers/index.d.ts +4 -4
  242. package/dist/es2017/core/fetchers/index.d.ts.map +1 -1
  243. package/dist/es2017/core/fetchers/index.js +2 -2
  244. package/dist/es2017/core/fetchers/segment/index.d.ts +6 -5
  245. package/dist/es2017/core/fetchers/segment/index.d.ts.map +1 -1
  246. package/dist/es2017/core/fetchers/segment/index.js +2 -2
  247. package/dist/{commonjs/core/stream/representation/utils/downloading_queue.d.ts → es2017/core/fetchers/segment/segment_queue.d.ts} +63 -80
  248. package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -0
  249. package/dist/es2017/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +126 -105
  250. package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
  251. package/dist/es2017/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
  252. package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +12 -6
  253. package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts +9 -0
  254. package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
  255. package/dist/es2017/core/fetchers/segment/task_prioritizer.js +10 -2
  256. package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
  257. package/dist/es2017/core/main/common/content_time_boundaries_observer.js +4 -4
  258. package/dist/es2017/core/main/worker/content_preparer.d.ts +3 -3
  259. package/dist/es2017/core/main/worker/content_preparer.d.ts.map +1 -1
  260. package/dist/es2017/core/main/worker/content_preparer.js +3 -3
  261. package/dist/es2017/core/main/worker/send_message.js +1 -1
  262. package/dist/es2017/core/main/worker/worker_main.js +6 -2
  263. package/dist/es2017/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
  264. package/dist/es2017/core/segment_sinks/inventory/segment_inventory.js +1 -2
  265. package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
  266. package/dist/es2017/core/segment_sinks/segment_buffers_store.js +3 -2
  267. package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts +1 -1
  268. package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
  269. package/dist/es2017/core/stream/adaptation/adaptation_stream.js +3 -3
  270. package/dist/es2017/core/stream/adaptation/types.d.ts +2 -2
  271. package/dist/es2017/core/stream/adaptation/types.d.ts.map +1 -1
  272. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
  273. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
  274. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
  275. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
  276. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
  277. package/dist/es2017/core/stream/period/period_stream.d.ts +1 -1
  278. package/dist/es2017/core/stream/period/period_stream.d.ts.map +1 -1
  279. package/dist/es2017/core/stream/period/period_stream.js +2 -2
  280. package/dist/es2017/core/stream/period/types.d.ts +2 -2
  281. package/dist/es2017/core/stream/period/types.d.ts.map +1 -1
  282. package/dist/es2017/core/stream/representation/representation_stream.d.ts +1 -1
  283. package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
  284. package/dist/es2017/core/stream/representation/representation_stream.js +19 -28
  285. package/dist/es2017/core/stream/representation/types.d.ts +2 -2
  286. package/dist/es2017/core/stream/representation/types.d.ts.map +1 -1
  287. package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
  288. package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -2
  289. package/dist/es2017/core/types.d.ts +2 -2
  290. package/dist/es2017/core/types.d.ts.map +1 -1
  291. package/dist/es2017/default_config.d.ts.map +1 -1
  292. package/dist/es2017/default_config.js +0 -8
  293. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
  294. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
  295. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
  296. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
  297. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
  298. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
  299. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
  300. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
  301. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
  302. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
  303. package/dist/es2017/features/add_features.d.ts.map +1 -1
  304. package/dist/es2017/features/add_features.js +1 -2
  305. package/dist/es2017/main_thread/api/option_utils.d.ts.map +1 -1
  306. package/dist/es2017/main_thread/api/option_utils.js +2 -6
  307. package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
  308. package/dist/es2017/main_thread/api/public_api.js +29 -23
  309. package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
  310. package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.js +2 -1
  311. package/dist/es2017/main_thread/init/media_source_content_initializer.js +6 -6
  312. package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  313. package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +7 -12
  314. package/dist/es2017/main_thread/text_displayer/html/html_text_displayer.js +1 -5
  315. package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +3 -7
  316. package/dist/es2017/main_thread/tracks_store/track_dispatcher.js +1 -1
  317. package/dist/es2017/main_thread/types.d.ts.map +1 -1
  318. package/dist/es2017/manifest/classes/manifest.d.ts.map +1 -1
  319. package/dist/es2017/manifest/classes/manifest.js +0 -6
  320. package/dist/es2017/manifest/utils.d.ts.map +1 -1
  321. package/dist/es2017/manifest/utils.js +1 -2
  322. package/dist/es2017/mse/main_media_source_interface.js +1 -1
  323. package/dist/es2017/multithread_types.d.ts +2 -2
  324. package/dist/es2017/multithread_types.d.ts.map +1 -1
  325. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
  326. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
  327. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  328. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
  329. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
  330. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
  331. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
  332. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
  333. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
  334. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
  335. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
  336. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
  337. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
  338. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
  339. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
  340. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
  341. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
  342. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
  343. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
  344. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
  345. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
  346. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -2
  347. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
  348. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
  349. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
  350. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
  351. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
  352. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
  353. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
  354. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
  355. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
  356. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
  357. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
  358. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
  359. package/dist/es2017/parsers/manifest/local/representation_index.d.ts.map +1 -1
  360. package/dist/es2017/parsers/manifest/local/representation_index.js +1 -2
  361. package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
  362. package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -3
  363. package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
  364. package/dist/es2017/parsers/manifest/smooth/create_parser.js +2 -1
  365. package/dist/es2017/parsers/manifest/smooth/shared_smooth_segment_timeline.js +2 -2
  366. package/dist/es2017/parsers/manifest/utils/get_first_time_from_adaptation.js +2 -2
  367. package/dist/es2017/parsers/manifest/utils/get_last_time_from_adaptation.js +2 -2
  368. package/dist/es2017/parsers/texttracks/srt/html.js +2 -2
  369. package/dist/es2017/parsers/texttracks/ttml/html/create_element.js +1 -1
  370. package/dist/es2017/parsers/texttracks/ttml/html/parse_ttml_to_div.js +3 -3
  371. package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
  372. package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +1 -2
  373. package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
  374. package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.js +1 -2
  375. package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
  376. package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
  377. package/dist/es2017/parsers/texttracks/webvtt/html/to_html.js +9 -3
  378. package/dist/es2017/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -2
  379. package/dist/es2017/public_types.d.ts +5 -7
  380. package/dist/es2017/public_types.d.ts.map +1 -1
  381. package/dist/es2017/transports/smooth/extract_timings_infos.js +3 -3
  382. package/dist/es2017/utils/array_find.d.ts +1 -1
  383. package/dist/es2017/utils/array_find.d.ts.map +1 -1
  384. package/dist/es2017/utils/array_find.js +3 -1
  385. package/dist/es2017/utils/array_find_index.d.ts +1 -1
  386. package/dist/es2017/utils/array_find_index.d.ts.map +1 -1
  387. package/dist/es2017/utils/array_find_index.js +3 -1
  388. package/dist/es2017/utils/array_includes.d.ts.map +1 -1
  389. package/dist/es2017/utils/array_includes.js +1 -3
  390. package/dist/es2017/utils/assert.d.ts.map +1 -1
  391. package/dist/es2017/utils/assert.js +0 -2
  392. package/dist/es2017/utils/base64.d.ts +1 -1
  393. package/dist/es2017/utils/base64.d.ts.map +1 -1
  394. package/dist/es2017/utils/base64.js +3 -2
  395. package/dist/es2017/utils/event_emitter.js +1 -1
  396. package/dist/es2017/utils/flat_map.d.ts.map +1 -1
  397. package/dist/es2017/utils/flat_map.js +1 -2
  398. package/dist/es2017/utils/id_generator.d.ts.map +1 -1
  399. package/dist/es2017/utils/id_generator.js +0 -1
  400. package/dist/es2017/utils/logger.d.ts.map +1 -1
  401. package/dist/es2017/utils/logger.js +7 -8
  402. package/dist/es2017/utils/monotonic_timestamp.js +2 -2
  403. package/dist/es2017/utils/noop.js +1 -2
  404. package/dist/es2017/utils/object_assign.d.ts.map +1 -1
  405. package/dist/es2017/utils/object_assign.js +1 -2
  406. package/dist/es2017/utils/object_values.d.ts.map +1 -1
  407. package/dist/es2017/utils/object_values.js +1 -2
  408. package/dist/es2017/utils/reference.js +1 -1
  409. package/dist/es2017/utils/request/xhr.js +1 -1
  410. package/dist/rx-player.js +39338 -18
  411. package/dist/rx-player.min.js +18 -0
  412. package/dist/worker.js +5 -5
  413. package/package.json +5 -5
  414. package/src/README.md +7 -7
  415. package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
  416. package/src/compat/__tests__/add_text_track.test.ts +8 -12
  417. package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -7
  418. package/src/compat/__tests__/browser_version.test.ts +20 -19
  419. package/src/compat/__tests__/can_patch_isobmff.test.ts +7 -10
  420. package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +17 -21
  421. package/src/compat/__tests__/can_reuse_media_keys.test.ts +37 -22
  422. package/src/compat/__tests__/clear_element_src.test.ts +37 -34
  423. package/src/compat/__tests__/enable_audio_track.test.ts +22 -21
  424. package/src/compat/__tests__/is_codec_supported.test.ts +17 -18
  425. package/src/compat/__tests__/is_seeking_approximate.test.ts +8 -14
  426. package/src/compat/__tests__/is_vtt_cue.test.ts +8 -13
  427. package/src/compat/__tests__/make_vtt_cue.test.ts +7 -12
  428. package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +44 -32
  429. package/src/compat/__tests__/remove_cue.test.ts +30 -31
  430. package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +21 -26
  431. package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +9 -17
  432. package/src/compat/__tests__/should_unset_media_keys.test.ts +7 -14
  433. package/src/compat/__tests__/should_validate_metadata.test.ts +7 -17
  434. package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +17 -26
  435. package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +10 -15
  436. package/src/compat/add_class_name.ts +1 -2
  437. package/src/compat/browser_compatibility_types.ts +4 -2
  438. package/src/compat/browser_detection.ts +13 -4
  439. package/src/compat/can_reuse_media_keys.ts +6 -2
  440. package/src/compat/clear_element_src.ts +1 -1
  441. package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -2
  442. package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -2
  443. package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +3 -6
  444. package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +2 -17
  445. package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -4
  446. package/src/compat/eme/eme-api-implementation.ts +0 -2
  447. package/src/compat/event_listeners.ts +2 -6
  448. package/src/compat/has_mse_in_worker.ts +1 -1
  449. package/src/compat/is_codec_supported.ts +0 -2
  450. package/src/compat/is_debug_mode_enabled.ts +1 -1
  451. package/src/compat/is_vtt_cue.ts +1 -2
  452. package/src/compat/on_height_width_change.ts +1 -2
  453. package/src/compat/patch_webkit_source_buffer.ts +48 -29
  454. package/src/compat/remove_cue.ts +2 -2
  455. package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +21 -26
  456. package/src/core/fetchers/README.md +13 -12
  457. package/src/core/fetchers/index.ts +5 -8
  458. package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +17 -23
  459. package/src/core/fetchers/segment/index.ts +6 -5
  460. package/src/core/{stream/representation/utils/downloading_queue.ts → fetchers/segment/segment_queue.ts} +204 -166
  461. package/src/core/fetchers/segment/{segment_fetcher_creator.ts → segment_queue_creator.ts} +31 -14
  462. package/src/core/fetchers/segment/task_prioritizer.ts +10 -2
  463. package/src/core/fetchers/utils/schedule_request.ts +1 -1
  464. package/src/core/main/common/content_time_boundaries_observer.ts +4 -4
  465. package/src/core/main/worker/content_preparer.ts +5 -5
  466. package/src/core/main/worker/send_message.ts +1 -1
  467. package/src/core/main/worker/worker_main.ts +6 -2
  468. package/src/core/segment_sinks/implementations/text/text_segment_buffer.ts +1 -5
  469. package/src/core/segment_sinks/inventory/segment_inventory.ts +1 -2
  470. package/src/core/segment_sinks/segment_buffers_store.ts +3 -2
  471. package/src/core/stream/adaptation/adaptation_stream.ts +3 -3
  472. package/src/core/stream/adaptation/types.ts +2 -2
  473. package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +1 -2
  474. package/src/core/stream/orchestrator/stream_orchestrator.ts +4 -4
  475. package/src/core/stream/period/period_stream.ts +2 -2
  476. package/src/core/stream/period/types.ts +2 -2
  477. package/src/core/stream/representation/representation_stream.ts +59 -56
  478. package/src/core/stream/representation/types.ts +3 -4
  479. package/src/core/stream/representation/utils/get_needed_segments.ts +1 -2
  480. package/src/core/types.ts +2 -4
  481. package/src/default_config.ts +0 -8
  482. package/src/errors/__tests__/format_error.test.ts +18 -18
  483. package/src/experimental/features/__tests__/multi_thread.test.ts +5 -5
  484. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +11 -11
  485. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +18 -26
  486. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +13 -21
  487. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +24 -20
  488. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +28 -30
  489. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +32 -38
  490. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +64 -51
  491. package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -17
  492. package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -4
  493. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
  494. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +16 -14
  495. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
  496. package/src/features/__tests__/add_features.test.ts +12 -11
  497. package/src/features/add_features.ts +1 -2
  498. package/src/features/list/__tests__/dash_wasm.test.ts +4 -4
  499. package/src/main_thread/api/__tests__/option_utils.test.ts +114 -70
  500. package/src/main_thread/api/__tests__/public_api.test.ts +85 -48
  501. package/src/main_thread/api/option_utils.ts +2 -6
  502. package/src/main_thread/api/public_api.ts +24 -18
  503. package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +12 -18
  504. package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +128 -101
  505. package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +26 -33
  506. package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +46 -48
  507. package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +33 -34
  508. package/src/main_thread/decrypt/__tests__/__global__/utils.ts +13 -17
  509. package/src/main_thread/decrypt/session_events_listener.ts +1 -1
  510. package/src/main_thread/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -5
  511. package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +14 -17
  512. package/src/main_thread/decrypt/utils/persistent_sessions_store.ts +2 -1
  513. package/src/main_thread/init/media_source_content_initializer.ts +7 -7
  514. package/src/main_thread/init/multi_thread_content_initializer.ts +7 -12
  515. package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +11 -16
  516. package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +48 -18
  517. package/src/main_thread/text_displayer/html/__tests__/text_track_cues_store.test.ts +32 -17
  518. package/src/main_thread/text_displayer/html/html_text_displayer.ts +1 -5
  519. package/src/main_thread/text_displayer/native/native_text_displayer.ts +3 -7
  520. package/src/main_thread/tracks_store/__tests__/media_element_tracks_store.test.ts +33 -28
  521. package/src/main_thread/tracks_store/track_dispatcher.ts +1 -1
  522. package/src/main_thread/types.ts +0 -1
  523. package/src/manifest/classes/__tests__/adaptation.test.ts +167 -62
  524. package/src/manifest/classes/__tests__/manifest.test.ts +130 -74
  525. package/src/manifest/classes/__tests__/period.test.ts +293 -211
  526. package/src/manifest/classes/__tests__/update_period_in_place.test.ts +0 -2
  527. package/src/manifest/classes/__tests__/update_periods.test.ts +57 -57
  528. package/src/manifest/classes/manifest.ts +0 -6
  529. package/src/manifest/utils.ts +1 -2
  530. package/src/mse/main_media_source_interface.ts +1 -1
  531. package/src/mse/types.ts +1 -1
  532. package/src/multithread_types.ts +2 -2
  533. package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +5 -10
  534. package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +38 -30
  535. package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -3
  536. package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +12 -6
  537. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.ts +14 -7
  538. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.ts +8 -4
  539. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Period.ts +10 -5
  540. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.ts +10 -5
  541. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
  542. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
  543. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
  544. package/src/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.ts +14 -7
  545. package/src/parsers/manifest/dash/native-parser/node_parsers/EventStream.ts +2 -1
  546. package/src/parsers/manifest/dash/native-parser/node_parsers/MPD.ts +8 -4
  547. package/src/parsers/manifest/dash/native-parser/node_parsers/Period.ts +10 -5
  548. package/src/parsers/manifest/dash/native-parser/node_parsers/Representation.ts +10 -5
  549. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
  550. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
  551. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentTimeline.test.ts +9 -14
  552. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
  553. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -2
  554. package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +2 -1
  555. package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +2 -1
  556. package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +4 -2
  557. package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +10 -5
  558. package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +2 -1
  559. package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +2 -1
  560. package/src/parsers/manifest/local/representation_index.ts +1 -2
  561. package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +2 -3
  562. package/src/parsers/manifest/smooth/create_parser.ts +2 -1
  563. package/src/parsers/manifest/smooth/shared_smooth_segment_timeline.ts +2 -2
  564. package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +3 -8
  565. package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +2 -2
  566. package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +2 -2
  567. package/src/parsers/texttracks/srt/html.ts +2 -2
  568. package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +3 -7
  569. package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +4 -4
  570. package/src/parsers/texttracks/ttml/html/create_element.ts +1 -1
  571. package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +3 -3
  572. package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +1 -2
  573. package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +1 -2
  574. package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +11 -11
  575. package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +5 -18
  576. package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +23 -28
  577. package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +9 -14
  578. package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +11 -11
  579. package/src/parsers/texttracks/webvtt/html/to_html.ts +9 -3
  580. package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +2 -2
  581. package/src/public_types.ts +7 -8
  582. package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
  583. package/src/transports/smooth/extract_timings_infos.ts +3 -3
  584. package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +30 -28
  585. package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +38 -44
  586. package/src/utils/__tests__/array_find.test.ts +12 -12
  587. package/src/utils/__tests__/array_find_index.test.ts +13 -12
  588. package/src/utils/__tests__/array_includes.test.ts +7 -7
  589. package/src/utils/__tests__/assert.test.ts +19 -25
  590. package/src/utils/__tests__/base64.test.ts +18 -13
  591. package/src/utils/__tests__/event_emitter.test.ts +225 -50
  592. package/src/utils/__tests__/flat_map.test.ts +2 -6
  593. package/src/utils/__tests__/starts_with.test.ts +7 -8
  594. package/src/utils/array_find.ts +3 -7
  595. package/src/utils/array_find_index.ts +3 -7
  596. package/src/utils/array_includes.ts +1 -3
  597. package/src/utils/assert.ts +0 -2
  598. package/src/utils/base64.ts +3 -2
  599. package/src/utils/event_emitter.ts +1 -1
  600. package/src/utils/flat_map.ts +1 -2
  601. package/src/utils/id_generator.ts +0 -2
  602. package/src/utils/is_worker.ts +1 -1
  603. package/src/utils/logger.ts +7 -8
  604. package/src/utils/monotonic_timestamp.ts +2 -2
  605. package/src/utils/noop.ts +1 -2
  606. package/src/utils/object_assign.ts +1 -2
  607. package/src/utils/object_values.ts +1 -2
  608. package/src/utils/reference.ts +1 -1
  609. package/src/utils/request/xhr.ts +1 -1
  610. package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
  611. package/dist/commonjs/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
  612. package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
  613. package/dist/es2017/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
@@ -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 IShouldValidateMetadata from "../should_validate_metadata";
8
3
 
9
4
  describe("compat - shouldValidateMetadata", () => {
10
5
  beforeEach(() => {
@@ -17,10 +12,9 @@ describe("compat - shouldValidateMetadata", () => {
17
12
  isSamsungBrowser: false,
18
13
  };
19
14
  });
20
- const shouldValidateMetadata = (await vi.importActual(
21
- "../should_validate_metadata",
22
- )) as any;
23
- expect(shouldValidateMetadata.default()).toBe(false);
15
+ const shouldValidateMetadata = (await vi.importActual("../should_validate_metadata"))
16
+ .default as typeof IShouldValidateMetadata;
17
+ expect(shouldValidateMetadata()).toBe(false);
24
18
  });
25
19
 
26
20
  it("should return true if we are on the Samsung browser", async () => {
@@ -29,12 +23,8 @@ describe("compat - shouldValidateMetadata", () => {
29
23
  isSamsungBrowser: true,
30
24
  };
31
25
  });
32
- const shouldValidateMetadata = (await vi.importActual(
33
- "../should_validate_metadata",
34
- )) as any;
35
- expect(shouldValidateMetadata.default()).toBe(true);
36
- });
37
- beforeEach(() => {
38
- vi.resetModules();
26
+ const shouldValidateMetadata = (await vi.importActual("../should_validate_metadata"))
27
+ .default as typeof IShouldValidateMetadata;
28
+ expect(shouldValidateMetadata()).toBe(true);
39
29
  });
40
30
  });
@@ -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 IShouldWaitForDataBeforeLoaded from "../should_wait_for_data_before_loaded";
8
3
 
9
4
  describe("compat - shouldWaitForDataBeforeLoaded", () => {
10
5
  beforeEach(() => {
@@ -17,10 +12,10 @@ describe("compat - shouldWaitForDataBeforeLoaded", () => {
17
12
  isSafariMobile: false,
18
13
  };
19
14
  });
20
- const shouldWaitForDataBeforeLoaded = (await vi.importActual(
21
- "../should_wait_for_data_before_loaded",
22
- )) as any;
23
- expect(shouldWaitForDataBeforeLoaded.default(false)).toBe(true);
15
+ const shouldWaitForDataBeforeLoaded = (
16
+ await vi.importActual("../should_wait_for_data_before_loaded")
17
+ ).default as typeof IShouldWaitForDataBeforeLoaded;
18
+ expect(shouldWaitForDataBeforeLoaded(false)).toBe(true);
24
19
  });
25
20
 
26
21
  it("should return true if we are not on Safari browser but in directfile mode", async () => {
@@ -29,10 +24,10 @@ describe("compat - shouldWaitForDataBeforeLoaded", () => {
29
24
  isSafariMobile: false,
30
25
  };
31
26
  });
32
- const shouldWaitForDataBeforeLoaded = (await vi.importActual(
33
- "../should_wait_for_data_before_loaded",
34
- )) as any;
35
- expect(shouldWaitForDataBeforeLoaded.default(true)).toBe(true);
27
+ const shouldWaitForDataBeforeLoaded = (
28
+ await vi.importActual("../should_wait_for_data_before_loaded")
29
+ ).default as typeof IShouldWaitForDataBeforeLoaded;
30
+ expect(shouldWaitForDataBeforeLoaded(true)).toBe(true);
36
31
  });
37
32
 
38
33
  it("should return true if we are on the Safari browser but not in directfile mode", async () => {
@@ -41,10 +36,10 @@ describe("compat - shouldWaitForDataBeforeLoaded", () => {
41
36
  isSafariMobile: true,
42
37
  };
43
38
  });
44
- const shouldWaitForDataBeforeLoaded = (await vi.importActual(
45
- "../should_wait_for_data_before_loaded",
46
- )) as any;
47
- expect(shouldWaitForDataBeforeLoaded.default(false)).toBe(true);
39
+ const shouldWaitForDataBeforeLoaded = (
40
+ await vi.importActual("../should_wait_for_data_before_loaded")
41
+ ).default as typeof IShouldWaitForDataBeforeLoaded;
42
+ expect(shouldWaitForDataBeforeLoaded(false)).toBe(true);
48
43
  });
49
44
 
50
45
  // eslint-disable-next-line max-len
@@ -54,13 +49,9 @@ describe("compat - shouldWaitForDataBeforeLoaded", () => {
54
49
  isSafariMobile: true,
55
50
  };
56
51
  });
57
- const shouldWaitForDataBeforeLoaded = (await vi.importActual(
58
- "../should_wait_for_data_before_loaded",
59
- )) as any;
60
- expect(shouldWaitForDataBeforeLoaded.default(true)).toBe(false);
61
- });
62
-
63
- beforeEach(() => {
64
- vi.resetModules();
52
+ const shouldWaitForDataBeforeLoaded = (
53
+ await vi.importActual("../should_wait_for_data_before_loaded")
54
+ ).default as typeof IShouldWaitForDataBeforeLoaded;
55
+ expect(shouldWaitForDataBeforeLoaded(true)).toBe(false);
65
56
  });
66
57
  });
@@ -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 IShouldWaitForHaveEnoughData from "../should_wait_for_have_enough_data";
8
3
 
9
4
  describe("compat - shouldWaitForHaveEnoughData", () => {
10
5
  beforeEach(() => {
@@ -17,10 +12,10 @@ describe("compat - shouldWaitForHaveEnoughData", () => {
17
12
  isPlayStation5: false,
18
13
  };
19
14
  });
20
- const shouldWaitForHaveEnoughData = (await vi.importActual(
21
- "../should_wait_for_have_enough_data",
22
- )) as any;
23
- expect(shouldWaitForHaveEnoughData.default()).toBe(false);
15
+ const shouldWaitForHaveEnoughData = (
16
+ await vi.importActual("../should_wait_for_have_enough_data")
17
+ ).default as typeof IShouldWaitForHaveEnoughData;
18
+ expect(shouldWaitForHaveEnoughData()).toBe(false);
24
19
  });
25
20
 
26
21
  it("should return true if we are on the Playstation 5", async () => {
@@ -28,10 +23,10 @@ describe("compat - shouldWaitForHaveEnoughData", () => {
28
23
  return {
29
24
  isPlayStation5: true,
30
25
  };
31
- }) as any;
32
- const shouldWaitForHaveEnoughData = (await vi.importActual(
33
- "../should_wait_for_have_enough_data",
34
- )) as any;
35
- expect(shouldWaitForHaveEnoughData.default()).toBe(true);
26
+ });
27
+ const shouldWaitForHaveEnoughData = (
28
+ await vi.importActual("../should_wait_for_have_enough_data")
29
+ ).default as typeof IShouldWaitForHaveEnoughData;
30
+ expect(shouldWaitForHaveEnoughData()).toBe(true);
36
31
  });
37
32
  });
@@ -26,9 +26,8 @@ export default function addClassName(elt: HTMLElement, className: string): void
26
26
  if (hasClassList === undefined) {
27
27
  hasClassList =
28
28
  elt.classList !== undefined &&
29
- /* eslint-disable @typescript-eslint/unbound-method */
29
+ // eslint-disable-next-line @typescript-eslint/unbound-method
30
30
  typeof elt.classList.add === "function";
31
- /* eslint-enable @typescript-eslint/unbound-method */
32
31
  }
33
32
 
34
33
  if (hasClassList) {
@@ -299,8 +299,8 @@ export interface IMediaElement extends IEventTarget<IMediaElementEventMap> {
299
299
  videoTracks?: ICompatVideoTrackList;
300
300
  }
301
301
 
302
- /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types */
303
302
  // @ts-expect-error unused function, just used for compile-time typechecking
303
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types
304
304
  function testMediaElement(x: HTMLMediaElement) {
305
305
  assertCompatibleIMediaElement(x);
306
306
  }
@@ -308,6 +308,7 @@ function assertCompatibleIMediaElement(_x: IMediaElement) {
308
308
  // Noop
309
309
  }
310
310
  // @ts-expect-error unused function, just used for compile-time typechecking
311
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types
311
312
  function testMediaSource(x: MediaSource) {
312
313
  assertCompatibleIMediaSource(x);
313
314
  }
@@ -315,6 +316,7 @@ function assertCompatibleIMediaSource(_x: IMediaSource) {
315
316
  // Noop
316
317
  }
317
318
  // @ts-expect-error unused function, just used for compile-time typechecking
319
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types
318
320
  function testSourceBuffer(x: SourceBuffer) {
319
321
  assertCompatibleISourceBuffer(x);
320
322
  }
@@ -322,13 +324,13 @@ function assertCompatibleISourceBuffer(_x: ISourceBuffer) {
322
324
  // Noop
323
325
  }
324
326
  // @ts-expect-error unused function, just used for compile-time typechecking
327
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types
325
328
  function testSourceBufferList(x: SourceBufferList) {
326
329
  assertCompatibleISourceBufferList(x);
327
330
  }
328
331
  function assertCompatibleISourceBufferList(_x: ISourceBufferList) {
329
332
  // Noop
330
333
  }
331
- /* eslint-enable @typescript-eslint/no-unused-vars, @typescript-eslint/no-restricted-types */
332
334
 
333
335
  /**
334
336
  * AudioTrackList implementation (that TS forgot).
@@ -79,6 +79,9 @@ let isPlayStation5 = false;
79
79
  /** `true` for the Xbox game consoles. */
80
80
  let isXbox = false;
81
81
 
82
+ /** `true` for specific A1 STB: KSTB 40xx from Kaon Media. */
83
+ let isA1KStb40xx = false;
84
+
82
85
  (function findCurrentBrowser(): void {
83
86
  if (isNode) {
84
87
  return;
@@ -167,24 +170,30 @@ let isXbox = false;
167
170
  isPanasonic = true;
168
171
  } else if (navigator.userAgent.indexOf("Xbox") !== -1) {
169
172
  isXbox = true;
173
+ } else if (navigator.userAgent.indexOf("Model/a1-kstb40xx")) {
174
+ isA1KStb40xx = true;
170
175
  }
171
176
  })();
172
177
 
173
178
  export {
179
+ // browsers
174
180
  isEdgeChromium,
181
+ isFirefox,
175
182
  isIE11,
176
183
  isIEOrEdge,
177
- isFirefox,
184
+ isSafariDesktop,
185
+ isSafariMobile,
186
+
187
+ // specific devices
188
+ isA1KStb40xx,
178
189
  isPanasonic,
179
190
  isPhilipsNetTv,
180
191
  isPlayStation4,
181
192
  isPlayStation5,
182
- isXbox,
183
- isSafariDesktop,
184
- isSafariMobile,
185
193
  isSamsungBrowser,
186
194
  isTizen,
187
195
  isWebOs,
188
196
  isWebOs2021,
189
197
  isWebOs2022,
198
+ isXbox,
190
199
  };
@@ -1,4 +1,4 @@
1
- import { isPanasonic, isPhilipsNetTv, isWebOs } from "./browser_detection";
1
+ import { isA1KStb40xx, isPanasonic, isPhilipsNetTv, isWebOs } from "./browser_detection";
2
2
 
3
3
  /**
4
4
  * Returns `true` if a `MediaKeys` instance (the `Encrypted Media Extension`
@@ -11,9 +11,13 @@ import { isPanasonic, isPhilipsNetTv, isWebOs } from "./browser_detection";
11
11
  * HTMLMediaElement.
12
12
  * - (2024-08-23): Seen on Philips 2024 and 2023 in:
13
13
  * https://github.com/canalplus/rx-player/issues/1464
14
+ * - (2024-09-04): Another case seen on an "A1" set-top box model made by
15
+ * Kaonmedia we will call the KSTB40xx.
16
+ * It may share the problematic with other devices, but we have only seen
17
+ * the problem on this one for now.
14
18
  *
15
19
  * @returns {boolean}
16
20
  */
17
21
  export default function canReuseMediaKeys(): boolean {
18
- return !isWebOs && !isPhilipsNetTv && !isPanasonic;
22
+ return !isWebOs && !isPhilipsNetTv && !isPanasonic && !isA1KStb40xx;
19
23
  }
@@ -40,7 +40,7 @@ export default function clearElementSrc(element: IMediaElement): void {
40
40
  if (childNodes[j].nodeName === "track") {
41
41
  try {
42
42
  element.removeChild(childNodes[j]);
43
- } catch (err) {
43
+ } catch (_err) {
44
44
  log.warn("Compat: Could not remove text track child from element.");
45
45
  }
46
46
  }
@@ -32,9 +32,8 @@ if (
32
32
  MozMediaKeys !== undefined &&
33
33
  MozMediaKeys.prototype !== undefined &&
34
34
  typeof MozMediaKeys.isTypeSupported === "function" &&
35
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
35
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
36
36
  typeof MozMediaKeys.prototype.createSession === "function"
37
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
38
37
  ) {
39
38
  MozMediaKeysConstructor = MozMediaKeys;
40
39
  }
@@ -58,9 +58,8 @@ if (
58
58
  MSMediaKeys !== undefined &&
59
59
  MSMediaKeys.prototype !== undefined &&
60
60
  typeof MSMediaKeys.isTypeSupported === "function" &&
61
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
61
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
62
62
  typeof MSMediaKeys.prototype.createSession === "function"
63
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
64
63
  ) {
65
64
  MSMediaKeysConstructor = MSMediaKeys;
66
65
  }
@@ -110,15 +110,12 @@ class OldWebkitMediaKeySession
110
110
  if (this._key.indexOf("clearkey") >= 0) {
111
111
  const licenseTypedArray =
112
112
  license instanceof ArrayBuffer ? new Uint8Array(license) : license;
113
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
114
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
115
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
113
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
116
114
  const json = JSON.parse(utf8ToStr(licenseTypedArray));
115
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
117
116
  const key = base64ToBytes(json.keys[0].k);
117
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
118
118
  const kid = base64ToBytes(json.keys[0].kid);
119
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
120
- /* eslint-enable @typescript-eslint/no-unsafe-argument */
121
- /* eslint-enable @typescript-eslint/no-unsafe-assignment */
122
119
  resolve(this._vid.webkitAddKey(this._key, key, kid, /* sessionId */ ""));
123
120
  } else {
124
121
  resolve(this._vid.webkitAddKey(this._key, license, null, /* sessionId */ ""));
@@ -110,7 +110,6 @@ class WebkitMediaKeySession
110
110
 
111
111
  public update(license: BufferSource): Promise<void> {
112
112
  return new Promise((resolve, reject) => {
113
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
114
113
  if (
115
114
  this._nativeSession === undefined ||
116
115
  this._nativeSession.update === undefined ||
@@ -127,14 +126,11 @@ class WebkitMediaKeySession
127
126
  } else {
128
127
  uInt8Arraylicense = new Uint8Array(license.buffer);
129
128
  }
130
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
131
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
129
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
132
130
  resolve(this._nativeSession.update(uInt8Arraylicense));
133
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
134
131
  } catch (err) {
135
132
  reject(err);
136
133
  }
137
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
138
134
  });
139
135
  }
140
136
 
@@ -176,9 +172,8 @@ class WebkitMediaKeySession
176
172
  reject("No session to close.");
177
173
  return;
178
174
  }
179
- /* eslint-disable @typescript-eslint/no-floating-promises */
175
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
180
176
  this._nativeSession.close();
181
- /* eslint-enable @typescript-eslint/no-floating-promises */
182
177
  resolve();
183
178
  });
184
179
  }
@@ -192,11 +187,7 @@ class WebkitMediaKeySession
192
187
  }
193
188
 
194
189
  get sessionId(): string {
195
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
196
- /* eslint-disable @typescript-eslint/no-unsafe-return */
197
190
  return this._nativeSession?.sessionId ?? "";
198
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
199
- /* eslint-enable @typescript-eslint/no-unsafe-return */
200
191
  }
201
192
 
202
193
  private _listenEvent(session: MediaKeySession): void {
@@ -206,9 +197,6 @@ class WebkitMediaKeySession
206
197
  this.trigger(evt.type, evt);
207
198
  };
208
199
 
209
- /* eslint-disable @typescript-eslint/no-unsafe-call */
210
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
211
- /* eslint-disable @typescript-eslint/no-unsafe-return */
212
200
  ["keymessage", "message", "keyadded", "ready", "keyerror", "error"].forEach((evt) => {
213
201
  session.addEventListener(evt, onEvent);
214
202
  session.addEventListener(`webkit${evt}`, onEvent);
@@ -222,9 +210,6 @@ class WebkitMediaKeySession
222
210
  },
223
211
  );
224
212
  };
225
- /* eslint-disable @typescript-eslint/no-unsafe-return */
226
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
227
- /* eslint-enable @typescript-eslint/no-unsafe-call */
228
213
  }
229
214
  }
230
215
 
@@ -26,8 +26,6 @@ interface IWebKitMediaKeysConstructor {
26
26
 
27
27
  let WebKitMediaKeysConstructor: undefined | IWebKitMediaKeysConstructor;
28
28
 
29
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
30
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
31
29
  const { WebKitMediaKeys } = globalScope as typeof globalThis & {
32
30
  WebKitMediaKeys?: IWebKitMediaKeysConstructor;
33
31
  };
@@ -35,13 +33,12 @@ const { WebKitMediaKeys } = globalScope as typeof globalThis & {
35
33
  if (
36
34
  WebKitMediaKeys !== undefined &&
37
35
  typeof WebKitMediaKeys.isTypeSupported === "function" &&
36
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
38
37
  typeof WebKitMediaKeys.prototype.createSession === "function" &&
39
38
  typeof (HTMLMediaElement.prototype as IMediaElement).webkitSetMediaKeys === "function"
40
39
  ) {
41
40
  WebKitMediaKeysConstructor = WebKitMediaKeys;
42
41
  }
43
- /* eslint-enable @typescript-eslint/no-unsafe-assignment */
44
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
45
42
 
46
43
  export type { IWebKitMediaKeys };
47
44
  export { WebKitMediaKeysConstructor };
@@ -319,11 +319,9 @@ function defaultSetMediaKeys(
319
319
  ): Promise<unknown> {
320
320
  try {
321
321
  let ret: unknown;
322
- /* eslint-disable @typescript-eslint/unbound-method */
323
322
  if (typeof elt.setMediaKeys === "function") {
324
323
  ret = elt.setMediaKeys(mediaKeys as MediaKeys);
325
324
  }
326
- /* eslint-enable @typescript-eslint/unbound-method */
327
325
 
328
326
  // If we get in the following code, it means that no compat case has been
329
327
  // found and no standard setMediaKeys API exists. This case is particulary
@@ -176,20 +176,16 @@ function createCompatibleEventListener(
176
176
  (element as IEventEmitterLike).addEventListener(eventName, listener);
177
177
  } else {
178
178
  hasSetOnFn = true;
179
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
180
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
179
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
181
180
  (element as any)["on" + eventName] = listener;
182
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
183
181
  }
184
182
  cancelSignal.register(() => {
185
183
  if (typeof element.removeEventListener === "function") {
186
184
  (element as IEventEmitterLike).removeEventListener(eventName, listener);
187
185
  }
188
186
  if (hasSetOnFn) {
189
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
190
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
187
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
191
188
  delete (element as any)["on" + eventName];
192
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
193
189
  }
194
190
  });
195
191
  });
@@ -1,6 +1,6 @@
1
1
  const hasMseInWorker =
2
2
  typeof MediaSource === "function" &&
3
- /* eslint-disable-next-line */
3
+ // eslint-disable-next-line
4
4
  (MediaSource as any).canConstructInDedicatedWorker === true;
5
5
 
6
6
  export default hasMseInWorker;
@@ -47,9 +47,7 @@ export default function isCodecSupported(mimeType: string): boolean {
47
47
  return false;
48
48
  }
49
49
 
50
- /* eslint-disable @typescript-eslint/unbound-method */
51
50
  if (typeof MediaSource_.isTypeSupported === "function") {
52
- /* eslint-enable @typescript-eslint/unbound-method */
53
51
  const cachedSupport = supportMap.get(mimeType);
54
52
  if (cachedSupport !== undefined) {
55
53
  return cachedSupport;
@@ -1,4 +1,4 @@
1
- /* eslint-disable-next-line @typescript-eslint/naming-convention */
1
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2
2
  declare const __RX_PLAYER_DEBUG_MODE__: boolean | undefined;
3
3
 
4
4
  /**
@@ -25,7 +25,6 @@ import type { ICompatVTTCue } from "./browser_compatibility_types";
25
25
  export default function isVTTCue(
26
26
  cue: ICompatVTTCue | TextTrackCue,
27
27
  ): cue is ICompatVTTCue {
28
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
28
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
29
29
  return typeof globalScope.VTTCue === "function" && cue instanceof globalScope.VTTCue;
30
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
31
30
  }
@@ -26,9 +26,8 @@ export interface IResolution {
26
26
  }
27
27
 
28
28
  interface IResizeObserverConstructor {
29
- /* eslint-disable @typescript-eslint/prefer-function-type */
29
+ // eslint-disable-next-line @typescript-eslint/prefer-function-type
30
30
  new (callback: IResizeObserverCallback): IResizeObserver;
31
- /* eslint-enable @typescript-eslint/prefer-function-type */
32
31
  }
33
32
 
34
33
  interface IResizeObserver {
@@ -20,29 +20,45 @@ import isNode from "../utils/is_node";
20
20
  import isNullOrUndefined from "../utils/is_null_or_undefined";
21
21
  import queueMicrotask from "../utils/queue_microtask";
22
22
 
23
- type IWebKitSourceBufferConstructor = new () => IWebKitSourceBuffer;
23
+ interface IWebKitSourceBufferConstructor {
24
+ new (): IWebKitSourceBuffer;
25
+ prototype: IWebKitSourceBuffer;
26
+ }
24
27
 
25
- interface IWebKitSourceBuffer {
26
- append(data: ArrayBuffer): void;
28
+ interface IWebKitSourceBuffer
29
+ extends EventEmitter<{
30
+ updatestart: Event;
31
+ update: Event;
32
+ updateend: Event;
33
+ error: Event | Error;
34
+ }> {
35
+ _emitUpdate?: (eventName: "error" | "update", val: unknown) => void;
36
+ appendBuffer?: (data: BufferSource) => void;
37
+ updating: boolean;
38
+ append(data: BufferSource): void;
27
39
  remove(from: number, to: number): void;
28
40
  }
29
41
 
30
42
  // TODO This is the last ugly side-effect here.
31
43
  // Either remove it or find the best way to implement that
32
44
  export default function patchWebkitSourceBuffer(): void {
33
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
34
- /* eslint-disable @typescript-eslint/no-unsafe-call */
35
- /* eslint-disable @typescript-eslint/no-explicit-any */
36
45
  // old WebKit SourceBuffer implementation,
37
46
  // where a synchronous append is used instead of appendBuffer
38
47
  if (
39
48
  !isNode &&
40
- !isNullOrUndefined((globalScope as any).WebKitSourceBuffer) &&
41
- (globalScope as any).WebKitSourceBuffer.prototype.addEventListener === undefined
49
+ !isNullOrUndefined(
50
+ (
51
+ globalScope as typeof globalScope & {
52
+ WebKitSourceBuffer?: IWebKitSourceBufferConstructor;
53
+ }
54
+ ).WebKitSourceBuffer,
55
+ ) &&
56
+ (
57
+ globalScope as typeof globalScope & {
58
+ WebKitSourceBuffer: IWebKitSourceBufferConstructor;
59
+ }
60
+ ).WebKitSourceBuffer.prototype.addEventListener === undefined
42
61
  ) {
43
- /* eslint-enable @typescript-eslint/no-explicit-any */
44
-
45
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
46
62
  const sourceBufferWebkitRef: IWebKitSourceBufferConstructor = (
47
63
  globalScope as unknown as {
48
64
  WebKitSourceBuffer: IWebKitSourceBufferConstructor;
@@ -52,42 +68,45 @@ export default function patchWebkitSourceBuffer(): void {
52
68
 
53
69
  for (const fnName in EventEmitter.prototype) {
54
70
  if (EventEmitter.prototype.hasOwnProperty(fnName)) {
55
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
56
- sourceBufferWebkitProto[fnName] = (EventEmitter.prototype as any)[fnName];
71
+ (sourceBufferWebkitProto as unknown as Record<string, unknown>)[fnName] = (
72
+ EventEmitter.prototype as unknown as Record<string, unknown>
73
+ )[fnName];
57
74
  }
58
75
  }
59
- /* eslint-enable @typescript-eslint/no-unsafe-assignment */
60
76
 
61
- sourceBufferWebkitProto._listeners = [];
77
+ (
78
+ sourceBufferWebkitProto as unknown as {
79
+ _listeners: Array<() => void>;
80
+ }
81
+ )._listeners = [];
62
82
 
63
- sourceBufferWebkitProto._emitUpdate = function (eventName: string, val: unknown) {
83
+ sourceBufferWebkitProto._emitUpdate = function (
84
+ eventName: "error" | "update",
85
+ val: unknown,
86
+ ) {
64
87
  queueMicrotask(() => {
65
- /* eslint-disable no-invalid-this */
66
- this.trigger(eventName, val);
88
+ // @ts-expect-error: trigger is normally protected
89
+ this.trigger(eventName, val as Event);
67
90
  this.updating = false;
68
- this.trigger("updateend");
69
- /* eslint-enable no-invalid-this */
91
+ // @ts-expect-error: trigger is normally protected
92
+ this.trigger("updateend", new Event("updateend"));
70
93
  });
71
94
  };
72
95
 
73
- sourceBufferWebkitProto.appendBuffer = function (data: unknown) {
74
- /* eslint-disable no-invalid-this */
75
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
96
+ sourceBufferWebkitProto.appendBuffer = function (data: BufferSource) {
76
97
  if (this.updating) {
77
98
  throw new Error("updating");
78
99
  }
79
- this.trigger("updatestart");
100
+ // @ts-expect-error: trigger is normally protected
101
+ this.trigger("updatestart", new Event("updatestart"));
80
102
  this.updating = true;
81
103
  try {
82
104
  this.append(data);
83
105
  } catch (error) {
84
- this._emitUpdate("error", error);
106
+ this._emitUpdate?.("error", error);
85
107
  return;
86
108
  }
87
- this._emitUpdate("update");
88
- /* eslint-enable no-invalid-this */
109
+ this._emitUpdate?.("update", new Event("update"));
89
110
  };
90
111
  }
91
- /* eslint-enable @typescript-eslint/no-unsafe-member-access */
92
- /* eslint-enable @typescript-eslint/no-unsafe-call */
93
112
  }
@@ -50,7 +50,7 @@ export default function removeCue(track: TextTrack, cue: TextTrackCue): void {
50
50
  track.mode = "hidden";
51
51
  try {
52
52
  track.removeCue(cue);
53
- } catch (err) {
53
+ } catch (_err) {
54
54
  log.warn("Compat: Could not remove cue from text track.");
55
55
  }
56
56
  track.mode = trackMode;
@@ -58,7 +58,7 @@ export default function removeCue(track: TextTrack, cue: TextTrackCue): void {
58
58
  }
59
59
  try {
60
60
  track.removeCue(cue);
61
- } catch (err) {
61
+ } catch (_err) {
62
62
  log.warn("Compat: Could not remove cue from text track.");
63
63
  }
64
64
  }