rx-player 4.0.0-dev.2023120600 → 4.0.0-rc.1

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 (1242) hide show
  1. package/.eslintrc.js +2 -0
  2. package/.github/workflows/checks.yml +24 -47
  3. package/CHANGELOG.md +136 -7
  4. package/CONTRIBUTING.md +11 -0
  5. package/FILES.md +8 -6
  6. package/README.md +2 -33
  7. package/VERSION +1 -1
  8. package/dist/_esm5.processed/compat/add_text_track.d.ts +3 -1
  9. package/dist/_esm5.processed/compat/add_text_track.js +7 -4
  10. package/dist/_esm5.processed/compat/browser_compatibility_types.d.ts +7 -0
  11. package/dist/_esm5.processed/compat/browser_detection.d.ts +3 -1
  12. package/dist/_esm5.processed/compat/browser_detection.js +24 -4
  13. package/dist/_esm5.processed/compat/event_listeners.d.ts +15 -2
  14. package/dist/_esm5.processed/compat/event_listeners.js +37 -2
  15. package/dist/{commonjs/core/segment_buffers/implementations/text/html/update_proportional_elements.d.ts → _esm5.processed/compat/fullscreen.d.ts} +14 -12
  16. package/dist/_esm5.processed/compat/fullscreen.js +78 -0
  17. package/dist/_esm5.processed/compat/index.d.ts +3 -1
  18. package/dist/_esm5.processed/compat/index.js +3 -1
  19. package/dist/_esm5.processed/compat/is_offline.d.ts +39 -0
  20. package/dist/_esm5.processed/compat/is_offline.js +43 -0
  21. package/dist/_esm5.processed/compat/should_prevent_seeking_at_0_initially.d.ts +14 -0
  22. package/dist/_esm5.processed/compat/should_prevent_seeking_at_0_initially.js +17 -0
  23. package/dist/_esm5.processed/config.d.ts +22 -9
  24. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +58 -0
  25. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +54 -14
  26. package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.d.ts +8 -2
  27. package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.js +11 -2
  28. package/dist/_esm5.processed/core/api/debug/modules/general_info.js +46 -17
  29. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +3 -3
  30. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.js +1 -1
  31. package/dist/_esm5.processed/core/api/option_utils.d.ts +37 -12
  32. package/dist/_esm5.processed/core/api/option_utils.js +232 -44
  33. package/dist/_esm5.processed/core/api/public_api.d.ts +275 -91
  34. package/dist/_esm5.processed/core/api/public_api.js +824 -435
  35. package/dist/_esm5.processed/core/api/{track_management/media_element_tracks_store.d.ts → tracks_management/media_element_track_choice_manager.d.ts} +75 -15
  36. package/dist/_esm5.processed/core/api/{track_management/media_element_tracks_store.js → tracks_management/media_element_track_choice_manager.js} +193 -74
  37. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.d.ts +258 -0
  38. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +989 -0
  39. package/dist/_esm5.processed/core/api/utils.d.ts +0 -1
  40. package/dist/_esm5.processed/core/api/utils.js +11 -28
  41. package/dist/_esm5.processed/core/decrypt/attach_media_keys.d.ts +2 -1
  42. package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +2 -1
  43. package/dist/_esm5.processed/core/decrypt/content_decryptor.js +3 -3
  44. package/dist/_esm5.processed/core/decrypt/find_key_system.js +71 -83
  45. package/dist/_esm5.processed/core/decrypt/get_media_keys.js +5 -6
  46. package/dist/_esm5.processed/core/decrypt/init_media_keys.js +13 -5
  47. package/dist/_esm5.processed/core/decrypt/session_events_listener.js +72 -10
  48. package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.d.ts +4 -4
  49. package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.js +4 -6
  50. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +3 -1
  51. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +26 -7
  52. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +9 -3
  53. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +9 -16
  54. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.d.ts +3 -1
  55. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +1 -1
  56. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.d.ts +6 -1
  57. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +41 -4
  58. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +25 -8
  59. package/dist/_esm5.processed/core/init/media_source_content_initializer.d.ts +8 -1
  60. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +9 -8
  61. package/dist/_esm5.processed/core/init/types.d.ts +15 -5
  62. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  63. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.js +16 -17
  64. package/dist/_esm5.processed/core/init/utils/get_initial_time.d.ts +17 -3
  65. package/dist/_esm5.processed/core/init/utils/get_initial_time.js +9 -7
  66. package/dist/_esm5.processed/core/init/utils/get_loaded_reference.js +7 -5
  67. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.d.ts +2 -1
  68. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +59 -6
  69. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  70. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.d.ts +75 -0
  71. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +133 -0
  72. package/{experimental → dist/_esm5.processed/core/segment_buffers/implementations/image}/index.d.ts +2 -1
  73. package/{experimental → dist/_esm5.processed/core/segment_buffers/implementations/image}/index.js +2 -1
  74. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  75. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +2 -1
  76. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +4 -3
  77. package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +8 -3
  78. package/dist/_esm5.processed/core/segment_buffers/implementations/types.js +7 -2
  79. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
  80. package/dist/_esm5.processed/core/segment_buffers/index.js +1 -2
  81. package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +2 -3
  82. package/dist/_esm5.processed/core/segment_buffers/inventory/index.js +0 -1
  83. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +31 -9
  84. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +27 -12
  85. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.d.ts +1 -0
  86. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +16 -2
  87. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +15 -0
  88. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +93 -183
  89. package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +13 -27
  90. package/dist/_esm5.processed/core/stream/index.d.ts +3 -2
  91. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +0 -2
  92. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +23 -16
  93. package/dist/_esm5.processed/core/stream/period/period_stream.js +12 -13
  94. package/dist/_esm5.processed/core/stream/period/types.d.ts +14 -5
  95. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -2
  96. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.js +46 -10
  97. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +23 -29
  98. package/dist/_esm5.processed/core/stream/representation/types.d.ts +1 -11
  99. package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.js +6 -5
  100. package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.js +1 -1
  101. package/dist/_esm5.processed/default_config.d.ts +105 -35
  102. package/dist/_esm5.processed/default_config.js +129 -36
  103. package/dist/_esm5.processed/errors/custom_loader_error.d.ts +3 -1
  104. package/dist/_esm5.processed/errors/custom_loader_error.js +3 -1
  105. package/dist/_esm5.processed/errors/media_error.js +2 -2
  106. package/dist/_esm5.processed/errors/network_error.d.ts +1 -0
  107. package/dist/_esm5.processed/errors/network_error.js +1 -0
  108. package/dist/_esm5.processed/errors/request_error.d.ts +3 -2
  109. package/dist/_esm5.processed/errors/request_error.js +5 -2
  110. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -3
  111. package/dist/_esm5.processed/features/features_object.js +2 -0
  112. package/dist/{commonjs/core/segment_buffers/implementations/text/html/index.d.ts → _esm5.processed/features/list/bif_parser.d.ts} +6 -4
  113. package/dist/_esm5.processed/features/list/bif_parser.js +27 -0
  114. package/dist/_esm5.processed/features/list/directfile.js +5 -2
  115. package/dist/_esm5.processed/{transports/smooth/is_mp4_embedded_track.d.ts → features/list/image_buffer.d.ts} +6 -5
  116. package/dist/{commonjs/core/segment_buffers/implementations/text/html/index.js → _esm5.processed/features/list/image_buffer.js} +8 -6
  117. package/dist/_esm5.processed/features/list/index.d.ts +2 -0
  118. package/dist/_esm5.processed/features/list/index.js +2 -0
  119. package/dist/_esm5.processed/features/types.d.ts +27 -3
  120. package/dist/_esm5.processed/manifest/adaptation.d.ts +11 -9
  121. package/dist/_esm5.processed/manifest/adaptation.js +30 -41
  122. package/dist/_esm5.processed/manifest/index.d.ts +4 -3
  123. package/dist/_esm5.processed/manifest/manifest.d.ts +54 -5
  124. package/dist/_esm5.processed/manifest/manifest.js +118 -9
  125. package/dist/_esm5.processed/manifest/period.d.ts +8 -5
  126. package/dist/_esm5.processed/manifest/period.js +16 -3
  127. package/dist/_esm5.processed/manifest/representation.d.ts +5 -10
  128. package/dist/_esm5.processed/manifest/representation.js +5 -15
  129. package/dist/_esm5.processed/manifest/representation_index/index.d.ts +2 -2
  130. package/dist/_esm5.processed/manifest/representation_index/static.d.ts +1 -3
  131. package/dist/_esm5.processed/manifest/representation_index/static.js +2 -8
  132. package/dist/_esm5.processed/manifest/representation_index/types.d.ts +25 -46
  133. package/dist/_esm5.processed/manifest/types.d.ts +2 -0
  134. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +37 -18
  135. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +23 -29
  136. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  137. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  138. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  139. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +1 -3
  140. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +3 -9
  141. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +12 -7
  142. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +42 -36
  143. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  144. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -8
  145. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +247 -57
  146. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +2 -2
  147. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.js +6 -1
  148. package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  149. package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  150. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +17 -13
  151. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +2 -0
  152. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +27 -14
  153. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  154. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +15 -16
  155. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
  156. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +21 -8
  157. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +7 -3
  158. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +6 -10
  159. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +2 -4
  160. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.d.ts +1 -10
  161. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.js +2 -18
  162. package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +4 -4
  163. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +6 -3
  164. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +2 -1
  165. package/dist/_esm5.processed/parsers/manifest/local/representation_index.d.ts +1 -3
  166. package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +3 -9
  167. package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +6 -6
  168. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.d.ts +4 -13
  169. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.js +4 -13
  170. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +1 -0
  171. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +17 -11
  172. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +88 -26
  173. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +150 -62
  174. package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.d.ts +6 -3
  175. package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.js +4 -4
  176. package/dist/_esm5.processed/parsers/manifest/types.d.ts +3 -3
  177. package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.js +1 -1
  178. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  179. package/dist/_esm5.processed/public_types.d.ts +322 -398
  180. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.d.ts +4 -5
  181. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +4 -5
  182. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +4 -4
  183. package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +38 -0
  184. package/dist/_esm5.processed/transports/dash/image_pipelines.js +129 -0
  185. package/dist/_esm5.processed/transports/dash/manifest_parser.js +3 -2
  186. package/dist/_esm5.processed/transports/dash/pipelines.js +4 -1
  187. package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +2 -2
  188. package/dist/_esm5.processed/transports/dash/segment_loader.js +20 -26
  189. package/dist/_esm5.processed/transports/dash/segment_parser.js +24 -19
  190. package/dist/_esm5.processed/transports/dash/text_loader.js +5 -5
  191. package/dist/_esm5.processed/transports/dash/text_parser.js +33 -28
  192. package/dist/_esm5.processed/transports/local/pipelines.js +10 -1
  193. package/dist/_esm5.processed/transports/local/segment_loader.js +2 -2
  194. package/dist/_esm5.processed/transports/local/segment_parser.d.ts +1 -1
  195. package/dist/_esm5.processed/transports/local/segment_parser.js +10 -10
  196. package/dist/_esm5.processed/transports/local/text_parser.d.ts +2 -2
  197. package/dist/_esm5.processed/transports/local/text_parser.js +23 -23
  198. package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +52 -34
  199. package/dist/_esm5.processed/transports/smooth/pipelines.js +190 -33
  200. package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +1 -1
  201. package/dist/_esm5.processed/transports/smooth/segment_loader.js +22 -28
  202. package/dist/_esm5.processed/transports/smooth/utils.d.ts +26 -1
  203. package/dist/_esm5.processed/transports/smooth/utils.js +55 -1
  204. package/dist/_esm5.processed/transports/types.d.ts +89 -94
  205. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +3 -3
  206. package/dist/_esm5.processed/transports/utils/infer_segment_container.d.ts +3 -3
  207. package/dist/_esm5.processed/transports/utils/infer_segment_container.js +7 -5
  208. package/dist/_esm5.processed/transports/utils/parse_text_track.d.ts +12 -8
  209. package/dist/_esm5.processed/transports/utils/parse_text_track.js +21 -19
  210. package/dist/_esm5.processed/utils/array_includes.d.ts +1 -2
  211. package/dist/_esm5.processed/utils/array_includes.js +28 -30
  212. package/dist/{es2017/core/segment_buffers/implementations/text/html/index.d.ts → _esm5.processed/utils/list_to_map.d.ts} +5 -4
  213. package/dist/_esm5.processed/{transports/smooth/is_mp4_embedded_track.js → utils/list_to_map.js} +10 -6
  214. package/dist/_esm5.processed/utils/request/xhr.js +5 -5
  215. package/dist/_esm5.processed/utils/simple_set.d.ts +51 -0
  216. package/dist/_esm5.processed/utils/simple_set.js +57 -0
  217. package/dist/_esm5.processed/utils/uniq.d.ts +36 -0
  218. package/dist/_esm5.processed/utils/uniq.js +43 -0
  219. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts +3 -0
  220. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +6 -0
  221. package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts +3 -0
  222. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +6 -0
  223. package/dist/commonjs/__GENERATED_CODE/index.d.ts +2 -0
  224. package/dist/commonjs/__GENERATED_CODE/index.js +7 -0
  225. package/dist/commonjs/compat/browser_compatibility_types.js +1 -1
  226. package/dist/commonjs/compat/browser_detection.d.ts +3 -1
  227. package/dist/commonjs/compat/browser_detection.js +27 -6
  228. package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +1 -1
  229. package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +1 -1
  230. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts +1 -1
  231. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +1 -2
  232. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -1
  233. package/dist/commonjs/compat/eme/eme-api-implementation.js +4 -3
  234. package/dist/commonjs/compat/event_listeners.js +1 -1
  235. package/dist/commonjs/compat/has_mse_in_worker.d.ts +2 -0
  236. package/dist/commonjs/compat/has_mse_in_worker.js +6 -0
  237. package/dist/commonjs/compat/has_webassembly.d.ts +6 -0
  238. package/dist/commonjs/compat/has_webassembly.js +9 -0
  239. package/dist/commonjs/compat/index.d.ts +1 -2
  240. package/dist/commonjs/compat/index.js +1 -3
  241. package/dist/commonjs/compat/is_codec_supported.js +5 -0
  242. package/dist/commonjs/compat/is_vtt_cue.js +1 -1
  243. package/dist/commonjs/compat/make_vtt_cue.js +1 -1
  244. package/dist/commonjs/compat/on_height_width_change.js +1 -1
  245. package/dist/commonjs/compat/patch_webkit_source_buffer.js +2 -2
  246. package/dist/commonjs/config.d.ts +7 -18
  247. package/dist/commonjs/config.js +4 -12
  248. package/dist/commonjs/core/adaptive/adaptive_representation_selector.d.ts +4 -20
  249. package/dist/commonjs/core/adaptive/adaptive_representation_selector.js +2 -2
  250. package/dist/commonjs/core/adaptive/network_analyzer.js +3 -3
  251. package/dist/commonjs/core/api/debug/buffer_graph.js +3 -3
  252. package/dist/commonjs/core/api/debug/modules/general_info.js +23 -11
  253. package/dist/commonjs/core/api/debug/modules/segment_buffer_content.js +5 -4
  254. package/dist/commonjs/core/api/index.d.ts +1 -1
  255. package/dist/commonjs/core/api/option_utils.d.ts +3 -2
  256. package/dist/commonjs/core/api/option_utils.js +14 -4
  257. package/dist/commonjs/core/api/playback_observer.d.ts +182 -31
  258. package/dist/commonjs/core/api/playback_observer.js +291 -105
  259. package/dist/commonjs/core/api/public_api.d.ts +35 -12
  260. package/dist/commonjs/core/api/public_api.js +328 -161
  261. package/dist/commonjs/core/api/track_management/track_dispatcher.d.ts +12 -8
  262. package/dist/commonjs/core/api/track_management/track_dispatcher.js +28 -22
  263. package/dist/commonjs/core/api/track_management/tracks_store.d.ts +26 -14
  264. package/dist/commonjs/core/api/track_management/tracks_store.js +134 -66
  265. package/dist/commonjs/core/api/utils.js +1 -1
  266. package/dist/commonjs/core/decrypt/attach_media_keys.d.ts +2 -1
  267. package/dist/commonjs/core/decrypt/attach_media_keys.js +2 -1
  268. package/dist/commonjs/core/decrypt/content_decryptor.js +70 -181
  269. package/dist/commonjs/core/decrypt/get_media_keys.js +2 -6
  270. package/dist/commonjs/core/decrypt/init_media_keys.js +13 -5
  271. package/dist/commonjs/core/decrypt/types.d.ts +11 -5
  272. package/dist/commonjs/core/decrypt/utils/check_key_statuses.js +4 -4
  273. package/dist/commonjs/{utils → core/fetchers/segment}/initialization_segment_cache.d.ts +1 -1
  274. package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +2 -2
  275. package/dist/commonjs/core/fetchers/utils/error_selector.js +2 -1
  276. package/dist/commonjs/core/fetchers/utils/schedule_request.js +2 -1
  277. package/dist/commonjs/core/init/directfile_content_initializer.js +13 -4
  278. package/dist/commonjs/core/init/media_source_content_initializer.d.ts +7 -22
  279. package/dist/commonjs/core/init/media_source_content_initializer.js +325 -113
  280. package/dist/commonjs/core/init/multithread/main_thread/multi_thread_content_initializer.d.ts +167 -0
  281. package/dist/commonjs/core/init/multithread/main_thread/multi_thread_content_initializer.js +1389 -0
  282. package/dist/commonjs/core/init/multithread/main_thread/send_message.d.ts +2 -0
  283. package/dist/commonjs/core/init/multithread/main_thread/send_message.js +13 -0
  284. package/dist/commonjs/core/init/multithread/worker/content_preparer.d.ts +92 -0
  285. package/dist/commonjs/core/init/multithread/worker/content_preparer.js +259 -0
  286. package/dist/commonjs/core/init/multithread/worker/globals.d.ts +13 -0
  287. package/dist/commonjs/core/init/multithread/worker/globals.js +26 -0
  288. package/dist/commonjs/core/init/multithread/worker/index.d.ts +2 -0
  289. package/dist/commonjs/core/init/multithread/worker/index.js +4 -0
  290. package/dist/commonjs/core/init/multithread/worker/send_message.d.ts +3 -0
  291. package/dist/commonjs/core/init/multithread/worker/send_message.js +25 -0
  292. package/dist/commonjs/core/init/multithread/worker/track_choice_setter.d.ts +19 -0
  293. package/dist/commonjs/core/init/multithread/worker/track_choice_setter.js +140 -0
  294. package/dist/commonjs/core/init/multithread/worker/worker_playback_observer.d.ts +21 -0
  295. package/dist/commonjs/core/init/multithread/worker/worker_playback_observer.js +47 -0
  296. package/dist/commonjs/core/init/multithread/worker/worker_portal.d.ts +1 -0
  297. package/dist/commonjs/core/init/multithread/worker/worker_portal.js +721 -0
  298. package/dist/commonjs/core/init/multithread/worker/worker_text_displayer_interface.d.ts +64 -0
  299. package/dist/commonjs/core/init/multithread/worker/worker_text_displayer_interface.js +127 -0
  300. package/dist/commonjs/core/init/types.d.ts +21 -12
  301. package/dist/commonjs/core/init/types.js +0 -1
  302. package/dist/commonjs/core/init/utils/DecipherabilityFreezeDetector.d.ts +54 -0
  303. package/dist/commonjs/core/init/utils/DecipherabilityFreezeDetector.js +129 -0
  304. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.js +1 -2
  305. package/dist/commonjs/core/init/utils/create_content_time_boundaries_observer.d.ts +28 -0
  306. package/dist/commonjs/core/init/utils/create_content_time_boundaries_observer.js +48 -0
  307. package/dist/commonjs/core/init/utils/create_core_playback_observer.d.ts +61 -0
  308. package/dist/commonjs/core/init/utils/create_core_playback_observer.js +130 -0
  309. package/dist/commonjs/core/init/utils/create_media_source.d.ts +3 -3
  310. package/dist/commonjs/core/init/utils/create_media_source.js +29 -38
  311. package/dist/commonjs/core/init/utils/get_initial_time.d.ts +2 -2
  312. package/dist/commonjs/core/init/utils/get_initial_time.js +6 -5
  313. package/dist/commonjs/core/init/utils/get_loaded_reference.js +7 -5
  314. package/dist/commonjs/core/init/utils/initial_seek_and_play.d.ts +9 -11
  315. package/dist/commonjs/core/init/utils/initial_seek_and_play.js +168 -89
  316. package/dist/commonjs/core/init/utils/initialize_content_decryption.d.ts +7 -1
  317. package/dist/commonjs/core/init/utils/initialize_content_decryption.js +6 -0
  318. package/dist/commonjs/core/init/utils/main_thread_text_displayer_interface.d.ts +35 -0
  319. package/dist/commonjs/core/init/utils/main_thread_text_displayer_interface.js +54 -0
  320. package/dist/commonjs/core/init/utils/rebuffering_controller.d.ts +5 -38
  321. package/dist/commonjs/core/init/utils/rebuffering_controller.js +30 -182
  322. package/dist/commonjs/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.d.ts +2 -2
  323. package/dist/commonjs/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.js +24 -1
  324. package/dist/commonjs/core/init/utils/stream_events_emitter/stream_events_emitter.d.ts +3 -2
  325. package/dist/commonjs/core/init/utils/stream_events_emitter/stream_events_emitter.js +8 -6
  326. package/dist/commonjs/core/segment_buffers/garbage_collector.d.ts +3 -1
  327. package/dist/commonjs/core/segment_buffers/garbage_collector.js +14 -6
  328. package/dist/commonjs/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +26 -74
  329. package/dist/commonjs/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +183 -290
  330. package/dist/commonjs/core/segment_buffers/implementations/index.d.ts +2 -1
  331. package/dist/commonjs/core/segment_buffers/implementations/text/index.d.ts +3 -0
  332. package/dist/commonjs/core/segment_buffers/implementations/text/index.js +4 -0
  333. package/dist/commonjs/core/segment_buffers/implementations/text/text_segment_buffer.d.ts +89 -0
  334. package/dist/commonjs/core/segment_buffers/implementations/text/text_segment_buffer.js +253 -0
  335. package/dist/commonjs/core/segment_buffers/implementations/types.d.ts +46 -57
  336. package/dist/commonjs/core/segment_buffers/implementations/types.js +22 -29
  337. package/dist/commonjs/core/segment_buffers/index.d.ts +4 -4
  338. package/dist/commonjs/core/segment_buffers/inventory/index.d.ts +2 -2
  339. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.d.ts +47 -16
  340. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.js +70 -30
  341. package/dist/commonjs/core/segment_buffers/segment_buffers_store.d.ts +7 -16
  342. package/dist/commonjs/core/segment_buffers/segment_buffers_store.js +14 -24
  343. package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +15 -8
  344. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.d.ts +20 -6
  345. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.js +65 -53
  346. package/dist/commonjs/core/stream/adaptation/types.d.ts +17 -28
  347. package/dist/commonjs/core/stream/index.d.ts +2 -1
  348. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts +4 -4
  349. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
  350. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +25 -20
  351. package/dist/commonjs/core/stream/period/period_stream.js +58 -27
  352. package/dist/commonjs/core/stream/period/types.d.ts +13 -7
  353. package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
  354. package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.js +79 -72
  355. package/dist/commonjs/core/stream/representation/representation_stream.js +7 -8
  356. package/dist/commonjs/core/stream/representation/types.d.ts +32 -5
  357. package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.d.ts +5 -2
  358. package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.js +44 -28
  359. package/dist/commonjs/core/stream/representation/utils/get_buffer_status.d.ts +2 -2
  360. package/dist/commonjs/core/stream/representation/utils/get_buffer_status.js +23 -13
  361. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts +2 -2
  362. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +2 -6
  363. package/dist/commonjs/core/stream/representation/utils/push_init_segment.d.ts +3 -1
  364. package/dist/commonjs/core/stream/representation/utils/push_init_segment.js +3 -4
  365. package/dist/commonjs/core/stream/representation/utils/push_media_segment.d.ts +3 -1
  366. package/dist/commonjs/core/stream/representation/utils/push_media_segment.js +3 -4
  367. package/dist/commonjs/default_config.d.ts +38 -50
  368. package/dist/commonjs/default_config.js +60 -63
  369. package/dist/commonjs/errors/encrypted_media_error.d.ts +17 -0
  370. package/dist/commonjs/errors/encrypted_media_error.js +13 -0
  371. package/dist/commonjs/errors/error_codes.d.ts +4 -3
  372. package/dist/commonjs/errors/error_codes.js +3 -8
  373. package/dist/commonjs/errors/index.d.ts +7 -8
  374. package/dist/commonjs/errors/index.js +3 -5
  375. package/dist/commonjs/errors/media_error.d.ts +21 -18
  376. package/dist/commonjs/errors/media_error.js +15 -19
  377. package/dist/commonjs/errors/network_error.d.ts +15 -1
  378. package/dist/commonjs/errors/network_error.js +12 -0
  379. package/dist/commonjs/errors/other_error.d.ts +14 -0
  380. package/dist/commonjs/errors/other_error.js +12 -0
  381. package/dist/commonjs/errors/source_buffer_error.d.ts +40 -0
  382. package/dist/commonjs/errors/source_buffer_error.js +62 -0
  383. package/dist/commonjs/experimental/features/index.d.ts +1 -2
  384. package/dist/commonjs/experimental/features/index.js +3 -5
  385. package/dist/commonjs/experimental/features/local.js +3 -1
  386. package/dist/commonjs/experimental/features/metaplaylist.js +3 -1
  387. package/dist/commonjs/experimental/features/multi_thread.d.ts +8 -0
  388. package/dist/commonjs/experimental/features/multi_thread.js +14 -0
  389. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/load_and_push_segment.d.ts +3 -3
  390. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/load_and_push_segment.js +13 -14
  391. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts +3 -3
  392. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +24 -17
  393. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.d.ts +3 -5
  394. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.js +4 -5
  395. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +17 -12
  396. package/dist/commonjs/experimental/tools/index.d.ts +1 -2
  397. package/dist/commonjs/experimental/tools/index.js +1 -3
  398. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/index.d.ts +2 -0
  399. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +4 -4
  400. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +1 -1
  401. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -1
  402. package/dist/commonjs/features/features_object.js +5 -3
  403. package/dist/commonjs/features/list/dash.js +3 -1
  404. package/dist/commonjs/{experimental/features → features/list}/dash_wasm.js +3 -1
  405. package/dist/commonjs/features/list/html_sami_parser.js +4 -4
  406. package/dist/commonjs/features/list/html_srt_parser.js +4 -4
  407. package/dist/commonjs/features/list/html_text_buffer.js +2 -2
  408. package/dist/commonjs/features/list/html_ttml_parser.js +4 -4
  409. package/dist/commonjs/features/list/html_vtt_parser.js +4 -4
  410. package/dist/commonjs/features/list/index.d.ts +3 -0
  411. package/dist/commonjs/features/list/index.js +7 -1
  412. package/dist/commonjs/features/list/media_source_main.d.ts +8 -0
  413. package/dist/commonjs/features/list/media_source_main.js +14 -0
  414. package/dist/commonjs/features/list/native_sami_parser.js +4 -5
  415. package/dist/commonjs/features/list/native_srt_parser.js +4 -5
  416. package/dist/commonjs/features/list/native_text_buffer.js +2 -3
  417. package/dist/commonjs/features/list/native_ttml_parser.js +4 -5
  418. package/dist/commonjs/features/list/native_vtt_parser.js +4 -5
  419. package/dist/commonjs/features/list/smooth.d.ts +1 -1
  420. package/dist/commonjs/features/list/smooth.js +7 -3
  421. package/dist/commonjs/features/types.d.ts +28 -5
  422. package/dist/commonjs/manifest/adaptation.d.ts +66 -44
  423. package/dist/commonjs/manifest/adaptation.js +96 -77
  424. package/dist/commonjs/manifest/index.d.ts +4 -3
  425. package/dist/commonjs/manifest/index.js +16 -1
  426. package/dist/commonjs/manifest/manifest.d.ts +132 -9
  427. package/dist/commonjs/manifest/manifest.js +114 -72
  428. package/dist/commonjs/manifest/period.d.ts +41 -3
  429. package/dist/commonjs/manifest/period.js +120 -24
  430. package/dist/commonjs/manifest/representation.d.ts +61 -74
  431. package/dist/commonjs/manifest/representation.js +125 -45
  432. package/dist/commonjs/manifest/types.d.ts +382 -0
  433. package/dist/commonjs/manifest/types.js +0 -15
  434. package/dist/commonjs/manifest/update_period_in_place.d.ts +12 -9
  435. package/dist/commonjs/manifest/update_period_in_place.js +10 -6
  436. package/dist/commonjs/manifest/update_periods.d.ts +7 -4
  437. package/dist/commonjs/manifest/update_periods.js +53 -14
  438. package/dist/commonjs/manifest/utils.d.ts +156 -0
  439. package/dist/commonjs/manifest/utils.js +689 -1
  440. package/dist/commonjs/minimal.d.ts +3 -0
  441. package/dist/commonjs/minimal.js +6 -0
  442. package/dist/commonjs/mse/index.d.ts +1 -0
  443. package/dist/commonjs/mse/index.js +2 -0
  444. package/dist/commonjs/mse/main_codec_support_prober.d.ts +26 -0
  445. package/dist/commonjs/mse/main_codec_support_prober.js +44 -0
  446. package/dist/commonjs/mse/main_media_source_interface.d.ts +112 -0
  447. package/dist/commonjs/mse/main_media_source_interface.js +504 -0
  448. package/dist/commonjs/mse/types.d.ts +301 -0
  449. package/dist/commonjs/mse/types.js +2 -0
  450. package/dist/commonjs/mse/worker_codec_support_prober.d.ts +42 -0
  451. package/dist/commonjs/mse/worker_codec_support_prober.js +61 -0
  452. package/dist/commonjs/mse/worker_media_source_interface.d.ts +105 -0
  453. package/dist/commonjs/mse/worker_media_source_interface.js +368 -0
  454. package/dist/commonjs/multithread_types.d.ts +781 -0
  455. package/dist/commonjs/multithread_types.js +7 -0
  456. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +14 -16
  457. package/dist/commonjs/parsers/manifest/dash/js-parser/parse_from_document.js +2 -2
  458. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts +1 -1
  459. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +22 -7
  460. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/types.d.ts +55 -55
  461. package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +13 -1
  462. package/dist/commonjs/parsers/manifest/smooth/parse_protection_node.js +1 -1
  463. package/dist/commonjs/parsers/manifest/types.d.ts +8 -1
  464. package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  465. package/dist/commonjs/public_types.d.ts +95 -23
  466. package/dist/commonjs/public_types.js +3 -13
  467. package/dist/commonjs/{core/segment_buffers/implementations/text/html/parsers.d.ts → text_displayer/html/html_parsers.d.ts} +0 -15
  468. package/dist/commonjs/{core/segment_buffers/implementations/text/html/parsers.js → text_displayer/html/html_parsers.js} +2 -17
  469. package/dist/commonjs/text_displayer/html/html_text_displayer.d.ts +100 -0
  470. package/dist/commonjs/{core/segment_buffers/implementations/text/html/html_text_segment_buffer.js → text_displayer/html/html_text_displayer.js} +96 -186
  471. package/dist/commonjs/text_displayer/html/index.d.ts +2 -0
  472. package/dist/commonjs/text_displayer/html/index.js +4 -0
  473. package/dist/{es2017/core/segment_buffers/implementations/text → commonjs/text_displayer}/html/text_track_cues_store.d.ts +4 -18
  474. package/dist/commonjs/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.js +6 -18
  475. package/dist/commonjs/text_displayer/html/update_proportional_elements.d.ts +15 -0
  476. package/dist/commonjs/{core/segment_buffers/implementations/text → text_displayer}/html/update_proportional_elements.js +0 -15
  477. package/dist/commonjs/{core/segment_buffers/implementations/text → text_displayer}/html/utils.d.ts +10 -16
  478. package/dist/commonjs/{core/segment_buffers/implementations/text → text_displayer}/html/utils.js +1 -17
  479. package/dist/commonjs/text_displayer/index.d.ts +2 -0
  480. package/dist/commonjs/text_displayer/index.js +2 -0
  481. package/dist/commonjs/text_displayer/manual_time_ranges.d.ts +14 -0
  482. package/dist/commonjs/text_displayer/manual_time_ranges.js +52 -0
  483. package/dist/commonjs/text_displayer/native/index.d.ts +2 -0
  484. package/dist/commonjs/text_displayer/native/index.js +4 -0
  485. package/dist/commonjs/text_displayer/native/native_parsers.d.ts +11 -0
  486. package/dist/commonjs/{core/segment_buffers/implementations/text/native/parsers.js → text_displayer/native/native_parsers.js} +2 -17
  487. package/dist/commonjs/text_displayer/native/native_text_displayer.d.ts +56 -0
  488. package/dist/commonjs/text_displayer/native/native_text_displayer.js +207 -0
  489. package/dist/commonjs/text_displayer/types.d.ts +74 -0
  490. package/dist/commonjs/text_displayer/types.js +2 -0
  491. package/dist/commonjs/tools/TextTrackRenderer/text_track_renderer.d.ts +1 -1
  492. package/dist/commonjs/tools/TextTrackRenderer/text_track_renderer.js +11 -15
  493. package/dist/commonjs/tools/index.d.ts +2 -1
  494. package/dist/commonjs/tools/index.js +3 -1
  495. package/dist/commonjs/{experimental/tools → tools}/parseBIFThumbnails/index.js +1 -1
  496. package/dist/commonjs/transports/dash/extract_complete_chunks.d.ts +1 -1
  497. package/dist/commonjs/transports/dash/extract_complete_chunks.js +35 -6
  498. package/dist/commonjs/transports/dash/get_events_out_of_emsgs.js +0 -1
  499. package/dist/commonjs/transports/dash/low_latency_segment_loader.js +2 -2
  500. package/dist/commonjs/transports/utils/generate_manifest_loader.js +2 -2
  501. package/dist/commonjs/utils/assert.d.ts +41 -0
  502. package/dist/commonjs/utils/assert.js +69 -3
  503. package/dist/commonjs/utils/event_emitter.js +8 -2
  504. package/dist/commonjs/utils/languages/ISO_639-1_to_ISO_639-3.js +182 -182
  505. package/dist/commonjs/utils/languages/ISO_639-2_to_ISO_639-3.js +19 -19
  506. package/dist/commonjs/utils/logger.d.ts +13 -3
  507. package/dist/commonjs/utils/logger.js +78 -21
  508. package/dist/commonjs/utils/monotonic_timestamp.d.ts +20 -4
  509. package/dist/commonjs/utils/monotonic_timestamp.js +22 -5
  510. package/dist/commonjs/utils/object_assign.d.ts +26 -5
  511. package/dist/commonjs/utils/object_assign.js +14 -3
  512. package/dist/commonjs/utils/request/fetch.js +8 -8
  513. package/dist/commonjs/utils/request/index.d.ts +2 -1
  514. package/dist/commonjs/utils/request/index.js +4 -1
  515. package/dist/commonjs/{errors → utils/request}/request_error.d.ts +12 -3
  516. package/dist/commonjs/{errors → utils/request}/request_error.js +11 -0
  517. package/dist/commonjs/utils/request/xhr.d.ts +4 -4
  518. package/dist/commonjs/utils/request/xhr.js +7 -7
  519. package/dist/commonjs/utils/retry_promise_with_backoff.d.ts +1 -2
  520. package/dist/commonjs/utils/string_parsing.js +1 -1
  521. package/dist/commonjs/utils/sync_or_async.d.ts +70 -0
  522. package/dist/commonjs/utils/sync_or_async.js +47 -0
  523. package/dist/commonjs/worker_entry_point.d.ts +5 -0
  524. package/dist/commonjs/worker_entry_point.js +8 -0
  525. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts +3 -0
  526. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +3 -0
  527. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts +3 -0
  528. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +3 -0
  529. package/dist/es2017/__GENERATED_CODE/index.d.ts +2 -0
  530. package/dist/es2017/__GENERATED_CODE/index.js +2 -0
  531. package/dist/es2017/compat/browser_compatibility_types.js +1 -1
  532. package/dist/es2017/compat/browser_detection.d.ts +3 -1
  533. package/dist/es2017/compat/browser_detection.js +26 -6
  534. package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +1 -1
  535. package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +1 -1
  536. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts +1 -1
  537. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +1 -2
  538. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -1
  539. package/dist/es2017/compat/eme/eme-api-implementation.js +4 -3
  540. package/dist/es2017/compat/event_listeners.js +1 -1
  541. package/dist/es2017/compat/has_mse_in_worker.d.ts +2 -0
  542. package/dist/es2017/compat/has_mse_in_worker.js +4 -0
  543. package/dist/es2017/compat/has_webassembly.d.ts +6 -0
  544. package/dist/es2017/compat/has_webassembly.js +7 -0
  545. package/dist/es2017/compat/index.d.ts +1 -2
  546. package/dist/es2017/compat/index.js +1 -2
  547. package/dist/es2017/compat/is_codec_supported.js +5 -0
  548. package/dist/es2017/compat/is_vtt_cue.js +1 -1
  549. package/dist/es2017/compat/make_vtt_cue.js +1 -1
  550. package/dist/es2017/compat/on_height_width_change.js +1 -1
  551. package/dist/es2017/compat/patch_webkit_source_buffer.js +2 -2
  552. package/dist/es2017/config.d.ts +7 -18
  553. package/dist/es2017/config.js +4 -12
  554. package/dist/es2017/core/adaptive/adaptive_representation_selector.d.ts +4 -20
  555. package/dist/es2017/core/adaptive/adaptive_representation_selector.js +3 -3
  556. package/dist/es2017/core/adaptive/network_analyzer.js +3 -3
  557. package/dist/es2017/core/api/debug/buffer_graph.js +3 -3
  558. package/dist/es2017/core/api/debug/modules/general_info.js +20 -8
  559. package/dist/es2017/core/api/debug/modules/segment_buffer_content.js +5 -4
  560. package/dist/es2017/core/api/index.d.ts +1 -1
  561. package/dist/es2017/core/api/option_utils.d.ts +3 -2
  562. package/dist/es2017/core/api/option_utils.js +15 -4
  563. package/dist/es2017/core/api/playback_observer.d.ts +182 -31
  564. package/dist/es2017/core/api/playback_observer.js +289 -110
  565. package/dist/es2017/core/api/public_api.d.ts +35 -12
  566. package/dist/es2017/core/api/public_api.js +330 -150
  567. package/dist/es2017/core/api/track_management/track_dispatcher.d.ts +12 -8
  568. package/dist/es2017/core/api/track_management/track_dispatcher.js +30 -23
  569. package/dist/es2017/core/api/track_management/tracks_store.d.ts +26 -14
  570. package/dist/es2017/core/api/track_management/tracks_store.js +95 -58
  571. package/dist/es2017/core/api/utils.js +1 -1
  572. package/dist/es2017/core/decrypt/attach_media_keys.d.ts +2 -1
  573. package/dist/es2017/core/decrypt/attach_media_keys.js +2 -1
  574. package/dist/es2017/core/decrypt/content_decryptor.js +35 -89
  575. package/dist/es2017/core/decrypt/get_media_keys.js +2 -6
  576. package/dist/es2017/core/decrypt/init_media_keys.js +11 -1
  577. package/dist/es2017/core/decrypt/types.d.ts +11 -5
  578. package/dist/es2017/core/decrypt/utils/check_key_statuses.js +1 -1
  579. package/dist/es2017/{utils → core/fetchers/segment}/initialization_segment_cache.d.ts +1 -1
  580. package/dist/es2017/core/fetchers/segment/segment_fetcher.js +2 -2
  581. package/dist/es2017/core/fetchers/utils/error_selector.js +2 -1
  582. package/dist/es2017/core/fetchers/utils/schedule_request.js +2 -1
  583. package/dist/es2017/core/init/directfile_content_initializer.js +15 -4
  584. package/dist/es2017/core/init/media_source_content_initializer.d.ts +7 -22
  585. package/dist/es2017/core/init/media_source_content_initializer.js +229 -107
  586. package/dist/es2017/core/init/multithread/main_thread/multi_thread_content_initializer.d.ts +167 -0
  587. package/dist/es2017/core/init/multithread/main_thread/multi_thread_content_initializer.js +1313 -0
  588. package/dist/es2017/core/init/multithread/main_thread/send_message.d.ts +2 -0
  589. package/dist/es2017/core/init/multithread/main_thread/send_message.js +10 -0
  590. package/dist/es2017/core/init/multithread/worker/content_preparer.d.ts +92 -0
  591. package/dist/es2017/core/init/multithread/worker/content_preparer.js +236 -0
  592. package/dist/es2017/core/init/multithread/worker/globals.d.ts +13 -0
  593. package/dist/es2017/core/init/multithread/worker/globals.js +18 -0
  594. package/dist/es2017/core/init/multithread/worker/index.d.ts +2 -0
  595. package/dist/es2017/core/init/multithread/worker/index.js +2 -0
  596. package/dist/es2017/core/init/multithread/worker/send_message.d.ts +3 -0
  597. package/dist/es2017/core/init/multithread/worker/send_message.js +20 -0
  598. package/dist/es2017/core/init/multithread/worker/track_choice_setter.d.ts +19 -0
  599. package/dist/es2017/core/init/multithread/worker/track_choice_setter.js +114 -0
  600. package/dist/es2017/core/init/multithread/worker/worker_playback_observer.d.ts +21 -0
  601. package/dist/es2017/core/init/multithread/worker/worker_playback_observer.js +43 -0
  602. package/dist/es2017/core/init/multithread/worker/worker_portal.d.ts +1 -0
  603. package/dist/es2017/core/init/multithread/worker/worker_portal.js +665 -0
  604. package/dist/es2017/core/init/multithread/worker/worker_text_displayer_interface.d.ts +64 -0
  605. package/dist/es2017/core/init/multithread/worker/worker_text_displayer_interface.js +121 -0
  606. package/dist/es2017/core/init/types.d.ts +21 -12
  607. package/dist/es2017/core/init/types.js +0 -1
  608. package/dist/es2017/core/init/utils/DecipherabilityFreezeDetector.d.ts +54 -0
  609. package/dist/es2017/core/init/utils/DecipherabilityFreezeDetector.js +93 -0
  610. package/dist/es2017/core/init/utils/content_time_boundaries_observer.js +1 -2
  611. package/dist/es2017/core/init/utils/create_content_time_boundaries_observer.d.ts +28 -0
  612. package/dist/es2017/core/init/utils/create_content_time_boundaries_observer.js +41 -0
  613. package/dist/es2017/core/init/utils/create_core_playback_observer.d.ts +61 -0
  614. package/dist/es2017/core/init/utils/create_core_playback_observer.js +122 -0
  615. package/dist/es2017/core/init/utils/create_media_source.d.ts +3 -3
  616. package/dist/es2017/core/init/utils/create_media_source.js +28 -37
  617. package/dist/es2017/core/init/utils/get_initial_time.d.ts +2 -2
  618. package/dist/es2017/core/init/utils/get_initial_time.js +6 -5
  619. package/dist/es2017/core/init/utils/get_loaded_reference.js +7 -5
  620. package/dist/es2017/core/init/utils/initial_seek_and_play.d.ts +9 -11
  621. package/dist/es2017/core/init/utils/initial_seek_and_play.js +167 -89
  622. package/dist/es2017/core/init/utils/initialize_content_decryption.d.ts +7 -1
  623. package/dist/es2017/core/init/utils/initialize_content_decryption.js +6 -0
  624. package/dist/es2017/core/init/utils/main_thread_text_displayer_interface.d.ts +35 -0
  625. package/dist/es2017/core/init/utils/main_thread_text_displayer_interface.js +50 -0
  626. package/dist/es2017/core/init/utils/rebuffering_controller.d.ts +5 -38
  627. package/dist/es2017/core/init/utils/rebuffering_controller.js +30 -150
  628. package/dist/es2017/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.d.ts +2 -2
  629. package/dist/es2017/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.js +24 -1
  630. package/dist/es2017/core/init/utils/stream_events_emitter/stream_events_emitter.d.ts +3 -2
  631. package/dist/es2017/core/init/utils/stream_events_emitter/stream_events_emitter.js +8 -6
  632. package/dist/es2017/core/segment_buffers/garbage_collector.d.ts +3 -1
  633. package/dist/es2017/core/segment_buffers/garbage_collector.js +15 -7
  634. package/dist/es2017/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +26 -74
  635. package/dist/es2017/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +111 -287
  636. package/dist/es2017/core/segment_buffers/implementations/index.d.ts +2 -1
  637. package/dist/es2017/core/segment_buffers/implementations/index.js +1 -1
  638. package/dist/es2017/core/segment_buffers/implementations/text/index.d.ts +3 -0
  639. package/dist/es2017/core/segment_buffers/implementations/text/index.js +2 -0
  640. package/dist/es2017/core/segment_buffers/implementations/text/text_segment_buffer.d.ts +89 -0
  641. package/dist/es2017/core/segment_buffers/implementations/text/text_segment_buffer.js +152 -0
  642. package/dist/es2017/core/segment_buffers/implementations/types.d.ts +46 -57
  643. package/dist/es2017/core/segment_buffers/implementations/types.js +22 -29
  644. package/dist/es2017/core/segment_buffers/index.d.ts +4 -4
  645. package/dist/es2017/core/segment_buffers/inventory/index.d.ts +2 -2
  646. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.d.ts +47 -16
  647. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.js +71 -30
  648. package/dist/es2017/core/segment_buffers/segment_buffers_store.d.ts +7 -16
  649. package/dist/es2017/core/segment_buffers/segment_buffers_store.js +14 -23
  650. package/dist/es2017/core/stream/adaptation/adaptation_stream.js +14 -7
  651. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.d.ts +20 -6
  652. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.js +35 -55
  653. package/dist/es2017/core/stream/adaptation/types.d.ts +17 -28
  654. package/dist/es2017/core/stream/index.d.ts +2 -1
  655. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts +4 -4
  656. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
  657. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +27 -20
  658. package/dist/es2017/core/stream/period/period_stream.js +58 -27
  659. package/dist/es2017/core/stream/period/types.d.ts +13 -7
  660. package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
  661. package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.js +48 -73
  662. package/dist/es2017/core/stream/representation/representation_stream.js +7 -6
  663. package/dist/es2017/core/stream/representation/types.d.ts +32 -5
  664. package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.d.ts +5 -2
  665. package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.js +29 -13
  666. package/dist/es2017/core/stream/representation/utils/get_buffer_status.d.ts +2 -2
  667. package/dist/es2017/core/stream/representation/utils/get_buffer_status.js +23 -13
  668. package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts +2 -2
  669. package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +2 -6
  670. package/dist/es2017/core/stream/representation/utils/push_init_segment.d.ts +3 -1
  671. package/dist/es2017/core/stream/representation/utils/push_init_segment.js +2 -3
  672. package/dist/es2017/core/stream/representation/utils/push_media_segment.d.ts +3 -1
  673. package/dist/es2017/core/stream/representation/utils/push_media_segment.js +2 -3
  674. package/dist/es2017/default_config.d.ts +38 -50
  675. package/dist/es2017/default_config.js +60 -63
  676. package/dist/es2017/errors/encrypted_media_error.d.ts +17 -0
  677. package/dist/es2017/errors/encrypted_media_error.js +13 -0
  678. package/dist/es2017/errors/error_codes.d.ts +4 -3
  679. package/dist/es2017/errors/error_codes.js +3 -7
  680. package/dist/es2017/errors/index.d.ts +7 -8
  681. package/dist/es2017/errors/index.js +2 -3
  682. package/dist/es2017/errors/media_error.d.ts +21 -18
  683. package/dist/es2017/errors/media_error.js +15 -19
  684. package/dist/es2017/errors/network_error.d.ts +15 -1
  685. package/dist/es2017/errors/network_error.js +12 -0
  686. package/dist/es2017/errors/other_error.d.ts +14 -0
  687. package/dist/es2017/errors/other_error.js +12 -0
  688. package/dist/es2017/errors/source_buffer_error.d.ts +40 -0
  689. package/dist/es2017/errors/source_buffer_error.js +41 -0
  690. package/dist/es2017/experimental/features/index.d.ts +1 -2
  691. package/dist/es2017/experimental/features/index.js +1 -2
  692. package/dist/es2017/experimental/features/local.js +3 -1
  693. package/dist/es2017/experimental/features/metaplaylist.js +3 -1
  694. package/dist/es2017/experimental/features/multi_thread.d.ts +8 -0
  695. package/dist/es2017/experimental/features/multi_thread.js +11 -0
  696. package/dist/es2017/experimental/tools/VideoThumbnailLoader/load_and_push_segment.d.ts +3 -3
  697. package/dist/es2017/experimental/tools/VideoThumbnailLoader/load_and_push_segment.js +11 -15
  698. package/dist/es2017/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts +3 -3
  699. package/dist/es2017/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +25 -18
  700. package/dist/es2017/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.d.ts +3 -5
  701. package/dist/es2017/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.js +4 -5
  702. package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +17 -12
  703. package/dist/es2017/experimental/tools/index.d.ts +1 -2
  704. package/dist/es2017/experimental/tools/index.js +1 -2
  705. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/index.d.ts +2 -0
  706. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +4 -4
  707. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +1 -1
  708. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -1
  709. package/dist/es2017/features/features_object.js +5 -3
  710. package/dist/es2017/features/list/dash.js +3 -1
  711. package/dist/es2017/{experimental/features → features/list}/dash_wasm.js +3 -1
  712. package/dist/es2017/features/list/html_sami_parser.js +2 -2
  713. package/dist/es2017/features/list/html_srt_parser.js +2 -2
  714. package/dist/es2017/features/list/html_text_buffer.js +2 -2
  715. package/dist/es2017/features/list/html_ttml_parser.js +2 -2
  716. package/dist/es2017/features/list/html_vtt_parser.js +2 -2
  717. package/dist/es2017/features/list/index.d.ts +3 -0
  718. package/dist/es2017/features/list/index.js +3 -0
  719. package/dist/es2017/features/list/media_source_main.d.ts +8 -0
  720. package/dist/es2017/features/list/media_source_main.js +11 -0
  721. package/dist/es2017/features/list/native_sami_parser.js +2 -3
  722. package/dist/es2017/features/list/native_srt_parser.js +2 -3
  723. package/dist/es2017/features/list/native_text_buffer.js +2 -3
  724. package/dist/es2017/features/list/native_ttml_parser.js +2 -3
  725. package/dist/es2017/features/list/native_vtt_parser.js +2 -3
  726. package/dist/es2017/features/list/smooth.d.ts +1 -1
  727. package/dist/es2017/features/list/smooth.js +7 -3
  728. package/dist/es2017/features/types.d.ts +28 -5
  729. package/dist/es2017/manifest/adaptation.d.ts +66 -44
  730. package/dist/es2017/manifest/adaptation.js +60 -78
  731. package/dist/es2017/manifest/index.d.ts +4 -3
  732. package/dist/es2017/manifest/index.js +2 -2
  733. package/dist/es2017/manifest/manifest.d.ts +132 -9
  734. package/dist/es2017/manifest/manifest.js +73 -53
  735. package/dist/es2017/manifest/period.d.ts +41 -3
  736. package/dist/es2017/manifest/period.js +87 -24
  737. package/dist/es2017/manifest/representation.d.ts +61 -74
  738. package/dist/es2017/manifest/representation.js +111 -55
  739. package/dist/es2017/manifest/types.d.ts +382 -0
  740. package/dist/es2017/manifest/types.js +0 -15
  741. package/dist/es2017/manifest/update_period_in_place.d.ts +12 -9
  742. package/dist/es2017/manifest/update_period_in_place.js +11 -7
  743. package/dist/es2017/manifest/update_periods.d.ts +7 -4
  744. package/dist/es2017/manifest/update_periods.js +54 -15
  745. package/dist/es2017/manifest/utils.d.ts +156 -0
  746. package/dist/es2017/manifest/utils.js +470 -0
  747. package/dist/es2017/minimal.d.ts +3 -0
  748. package/dist/es2017/minimal.js +6 -0
  749. package/dist/es2017/mse/index.d.ts +1 -0
  750. package/dist/es2017/mse/index.js +1 -0
  751. package/dist/es2017/mse/main_codec_support_prober.d.ts +26 -0
  752. package/dist/es2017/mse/main_codec_support_prober.js +41 -0
  753. package/dist/es2017/mse/main_media_source_interface.d.ts +112 -0
  754. package/dist/es2017/mse/main_media_source_interface.js +406 -0
  755. package/dist/es2017/mse/types.d.ts +301 -0
  756. package/dist/es2017/mse/types.js +1 -0
  757. package/dist/es2017/mse/worker_codec_support_prober.d.ts +42 -0
  758. package/dist/es2017/mse/worker_codec_support_prober.js +58 -0
  759. package/dist/es2017/mse/worker_media_source_interface.d.ts +105 -0
  760. package/dist/es2017/mse/worker_media_source_interface.js +303 -0
  761. package/dist/es2017/multithread_types.d.ts +781 -0
  762. package/dist/es2017/multithread_types.js +6 -0
  763. package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +15 -16
  764. package/dist/es2017/parsers/manifest/dash/js-parser/parse_from_document.js +1 -1
  765. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts +1 -1
  766. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +21 -5
  767. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/types.d.ts +55 -55
  768. package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +13 -1
  769. package/dist/es2017/parsers/manifest/smooth/parse_protection_node.js +1 -1
  770. package/dist/es2017/parsers/manifest/types.d.ts +8 -1
  771. package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  772. package/dist/es2017/public_types.d.ts +95 -23
  773. package/dist/es2017/public_types.js +3 -13
  774. package/dist/es2017/{core/segment_buffers/implementations/text/html/parsers.d.ts → text_displayer/html/html_parsers.d.ts} +0 -15
  775. package/dist/es2017/{core/segment_buffers/implementations/text/html/parsers.js → text_displayer/html/html_parsers.js} +2 -17
  776. package/dist/es2017/text_displayer/html/html_text_displayer.d.ts +100 -0
  777. package/dist/es2017/{core/segment_buffers/implementations/text/html/html_text_segment_buffer.js → text_displayer/html/html_text_displayer.js} +81 -153
  778. package/dist/es2017/text_displayer/html/index.d.ts +2 -0
  779. package/dist/es2017/text_displayer/html/index.js +2 -0
  780. package/dist/{commonjs/core/segment_buffers/implementations/text → es2017/text_displayer}/html/text_track_cues_store.d.ts +4 -18
  781. package/dist/es2017/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.js +6 -18
  782. package/dist/es2017/text_displayer/html/update_proportional_elements.d.ts +15 -0
  783. package/dist/es2017/{core/segment_buffers/implementations/text → text_displayer}/html/update_proportional_elements.js +0 -15
  784. package/dist/es2017/{core/segment_buffers/implementations/text → text_displayer}/html/utils.d.ts +10 -16
  785. package/dist/es2017/{core/segment_buffers/implementations/text → text_displayer}/html/utils.js +1 -17
  786. package/dist/es2017/text_displayer/index.d.ts +2 -0
  787. package/dist/es2017/text_displayer/index.js +1 -0
  788. package/dist/es2017/text_displayer/manual_time_ranges.d.ts +14 -0
  789. package/dist/es2017/text_displayer/manual_time_ranges.js +48 -0
  790. package/dist/es2017/text_displayer/native/index.d.ts +2 -0
  791. package/dist/es2017/text_displayer/native/index.js +2 -0
  792. package/dist/es2017/text_displayer/native/native_parsers.d.ts +11 -0
  793. package/dist/es2017/{core/segment_buffers/implementations/text/native/parsers.js → text_displayer/native/native_parsers.js} +2 -17
  794. package/dist/es2017/text_displayer/native/native_text_displayer.d.ts +56 -0
  795. package/dist/es2017/text_displayer/native/native_text_displayer.js +203 -0
  796. package/dist/es2017/text_displayer/types.d.ts +74 -0
  797. package/dist/es2017/text_displayer/types.js +1 -0
  798. package/dist/es2017/tools/TextTrackRenderer/text_track_renderer.d.ts +1 -1
  799. package/dist/es2017/tools/TextTrackRenderer/text_track_renderer.js +12 -17
  800. package/dist/es2017/tools/index.d.ts +2 -1
  801. package/dist/es2017/tools/index.js +4 -2
  802. package/dist/es2017/{experimental/tools → tools}/parseBIFThumbnails/index.js +1 -1
  803. package/dist/es2017/transports/dash/extract_complete_chunks.d.ts +1 -1
  804. package/dist/es2017/transports/dash/extract_complete_chunks.js +11 -7
  805. package/dist/es2017/transports/dash/get_events_out_of_emsgs.js +0 -1
  806. package/dist/es2017/transports/dash/low_latency_segment_loader.js +2 -2
  807. package/dist/es2017/transports/utils/generate_manifest_loader.js +1 -1
  808. package/dist/es2017/utils/assert.d.ts +41 -0
  809. package/dist/es2017/utils/assert.js +47 -1
  810. package/dist/es2017/utils/event_emitter.js +8 -2
  811. package/dist/es2017/utils/languages/ISO_639-1_to_ISO_639-3.js +182 -182
  812. package/dist/es2017/utils/languages/ISO_639-2_to_ISO_639-3.js +19 -19
  813. package/dist/es2017/utils/logger.d.ts +13 -3
  814. package/dist/es2017/utils/logger.js +30 -14
  815. package/dist/es2017/utils/monotonic_timestamp.d.ts +20 -4
  816. package/dist/es2017/utils/monotonic_timestamp.js +21 -5
  817. package/dist/es2017/utils/object_assign.d.ts +26 -5
  818. package/dist/es2017/utils/object_assign.js +14 -3
  819. package/dist/es2017/utils/request/fetch.js +7 -7
  820. package/dist/es2017/utils/request/index.d.ts +2 -1
  821. package/dist/es2017/utils/request/index.js +2 -1
  822. package/dist/es2017/{errors → utils/request}/request_error.d.ts +12 -3
  823. package/dist/es2017/{errors → utils/request}/request_error.js +10 -0
  824. package/dist/es2017/utils/request/xhr.d.ts +4 -4
  825. package/dist/es2017/utils/request/xhr.js +7 -7
  826. package/dist/es2017/utils/retry_promise_with_backoff.d.ts +1 -2
  827. package/dist/es2017/utils/string_parsing.js +1 -1
  828. package/dist/es2017/utils/sync_or_async.d.ts +70 -0
  829. package/dist/es2017/utils/sync_or_async.js +45 -0
  830. package/dist/es2017/worker_entry_point.d.ts +5 -0
  831. package/dist/es2017/worker_entry_point.js +6 -0
  832. package/dist/mpd-parser.wasm +0 -0
  833. package/dist/rx-player.js +8867 -6771
  834. package/dist/rx-player.min.js +1 -1
  835. package/dist/worker.js +3 -0
  836. package/package.json +91 -83
  837. package/scripts/build_demo.mjs +31 -2
  838. package/scripts/bundle_worker.mjs +143 -0
  839. package/scripts/canal-release.patch +78 -0
  840. package/scripts/generate_build.mjs +185 -0
  841. package/scripts/generate_embeds.mjs +145 -0
  842. package/scripts/make-dev-releases +90 -0
  843. package/scripts/update-version +9 -4
  844. package/scripts/wasm-optimize.mjs +63 -0
  845. package/scripts/wasm-strip.mjs +6 -0
  846. package/sonar-project.properties +1 -1
  847. package/src/README.md +8 -1
  848. package/src/TODO_README.md +231 -0
  849. package/src/__GENERATED_CODE/embedded_dash_wasm.ts +3 -0
  850. package/src/__GENERATED_CODE/embedded_worker.ts +3 -0
  851. package/src/__GENERATED_CODE/index.ts +2 -0
  852. package/src/compat/README.md +7 -0
  853. package/src/compat/__tests__/browser_compatibility_types.test.ts +9 -9
  854. package/src/compat/__tests__/is_vtt_cue.test.ts +1 -1
  855. package/src/compat/__tests__/make_vtt_cue.test.ts +1 -1
  856. package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +1 -1
  857. package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +1 -1
  858. package/src/compat/browser_compatibility_types.ts +1 -1
  859. package/src/compat/browser_detection.ts +23 -3
  860. package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -1
  861. package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -1
  862. package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +4 -3
  863. package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -1
  864. package/src/compat/eme/eme-api-implementation.ts +3 -3
  865. package/src/compat/event_listeners.ts +1 -1
  866. package/src/compat/has_mse_in_worker.ts +5 -0
  867. package/src/compat/has_webassembly.ts +7 -0
  868. package/src/compat/index.ts +0 -2
  869. package/src/compat/is_codec_supported.ts +5 -0
  870. package/src/compat/is_vtt_cue.ts +1 -1
  871. package/src/compat/make_vtt_cue.ts +1 -1
  872. package/src/compat/on_height_width_change.ts +1 -1
  873. package/src/compat/patch_webkit_source_buffer.ts +2 -2
  874. package/src/config.ts +4 -12
  875. package/src/core/README.md +7 -0
  876. package/src/core/adaptive/README.md +11 -0
  877. package/src/core/adaptive/adaptive_representation_selector.ts +7 -24
  878. package/src/core/adaptive/network_analyzer.ts +3 -3
  879. package/src/core/api/README.md +7 -0
  880. package/src/core/api/__tests__/option_utils.test.ts +8 -0
  881. package/src/core/api/__tests__/public_api.test.ts +13 -25
  882. package/src/core/api/debug/modules/general_info.ts +13 -3
  883. package/src/core/api/debug/modules/segment_buffer_content.ts +11 -10
  884. package/src/core/api/index.ts +1 -0
  885. package/src/core/api/option_utils.ts +20 -7
  886. package/src/core/api/playback_observer.ts +483 -186
  887. package/src/core/api/public_api.ts +405 -188
  888. package/src/core/api/track_management/README.md +7 -0
  889. package/src/core/api/track_management/track_dispatcher.ts +48 -36
  890. package/src/core/api/track_management/tracks_store.ts +162 -100
  891. package/src/core/api/utils.ts +3 -1
  892. package/src/core/decrypt/README.md +8 -0
  893. package/src/core/decrypt/attach_media_keys.ts +5 -2
  894. package/src/core/decrypt/content_decryptor.ts +40 -117
  895. package/src/core/decrypt/get_media_keys.ts +2 -8
  896. package/src/core/decrypt/init_media_keys.ts +10 -1
  897. package/src/core/decrypt/types.ts +17 -8
  898. package/src/core/decrypt/utils/check_key_statuses.ts +1 -1
  899. package/src/core/fetchers/README.md +11 -0
  900. package/src/{utils → core/fetchers/segment}/__tests__/initialization_segment_cache.test.ts +1 -1
  901. package/src/{utils → core/fetchers/segment}/initialization_segment_cache.ts +1 -1
  902. package/src/core/fetchers/segment/segment_fetcher.ts +2 -3
  903. package/src/core/fetchers/utils/error_selector.ts +1 -1
  904. package/src/core/fetchers/utils/schedule_request.ts +1 -1
  905. package/src/core/init/README.md +15 -0
  906. package/src/core/init/directfile_content_initializer.ts +15 -16
  907. package/src/core/init/media_source_content_initializer.ts +291 -154
  908. package/src/core/init/multithread/main_thread/multi_thread_content_initializer.ts +1832 -0
  909. package/src/core/init/multithread/main_thread/send_message.ts +15 -0
  910. package/src/core/init/multithread/worker/content_preparer.ts +392 -0
  911. package/src/core/init/multithread/worker/globals.ts +36 -0
  912. package/src/core/init/multithread/worker/index.ts +2 -0
  913. package/src/core/init/multithread/worker/send_message.ts +29 -0
  914. package/src/core/init/multithread/worker/track_choice_setter.ts +166 -0
  915. package/src/core/init/multithread/worker/worker_playback_observer.ts +79 -0
  916. package/src/core/init/multithread/worker/worker_portal.ts +859 -0
  917. package/src/core/init/multithread/worker/worker_text_displayer_interface.ts +162 -0
  918. package/src/core/init/types.ts +25 -15
  919. package/src/core/init/utils/DecipherabilityFreezeDetector.ts +133 -0
  920. package/src/core/init/utils/content_time_boundaries_observer.ts +1 -1
  921. package/src/core/init/utils/create_content_time_boundaries_observer.ts +71 -0
  922. package/src/core/init/utils/create_core_playback_observer.ts +199 -0
  923. package/src/core/init/utils/create_media_source.ts +31 -49
  924. package/src/core/init/utils/get_initial_time.ts +12 -7
  925. package/src/core/init/utils/get_loaded_reference.ts +7 -5
  926. package/src/core/init/utils/initial_seek_and_play.ts +183 -103
  927. package/src/core/init/utils/initialize_content_decryption.ts +19 -2
  928. package/src/core/init/utils/main_thread_text_displayer_interface.ts +59 -0
  929. package/src/core/init/utils/rebuffering_controller.ts +44 -197
  930. package/src/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.ts +27 -3
  931. package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +13 -10
  932. package/src/core/segment_buffers/README.md +11 -0
  933. package/src/core/segment_buffers/garbage_collector.ts +16 -6
  934. package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +145 -419
  935. package/src/core/segment_buffers/implementations/index.ts +5 -1
  936. package/src/core/segment_buffers/implementations/text/index.ts +6 -0
  937. package/src/core/segment_buffers/implementations/text/text_segment_buffer.ts +249 -0
  938. package/src/core/segment_buffers/implementations/types.ts +50 -69
  939. package/src/core/segment_buffers/index.ts +10 -11
  940. package/src/core/segment_buffers/inventory/index.ts +2 -0
  941. package/src/core/segment_buffers/inventory/segment_inventory.ts +137 -39
  942. package/src/core/segment_buffers/segment_buffers_store.ts +29 -39
  943. package/src/core/stream/README.md +10 -0
  944. package/src/core/stream/adaptation/adaptation_stream.ts +19 -7
  945. package/src/core/stream/adaptation/get_representations_switch_strategy.ts +62 -77
  946. package/src/core/stream/adaptation/types.ts +18 -29
  947. package/src/core/stream/index.ts +2 -0
  948. package/src/core/stream/orchestrator/README.md +10 -0
  949. package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +7 -8
  950. package/src/core/stream/orchestrator/stream_orchestrator.ts +26 -21
  951. package/src/core/stream/period/period_stream.ts +61 -34
  952. package/src/core/stream/period/types.ts +12 -7
  953. package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +54 -92
  954. package/src/core/stream/representation/README.md +10 -0
  955. package/src/core/stream/representation/representation_stream.ts +7 -7
  956. package/src/core/stream/representation/types.ts +33 -5
  957. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +35 -17
  958. package/src/core/stream/representation/utils/get_buffer_status.ts +33 -17
  959. package/src/core/stream/representation/utils/get_needed_segments.ts +6 -12
  960. package/src/core/stream/representation/utils/push_init_segment.ts +8 -5
  961. package/src/core/stream/representation/utils/push_media_segment.ts +8 -5
  962. package/src/default_config.ts +53 -57
  963. package/src/errors/README.md +11 -0
  964. package/src/errors/__tests__/is_known_error.test.ts +1 -7
  965. package/src/errors/__tests__/network_error.test.ts +1 -1
  966. package/src/errors/encrypted_media_error.ts +25 -0
  967. package/src/errors/error_codes.ts +5 -13
  968. package/src/errors/index.ts +20 -9
  969. package/src/errors/media_error.ts +32 -50
  970. package/src/errors/network_error.ts +25 -1
  971. package/src/errors/other_error.ts +21 -0
  972. package/src/errors/source_buffer_error.ts +63 -0
  973. package/src/experimental/features/__tests__/index.test.ts +0 -6
  974. package/src/experimental/features/__tests__/local.test.ts +6 -2
  975. package/src/experimental/features/__tests__/metaplaylist.test.ts +6 -2
  976. package/src/experimental/features/__tests__/multi_thread.test.ts +18 -0
  977. package/src/experimental/features/index.ts +1 -2
  978. package/src/experimental/features/local.ts +3 -1
  979. package/src/experimental/features/metaplaylist.ts +3 -1
  980. package/src/experimental/features/multi_thread.ts +16 -0
  981. package/src/experimental/tools/VideoThumbnailLoader/load_and_push_segment.ts +13 -19
  982. package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +29 -20
  983. package/src/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.ts +7 -12
  984. package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +23 -21
  985. package/src/experimental/tools/index.ts +0 -2
  986. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +1 -1
  987. package/src/experimental/tools/mediaCapabilitiesProber/index.ts +2 -0
  988. package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -4
  989. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +1 -1
  990. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -1
  991. package/src/features/features_object.ts +5 -3
  992. package/src/features/list/__tests__/dash.test.ts +7 -3
  993. package/src/features/list/__tests__/html_sami_parser.test.ts +3 -3
  994. package/src/features/list/__tests__/html_srt_parser.test.ts +2 -3
  995. package/src/features/list/__tests__/html_text_buffer.test.ts +3 -4
  996. package/src/features/list/__tests__/html_ttml_parser.test.ts +2 -3
  997. package/src/features/list/__tests__/html_vtt_parser.test.ts +2 -3
  998. package/src/features/list/__tests__/index.test.ts +6 -0
  999. package/src/features/list/__tests__/native_sami_parser.test.ts +3 -3
  1000. package/src/features/list/__tests__/native_srt_parser.test.ts +2 -2
  1001. package/src/features/list/__tests__/native_text_buffer.test.ts +3 -4
  1002. package/src/features/list/__tests__/native_ttml_parser.test.ts +2 -3
  1003. package/src/features/list/__tests__/native_vtt_parser.test.ts +2 -3
  1004. package/src/features/list/__tests__/smooth.test.ts +5 -3
  1005. package/src/features/list/dash.ts +3 -1
  1006. package/src/{experimental/features → features/list}/dash_wasm.ts +3 -1
  1007. package/src/features/list/html_sami_parser.ts +2 -2
  1008. package/src/features/list/html_srt_parser.ts +2 -2
  1009. package/src/features/list/html_text_buffer.ts +2 -2
  1010. package/src/features/list/html_ttml_parser.ts +2 -2
  1011. package/src/features/list/html_vtt_parser.ts +2 -2
  1012. package/src/features/list/index.ts +3 -0
  1013. package/src/features/list/media_source_main.ts +14 -0
  1014. package/src/features/list/native_sami_parser.ts +2 -3
  1015. package/src/features/list/native_srt_parser.ts +2 -3
  1016. package/src/features/list/native_text_buffer.ts +2 -3
  1017. package/src/features/list/native_ttml_parser.ts +2 -3
  1018. package/src/features/list/native_vtt_parser.ts +2 -3
  1019. package/src/features/list/smooth.ts +8 -3
  1020. package/src/features/types.ts +29 -5
  1021. package/src/manifest/__tests__/adaptation.test.ts +3 -62
  1022. package/src/manifest/__tests__/manifest.test.ts +37 -26
  1023. package/src/manifest/__tests__/representation.test.ts +360 -142
  1024. package/src/manifest/__tests__/update_period_in_place.test.ts +406 -324
  1025. package/src/manifest/__tests__/update_periods.test.ts +240 -162
  1026. package/src/manifest/adaptation.ts +115 -131
  1027. package/src/manifest/index.ts +40 -2
  1028. package/src/manifest/manifest.ts +120 -61
  1029. package/src/manifest/period.ts +113 -28
  1030. package/src/manifest/representation.ts +150 -137
  1031. package/src/manifest/types.ts +407 -0
  1032. package/src/manifest/update_period_in_place.ts +31 -18
  1033. package/src/manifest/update_periods.ts +71 -19
  1034. package/src/manifest/utils.ts +686 -0
  1035. package/src/minimal.ts +7 -0
  1036. package/src/mse/README.md +33 -0
  1037. package/src/mse/index.ts +7 -0
  1038. package/src/mse/main_codec_support_prober.ts +52 -0
  1039. package/src/mse/main_media_source_interface.ts +569 -0
  1040. package/src/mse/types.ts +318 -0
  1041. package/src/mse/worker_codec_support_prober.ts +79 -0
  1042. package/src/mse/worker_media_source_interface.ts +468 -0
  1043. package/src/multithread_types.ts +942 -0
  1044. package/src/parsers/README.md +7 -0
  1045. package/src/parsers/manifest/dash/common/parse_periods.ts +15 -18
  1046. package/src/parsers/manifest/dash/js-parser/parse_from_document.ts +1 -1
  1047. package/src/parsers/manifest/dash/wasm-parser/README.md +18 -14
  1048. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +22 -6
  1049. package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +13 -1
  1050. package/src/parsers/manifest/types.ts +5 -1
  1051. package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.test.ts +1 -1
  1052. package/src/parsers/texttracks/ttml/html/apply_line_height.ts +3 -1
  1053. package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +1 -1
  1054. package/src/public_types.ts +101 -23
  1055. package/src/{core/segment_buffers/implementations/text → text_displayer}/html/__tests__/utils.test.ts +1 -1
  1056. package/src/{core/segment_buffers/implementations/text/html/parsers.ts → text_displayer/html/html_parsers.ts} +2 -18
  1057. package/src/{core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts → text_displayer/html/html_text_displayer.ts} +107 -190
  1058. package/src/text_displayer/html/index.ts +2 -0
  1059. package/src/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.ts +8 -22
  1060. package/src/{core/segment_buffers/implementations/text → text_displayer}/html/update_proportional_elements.ts +0 -16
  1061. package/src/{core/segment_buffers/implementations/text → text_displayer}/html/utils.ts +8 -21
  1062. package/src/text_displayer/index.ts +9 -0
  1063. package/src/text_displayer/manual_time_ranges.ts +64 -0
  1064. package/src/text_displayer/native/index.ts +3 -0
  1065. package/src/{core/segment_buffers/implementations/text/native/parsers.ts → text_displayer/native/native_parsers.ts} +4 -19
  1066. package/src/text_displayer/native/native_text_displayer.ts +268 -0
  1067. package/src/text_displayer/types.ts +76 -0
  1068. package/src/tools/TextTrackRenderer/text_track_renderer.ts +13 -18
  1069. package/src/tools/index.ts +5 -1
  1070. package/src/{experimental/tools → tools}/parseBIFThumbnails/index.ts +1 -1
  1071. package/src/transports/dash/extract_complete_chunks.ts +12 -8
  1072. package/src/transports/dash/get_events_out_of_emsgs.ts +0 -1
  1073. package/src/transports/dash/low_latency_segment_loader.ts +2 -2
  1074. package/src/transports/utils/generate_manifest_loader.ts +1 -1
  1075. package/src/utils/README.md +7 -0
  1076. package/src/utils/__tests__/assert.test.ts +31 -0
  1077. package/src/utils/__tests__/base64.test.ts +1 -1
  1078. package/src/utils/__tests__/event_emitter.test.ts +0 -24
  1079. package/src/utils/__tests__/id_generator.test.ts +1 -1
  1080. package/src/utils/__tests__/object_assign.test.ts +15 -0
  1081. package/src/utils/assert.ts +53 -1
  1082. package/src/utils/event_emitter.ts +8 -2
  1083. package/src/utils/logger.ts +45 -15
  1084. package/src/utils/monotonic_timestamp.ts +24 -5
  1085. package/src/utils/object_assign.ts +46 -14
  1086. package/src/utils/request/fetch.ts +9 -10
  1087. package/src/utils/request/index.ts +10 -0
  1088. package/src/{errors → utils/request}/request_error.ts +27 -4
  1089. package/src/utils/request/xhr.ts +13 -12
  1090. package/src/utils/retry_promise_with_backoff.ts +1 -2
  1091. package/src/utils/string_parsing.ts +1 -1
  1092. package/src/utils/sync_or_async.ts +90 -0
  1093. package/src/worker_entry_point.ts +7 -0
  1094. package/tsconfig.dev.commonjs.json +7 -0
  1095. package/tsconfig.dev.json +10 -0
  1096. package/tsconfig.jest.json +0 -1
  1097. package/tsconfig.json +1 -2
  1098. package/dist/_esm5.processed/core/api/track_management/index.d.ts +0 -18
  1099. package/dist/_esm5.processed/core/api/track_management/index.js +0 -18
  1100. package/dist/_esm5.processed/core/api/track_management/track_dispatcher.d.ts +0 -84
  1101. package/dist/_esm5.processed/core/api/track_management/track_dispatcher.js +0 -158
  1102. package/dist/_esm5.processed/core/api/track_management/tracks_store.d.ts +0 -406
  1103. package/dist/_esm5.processed/core/api/track_management/tracks_store.js +0 -932
  1104. package/dist/_esm5.processed/core/segment_buffers/inventory/utils.d.ts +0 -33
  1105. package/dist/_esm5.processed/core/segment_buffers/inventory/utils.js +0 -49
  1106. package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.d.ts +0 -39
  1107. package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.js +0 -133
  1108. package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.d.ts +0 -119
  1109. package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.js +0 -159
  1110. package/dist/_esm5.processed/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  1111. package/dist/_esm5.processed/parsers/manifest/utils/is_segment_still_available.js +0 -51
  1112. package/dist/commonjs/core/init/utils/create_stream_playback_observer.d.ts +0 -45
  1113. package/dist/commonjs/core/init/utils/create_stream_playback_observer.js +0 -89
  1114. package/dist/commonjs/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +0 -141
  1115. package/dist/commonjs/core/segment_buffers/implementations/text/html/types.d.ts +0 -25
  1116. package/dist/commonjs/core/segment_buffers/implementations/text/html/types.js +0 -17
  1117. package/dist/commonjs/core/segment_buffers/implementations/text/native/index.d.ts +0 -17
  1118. package/dist/commonjs/core/segment_buffers/implementations/text/native/index.js +0 -19
  1119. package/dist/commonjs/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +0 -83
  1120. package/dist/commonjs/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +0 -273
  1121. package/dist/commonjs/core/segment_buffers/implementations/text/native/parsers.d.ts +0 -26
  1122. package/dist/commonjs/core/stream/representation/utils/force_garbage_collection.d.ts +0 -29
  1123. package/dist/commonjs/core/stream/representation/utils/force_garbage_collection.js +0 -179
  1124. package/dist/commonjs/errors/assertion_error.d.ts +0 -31
  1125. package/dist/commonjs/errors/assertion_error.js +0 -56
  1126. package/dist/commonjs/utils/assert_unreachable.d.ts +0 -40
  1127. package/dist/commonjs/utils/assert_unreachable.js +0 -46
  1128. package/dist/es2017/core/init/utils/create_stream_playback_observer.d.ts +0 -45
  1129. package/dist/es2017/core/init/utils/create_stream_playback_observer.js +0 -85
  1130. package/dist/es2017/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +0 -141
  1131. package/dist/es2017/core/segment_buffers/implementations/text/html/index.js +0 -21
  1132. package/dist/es2017/core/segment_buffers/implementations/text/html/types.d.ts +0 -25
  1133. package/dist/es2017/core/segment_buffers/implementations/text/html/types.js +0 -16
  1134. package/dist/es2017/core/segment_buffers/implementations/text/html/update_proportional_elements.d.ts +0 -30
  1135. package/dist/es2017/core/segment_buffers/implementations/text/native/index.d.ts +0 -17
  1136. package/dist/es2017/core/segment_buffers/implementations/text/native/index.js +0 -17
  1137. package/dist/es2017/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +0 -83
  1138. package/dist/es2017/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +0 -251
  1139. package/dist/es2017/core/segment_buffers/implementations/text/native/parsers.d.ts +0 -26
  1140. package/dist/es2017/core/stream/representation/utils/force_garbage_collection.d.ts +0 -29
  1141. package/dist/es2017/core/stream/representation/utils/force_garbage_collection.js +0 -91
  1142. package/dist/es2017/errors/assertion_error.d.ts +0 -31
  1143. package/dist/es2017/errors/assertion_error.js +0 -35
  1144. package/dist/es2017/utils/assert_unreachable.d.ts +0 -40
  1145. package/dist/es2017/utils/assert_unreachable.js +0 -43
  1146. package/dist/rx-player.d.ts +0 -3
  1147. package/dist/rx-player.min.d.ts +0 -3
  1148. package/experimental/features/index.d.ts +0 -16
  1149. package/experimental/features/index.js +0 -16
  1150. package/experimental/tools/VideoThumbnailLoader.d.ts +0 -18
  1151. package/experimental/tools/VideoThumbnailLoader.js +0 -18
  1152. package/experimental/tools/createMetaplaylist.d.ts +0 -18
  1153. package/experimental/tools/createMetaplaylist.js +0 -18
  1154. package/experimental/tools/index.d.ts +0 -16
  1155. package/experimental/tools/index.js +0 -16
  1156. package/experimental/tools/mediaCapabilitiesProber.d.ts +0 -18
  1157. package/experimental/tools/mediaCapabilitiesProber.js +0 -18
  1158. package/experimental/tools/parseBIFThumbnails.d.ts +0 -18
  1159. package/experimental/tools/parseBIFThumbnails.js +0 -18
  1160. package/features/index.d.ts +0 -16
  1161. package/features/index.js +0 -16
  1162. package/logger/index.d.ts +0 -17
  1163. package/logger/index.js +0 -17
  1164. package/minimal/index.d.ts +0 -17
  1165. package/minimal/index.js +0 -17
  1166. package/scripts/build/generate_build.mjs +0 -194
  1167. package/scripts/build/templates/experimental/features/index.d.ts +0 -16
  1168. package/scripts/build/templates/experimental/features/index.js +0 -16
  1169. package/scripts/build/templates/experimental/index.d.ts +0 -16
  1170. package/scripts/build/templates/experimental/index.js +0 -16
  1171. package/scripts/build/templates/experimental/tools/VideoThumbnailLoader.d.ts +0 -18
  1172. package/scripts/build/templates/experimental/tools/VideoThumbnailLoader.js +0 -18
  1173. package/scripts/build/templates/experimental/tools/createMetaplaylist.d.ts +0 -18
  1174. package/scripts/build/templates/experimental/tools/createMetaplaylist.js +0 -18
  1175. package/scripts/build/templates/experimental/tools/index.d.ts +0 -16
  1176. package/scripts/build/templates/experimental/tools/index.js +0 -16
  1177. package/scripts/build/templates/experimental/tools/mediaCapabilitiesProber.d.ts +0 -18
  1178. package/scripts/build/templates/experimental/tools/mediaCapabilitiesProber.js +0 -18
  1179. package/scripts/build/templates/experimental/tools/parseBIFThumbnails.d.ts +0 -18
  1180. package/scripts/build/templates/experimental/tools/parseBIFThumbnails.js +0 -18
  1181. package/scripts/build/templates/features/index.d.ts +0 -16
  1182. package/scripts/build/templates/features/index.js +0 -16
  1183. package/scripts/build/templates/logger/index.d.ts +0 -17
  1184. package/scripts/build/templates/logger/index.js +0 -17
  1185. package/scripts/build/templates/minimal/index.d.ts +0 -17
  1186. package/scripts/build/templates/minimal/index.js +0 -17
  1187. package/scripts/build/templates/tools/TextTrackRenderer.d.ts +0 -18
  1188. package/scripts/build/templates/tools/TextTrackRenderer.js +0 -18
  1189. package/scripts/build/templates/tools/index.d.ts +0 -16
  1190. package/scripts/build/templates/tools/index.js +0 -16
  1191. package/scripts/build/templates/tools/string-utils.d.ts +0 -18
  1192. package/scripts/build/templates/tools/string-utils.js +0 -18
  1193. package/scripts/build/templates/types/index.d.ts +0 -16
  1194. package/scripts/build/templates/types/index.js +0 -15
  1195. package/src/core/init/utils/create_stream_playback_observer.ts +0 -132
  1196. package/src/core/segment_buffers/implementations/text/html/index.ts +0 -24
  1197. package/src/core/segment_buffers/implementations/text/html/types.ts +0 -23
  1198. package/src/core/segment_buffers/implementations/text/native/index.ts +0 -19
  1199. package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +0 -335
  1200. package/src/core/stream/representation/utils/force_garbage_collection.ts +0 -113
  1201. package/src/errors/__tests__/assertion_error.test.ts +0 -26
  1202. package/src/errors/assertion_error.ts +0 -40
  1203. package/src/typings/README.md +0 -7
  1204. package/src/utils/__tests__/assert_unreachable.test.ts +0 -40
  1205. package/src/utils/assert_unreachable.ts +0 -45
  1206. package/tools/TextTrackRenderer.d.ts +0 -18
  1207. package/tools/TextTrackRenderer.js +0 -18
  1208. package/tools/index.d.ts +0 -16
  1209. package/tools/index.js +0 -16
  1210. package/tools/string-utils.d.ts +0 -18
  1211. package/tools/string-utils.js +0 -18
  1212. package/types/index.d.ts +0 -16
  1213. package/types/index.js +0 -15
  1214. /package/dist/commonjs/{utils → core/fetchers/segment}/initialization_segment_cache.js +0 -0
  1215. /package/dist/commonjs/{experimental/features → features/list}/dash_wasm.d.ts +0 -0
  1216. /package/dist/commonjs/{experimental/features → features/list}/debug_element.d.ts +0 -0
  1217. /package/dist/commonjs/{experimental/features → features/list}/debug_element.js +0 -0
  1218. /package/dist/commonjs/{experimental/tools → tools}/parseBIFThumbnails/index.d.ts +0 -0
  1219. /package/dist/commonjs/{compat → utils}/global_scope.d.ts +0 -0
  1220. /package/dist/commonjs/{compat → utils}/global_scope.js +0 -0
  1221. /package/dist/commonjs/{compat → utils}/is_node.d.ts +0 -0
  1222. /package/dist/commonjs/{compat → utils}/is_node.js +0 -0
  1223. /package/dist/commonjs/{compat → utils}/is_worker.d.ts +0 -0
  1224. /package/dist/commonjs/{compat → utils}/is_worker.js +0 -0
  1225. /package/dist/es2017/{utils → core/fetchers/segment}/initialization_segment_cache.js +0 -0
  1226. /package/dist/es2017/{experimental/features → features/list}/dash_wasm.d.ts +0 -0
  1227. /package/dist/es2017/{experimental/features → features/list}/debug_element.d.ts +0 -0
  1228. /package/dist/es2017/{experimental/features → features/list}/debug_element.js +0 -0
  1229. /package/dist/es2017/{experimental/tools → tools}/parseBIFThumbnails/index.d.ts +0 -0
  1230. /package/dist/es2017/{compat → utils}/global_scope.d.ts +0 -0
  1231. /package/dist/es2017/{compat → utils}/global_scope.js +0 -0
  1232. /package/dist/es2017/{compat → utils}/is_node.d.ts +0 -0
  1233. /package/dist/es2017/{compat → utils}/is_node.js +0 -0
  1234. /package/dist/es2017/{compat → utils}/is_worker.d.ts +0 -0
  1235. /package/dist/es2017/{compat → utils}/is_worker.js +0 -0
  1236. /package/src/{experimental/features → features/list}/__tests__/dash_wasm.test.ts +0 -0
  1237. /package/src/{experimental/features → features/list}/__tests__/debug_element.test.ts +0 -0
  1238. /package/src/{experimental/features → features/list}/debug_element.ts +0 -0
  1239. /package/src/{compat → utils}/global_scope.ts +0 -0
  1240. /package/src/{compat → utils}/is_node.ts +0 -0
  1241. /package/src/{compat → utils}/is_worker.ts +0 -0
  1242. /package/src/{errors → utils/request}/__tests__/request_error.test.ts +0 -0
package/.eslintrc.js CHANGED
@@ -176,6 +176,8 @@ module.exports = {
176
176
  "@typescript-eslint/no-namespace": "error",
177
177
  "@typescript-eslint/no-non-null-assertion": "error",
178
178
  "@typescript-eslint/no-this-alias": "error",
179
+ // Might be enabled in the future, for now this is too much work:
180
+ "@typescript-eslint/no-unsafe-enum-comparison": ["off"],
179
181
  "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
180
182
  "@typescript-eslint/no-unnecessary-qualifier": "error",
181
183
  "@typescript-eslint/no-unnecessary-type-arguments": "error",
@@ -10,7 +10,7 @@ on:
10
10
  types: [opened, synchronize, reopened]
11
11
 
12
12
  jobs:
13
- check:
13
+ typechecking_and_linting:
14
14
 
15
15
  runs-on: ubuntu-latest
16
16
 
@@ -28,6 +28,24 @@ jobs:
28
28
  cache: 'npm'
29
29
  - run: npm install
30
30
  - run: npm run check
31
+
32
+ unit_tests:
33
+
34
+ runs-on: ubuntu-latest
35
+
36
+ strategy:
37
+ matrix:
38
+ node-version: [16.x]
39
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
40
+
41
+ steps:
42
+ - uses: actions/checkout@v2
43
+ - name: Use Node.js ${{ matrix.node-version }}
44
+ uses: actions/setup-node@v2
45
+ with:
46
+ node-version: ${{ matrix.node-version }}
47
+ cache: 'npm'
48
+ - run: npm install
31
49
  - run: npm run test:unit
32
50
 
33
51
  integration_linux:
@@ -46,56 +64,15 @@ jobs:
46
64
  with:
47
65
  node-version: ${{ matrix.node-version }}
48
66
  cache: 'npm'
67
+ - uses: actions-rs/toolchain@v1
68
+ with:
69
+ toolchain: stable
49
70
  # needed for integration & memory tests codecs support
50
71
  - run: sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y ubuntu-restricted-extras
51
72
  - run: npm install
73
+ - run: rustup target add wasm32-unknown-unknown
74
+ - run: npm run build
52
75
  # Firefox seems to have issue with integration tests on GitHub actions only
53
76
  # TODO to check
54
77
  - run: node tests/integration/run.mjs --bchromehl
55
78
  - run: npm run test:memory
56
-
57
- # Windows seems to be a lot less stable for some reason.
58
- # TODO debug?
59
- # integration_windows:
60
-
61
- # runs-on: windows-latest
62
-
63
- # strategy:
64
- # matrix:
65
- # node-version: [16.x]
66
- # # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
67
-
68
- # steps:
69
- # - uses: actions/checkout@v2
70
- # - name: Use Node.js ${{ matrix.node-version }}
71
- # uses: actions/setup-node@v2
72
- # with:
73
- # node-version: ${{ matrix.node-version }}
74
- # cache: 'npm'
75
- # - run: npm install
76
- # # Firefox seems to have issue with integration tests on GitHub actions only
77
- # # TODO to check
78
- # - run: node tests/integration/run.mjs --bchromehl
79
- # - run: npm run test:memory
80
-
81
- # MacOS seems to be a lot less stable for some reason.
82
- # TODO debug?
83
- # integration_macos:
84
-
85
- # runs-on: macos-latest
86
-
87
- # strategy:
88
- # matrix:
89
- # node-version: [16.x]
90
- # # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
91
-
92
- # steps:
93
- # - uses: actions/checkout@v2
94
- # - name: Use Node.js ${{ matrix.node-version }}
95
- # uses: actions/setup-node@v2
96
- # with:
97
- # node-version: ${{ matrix.node-version }}
98
- # cache: 'npm'
99
- # - run: npm install
100
- # - run: npm run test:integration:gh-actions
101
- # - run: npm run test:memory
package/CHANGELOG.md CHANGED
@@ -1,32 +1,161 @@
1
- # Changelog
1
+ ## v4.0.0-rc.1 (2024-01-24)
2
+
3
+ ### Changes
4
+
5
+ - Create `"FREEZING"` player state for cases where the playback position is currently not advancing due to an unknown reason, to separate it from regular `"BUFFERING"`. [#1146]
6
+ - The `RELOADING` player state (gettable through the `getPlayerState` and `playerStateChange` API) can now happen at any time to unlock playback.
7
+ - Remove bitrate API: `getAvailableVideoBitrates`, `getAvailableAudioBitrates`, `setAudioBitrate`, `setVideoBitrate`, `getAudioBitrate`, `getVideoBitrate` in profit of the Representations lock APIs [#1144]
8
+ - Remove max bitrate API: `setMaxVideoBitrate`, `setMaxAudioBitrate`, `getMaxVideoBitrate` and `getMaxAudioBitrate` methods as well as the `maxVideoBitrate` and `maxAudioBitrate` options in profit of the Representations lock APIs
9
+ - Remove min bitrate API: `setMinVideoBitrate`, `setMinAudioBitrate`, `getMinVideoBitrate` and `getMinAudioBitrate` methods as well as the `minVideoBitrate` and `minAudioBitrate` options in profit of the Representations lock APIs
10
+ - Remove track preferences API (methods: `getPreferredAudioTracks`, `getPreferredVideoTracks`, `setPreferredAudioTracks` and `setPreferredVideoTracks`, types: `IAudioTrackPreference`, `ITextTrackPreference` and `IVideoTrackPreference`) in profit of the new tracks API
11
+ - Remove `getManualVideoBitrate` and `getManualAudioBitrate` in profit of the new Representations lock APIs
12
+ - Replace `initialAudioBitrate` and `initialVideoBitrate` constructor options with a single `baseBandwidth` option, which better translates what this option is actually doing and allows for future optimizations on our side. [#1155]
13
+ - Rename `audioTrackSwitchingMode` loadVideo option into `defaultAudioTrackSwitchingMode` [#1030]
14
+ - Remove `manualBitrateSwitchingMode` loadVideo option to instead rely on the `switchingMode` property of each `lockVideoRepresentations` and `lockAudioRepresentations` calls. [#1030]
15
+ - Remove `audioBitrateChange` and `videoBitrateChange` events in profit of the new `audioRepresentationChange` and `videoRepresentationChange` events
16
+ - Remove `availableAudioBitratesChange` and `availableVideoBitratesChange` events. Those are less needed with the new Representations lock API and can be mostly replicated through the `audioTrackChange` and `videoTrackChange` events
17
+ - "Flatten" the `transportOptions` loadVideo options by putting all its inner properties directly at the top level of loadVideo options, to simplify its documentation and discoverability [#1149]
18
+ - Remove `limitVideoWidth` constructor option in profit of the more configurable `videoResolutionLimit` constructor option
19
+ - Rename `networkConfig` into `requestConfig` and re-organize its inner properties to pave the way for future request-related APIs.
20
+ - Remove `stopAtEnd` `loadVideo` option and don't automatically stop when reaching the end by default. This behavior can be counter-intuitive and can be very easily implemented by the application.
21
+ - Remove `decipherabilityUpdate` event as it appeared to be not easily exploitable and exposed internal logic too much [#1168]
22
+ - Remove `getUrl` method in profit of the more powerful `getContentUrls`
23
+ - Impossibility to play the content due to unsupported audio and/or video tracks now triggers an error with the `MANIFEST_INCOMPATIBLE_CODECS_ERROR` instead of `MANIFEST_PARSE_ERROR`
24
+ - Remove methods: `getManifest`, `getCurrentAdaptations` and `getCurrentRepresentations`, as they reveal the RxPlayer's internals too much
25
+ - The `"smooth"` transport now needs to be communicated the URL of the Manifest directly (previously, it was possible to redirect it to a XML or JSON file first due to Canal+ legacy reasons).
26
+ - Remove the `supplementaryTextTracks` loadVideo option. You can use the `TextTrackRenderer` tool if you wish to diplay external subtitles on top of your content.
27
+ - Rename `maximumBufferTime` in `positionUpdate` events to `maximumPosition`
28
+ - Remove `getVideoPlayedTime` and `getVideoLoadedTime` methods. Their names was very confusing and can be re-implemented relatively easily using the media element's buffered property.
29
+ - Rename `getVideoDuration` to `getMediaDuration`, to avoid confusion with the video track's duration.
30
+ - Rename `getVideoBufferGap` to `getCurrentBufferGap, to avoid confusion with the "buffer gap" specific to the video track.
31
+ - Remove image-related API: `supplementaryImageTracks` `loadVideo` option, `imageTrackUpdate` event, `getImageTrackData` method. Those are better handled by an application. The `parseBifThumbnails` tool is still available.
32
+ - Replace `keySystems[].licenseStorage` `keySystems` option (for a `loadVideo` call) by the better-named `persistentLicenseConfig`. The `persistentLicense` boolean (also a `keySystems` option) has also been removed because it was redundant with it) [#1147]
33
+ - Remove `persistentStateRequired` API, in profit of the more powerful `persistentState` API [#1148]
34
+ - Remove `distinctiveIdentifierRequired` API, in profit of the more powerful `distinctiveIdentifier` API [#1148]
35
+ - Remove `keySystems[].fallbackOn` `loadVideo` property as it's now replaced by the more powerful `keySystems[].onKeyOutputRestricted` and `keySystems[].onKeyInternalError` properties.
36
+ - Remove `keySystems[].onKeyStatusesChange` API as it seems to never be used [#1148]
37
+ - Remove `keySystems[].throwOnLicenseExpiration` API as it can now be fully replaced by the `keySystems[].onKeyExpiration` option
38
+ - Remove `aggressiveMode` from the `transportOptions` `loadVideo` option
39
+ - Remove deprecated `throttleWhenHidden` player option in profit of `throttleVideoBitrateWhenHidden`
40
+ - Change payload of `periodChange` events, so they emit only core properties related to a `Period`.
41
+ - Change arguments given to a `transportOptions.segmentLoader` function (the `loadVideo` option): it now doesn't give the full `Manifest`, `Period`, `Adaptation`, `Representation` and `ISegment` structures in arguments but only core properties from it [#995]
42
+ - Custom `manifestLoader` function added to what was previously the `loadVideo`'s `transportOptions` option now set an object as argument (with an `url`property), to let us bring improvements on it in the future [#995]
43
+ - A Representation's `frameRate` is now always a number - in terms of frame per seconds - instead of a string.
44
+ - Update the arguments of the `representationFilter` API
45
+ - `Representations` (in methods: `getAvailableVideoTracks`, `getVideoTrack`, `representationFilter`, `getAvailableAudioTracks`, `getAudioTrack` and events: `audioTrackChange` and `videoTrackChange`) can have an `undefined` bitrate
46
+ - Remove deprecated fullscreen related APIs (methods: `isFullscreen`, `setFullscreen`, `exitFullscreen`, event: `fullscreenChange`) as a a UI is much more adapted to that task and can also bring with it things like a progress bar or HTML text tracks
47
+ - Remove deprecated `getNativeTextTrack` method. If advanced features are wanted, it's better to just use the HTML text track API
48
+ - Remove deprecated `nativeTextTracksChange` event. Same reason than for `getNativeTextTrack`
49
+ - Remove deprecated `hideNativeSubtitles` from `loadVideo` options. Same reason than for `getNativeTextTrack`
50
+ - Remove `xhr` property from a `NetworkError`. Doing so stop us from using the fetch API
51
+ - Remove deprecated `defaultAudioTrack` and `defaultTextTrack`in profit of new track APIs
52
+ - Remove `bitrateEstimationChange` event as it is poorly understood (it's not always close to the expected bandwidth) and has a very complex relationship with the chosen quality.
53
+ - Remove the notion of environment variables linked to personalized builds (e.g. RXP_DASH) in profit of the minimal RxPlayer.
54
+ - Rename `IPersistentSessionStorage` type to `IPersistentLicenseConfig` [#1147]
55
+ - Remove undocumented `audioRobustnesses` and `videoRobustnesses` properties of the `keySystems` option of `loadVideo` calls, as more powerful solutions now exist: respectively `audioCapabilitiesConfig` and `videoCapabilitiesConfig` [#1148]
56
+ - Remove public types `ISupplementaryTextTrackOption` and `ISupplementaryImageTrackOption`. Those are the types respectively for `supplementaryTextTracks` and `supplementaryImageTracks` which have been removed
57
+ - Remove public types `IBitrateEstimate` as no API depend on it anymore.
58
+ - Remove public types `IManifest`, `IPeriod`, `IAdaptation`, `IRepresentation`, `IRepresentationInfos`, `IBifThumbnail`, `IBifObject` and `IExposedSegment` as no API depend on them anymore.
59
+ - Remove public types `IDefaultAudioTrackOption` and `IDefaultTextTrackOption`. Those are the types respectively for `defaultAudioTrack` and `defaultTextTrack` `loadVideo` options which have been removed
60
+ - Remove public types `IAudioTrackPreference`, `ITextTrackPreference` and `IVideoTrackPreference` as the corresponding API do not exist anymore.
61
+ - Stop officially supporting the Internet Explorer 11 browser
62
+ - The `MediaError`'s `trackInfo` property is now an array renamed as `tracksInfo` and similar `MediaError` are grouped in one [#1264]
63
+ - The `manifestUpdateUrl` `loadVideo` option has been removed as it was unused [#1276]
64
+ - `volumeChange` events are now sending both the audio volume and the muted status [#1348]
65
+ - `mute`/`unMute`/`isMute` now rely on the `HTMLMediaElement`'s `muted` property and not the audio volume [#1348]
66
+ - A `representationFilter`'s advertised `codec` has now been renamed to `codecs` and is an Array when defined [#1332]
67
+ - `DASH_WASM` and `DEBUG_ELEMENT` are not experimental features anymore [#1339]
68
+ - The `parseBifThumbnails` function is not an experimental tool anymore [#1339]
69
+ - If all Representations from the current track become undecipherable, automatically switch to another track (also send a `trackUpdate` event) instead of stopping on error [#1234]
70
+ - Only send `MediaError` errors with the `NO_PLAYABLE_REPRESENTATION` error code when no Representation from all tracks of a given type can be played [#1234]
2
71
 
3
- ## v4.0.0-dev.2023120600 (2023-12-06)
72
+ ### Features
73
+
74
+ - Add `MULTI_THREAD` experimental feature to enable multithreading capabilities through a WebWorker
75
+ - `setAudioTrack`, `setVideoTrack` and `setTextTrack` now may take an object in argument, with the track's id set as a `trackId` property, to allow new features
76
+ - Add `switchingMode` optional property to `setVideoTrack` and `setAudioTrack`, to configure the way in which the RxPlayer switches between the previous and new track
77
+ - Add optional `periodId` property to `setAudioTrack`, `setVideoTrack` and `setTextTrack`, to allow setting the track of another, future or past, Period.
78
+ - `getAvailableAudioTracks`, `getAvailableTextTracks`, `getAvailableVideoTracks`, `getAudioTrack`, `getTextTrack` and `getVideoTrack` can now optionally take a `periodId` argument to retrieve track information on a specific Period, different than the current one.
79
+ - `disableTextTrack`, and`disableVideoTrack` can now optionally take a `periodId` argument to disable a track for a specific Period
80
+ - Add optional `lockedRepresentations` property to `setAudioTrack` and `setVideoTrack`, to only filter some allowed Representations (i.e. qualities) after switching to the wanted track.
81
+ - Add `getCurrentPeriod` method to retrieve information on the Period currently played
82
+ - Add `getAvailablePeriods` method to retrieve information on all Periods on which a track or Representation choice can be made
83
+ - Add `lockVideoRepresentations`, `lockAudioRepresentations`, `getLockedVideoRepresentations`, `getLockedAudioRepresentations`, `unlockVideoRepresentations` and `unlockAudioRepresentations` methods to allow a complex selection of Representations that are currently allowed to play.
84
+ - Add `getVideoRepresentation` and `getAudioRepresentation` method to retrieve information on the currently loaded representations [#1144]
85
+ - Add `audioRepresentationChange` and `videoRepresentationChange` events to be notified when the currently-loaded Representation for the current Period changes.
86
+ - Add `getContentUrls` allowing to retrieve the one or several known URLs through which the current Manifest or content is reachable.
87
+ - Add `videoResolutionLimit` constructor option allowing to automatically limit a video Representation's resolution.
88
+ - Add `newAvailablePeriods` event to signal new Period on which a track and/or Representation choice can be made
89
+ - Add `brokenRepresentationsLock` event for when a Representations lock could not be respected anymore
90
+ - Add `trackUpdate` event for when a track has been updated for any type and Period
91
+ - Add `distinctiveIdentifier` property in the `keySystems` option (given to the `loadVideo` method) to have full control over the MediaKeySystemConfiguration of the same name in the chosen key system [#1148]
92
+ - Add `persistentState` property in the `keySystems` option (given to the `loadVideo` method) to have full control over the MediaKeySystemConfiguration of the same name in the chosen key system [#1148]
93
+ - Add `keySystems[].onKeyOutputRestricted` and `keySystems[].onKeyInternalError` properties to configure the RxPlayer's behavior when a key switches to the status respectively `"output-restricted"` and `"internal-error"`
94
+ - Add `audioCapabilitiesConfig` and `videoCapabilitiesConfig` properties in the `keySystems` option (given to the `loadVideo` method) to allow advanced configuration of respectively the "audioCapabilities" and "videoCapabilities" in the asked MediaKeySystemConfiguration [#1148]
95
+ - Add `representationListUpdate` event for when the list of available Representation for a current track changes [#1240]
96
+ - add `connectionTimeout` property to the `requestConfig` `loadVideo` option for both the manifest and segment requests to set a timeout just linked to HTTP connection establishment [#1319]
97
+ - Add `relativeResumingPosition` property to the `setVideoTrack`and `setAudioTrack` options [#1331]
98
+ - types: export type `ICompatibleKeySystem` to the public API [#1340]
99
+ - types: Add `ISegmentLoaderContext` public type for the first argument of the `segmentLoader` API
100
+ - types: Add `IRepresentationFilterRepresentation` public type for the first argument of the `representationFilter` API
101
+ - types: Add `IRepresentationContext` public type for the second argument of the `representationFilter` API
102
+ - types: Add `IManifestLoaderInfo` public type for the first argument of the `manifestLoader` API
103
+ - types: Add `IPeriodChangeEvent` public type to define the properties send through a `periodChange` event
104
+ - types: Add `IPeriod` public type to define a Period object returned by methods like `getAvailablePeriods` or `getCurrentPeriod`
105
+ - types: Add `IVideoTrackSwitchingMode` public type to define the type of the `switchingMode` property optionally given to `setAudioTrack`
106
+ - types: Add `IAudioRepresentationsSwitchingMode` public type to define the type of the `switchingMode` property optionally given to `lockAudioRepresentations`
107
+ - types: Add `IVideoRepresentationsSwitchingMode` public type to define the type of the `switchingMode` property optionally given to `lockAudioRepresentations`
108
+ - types: Add `IBrokenRepresentationsLockContext` public type to define the type sent as a payload of the `brokenRepresentationsLock` event
109
+ - types: Add `ITrackUpdateEventPayload` public type to define the type sent as a payload of the `trackUpdate` event
110
+ - types: Add `ILockedVideoRepresentationsSettings` public type to define the object that should be given to the new `lockVideoRepresentation` method
111
+ - types: Add `ILockedAudioRepresentationsSettings` public type to define the object that should be given to the new `lockAudioRepresentation` method
112
+ - types: Add `IAudioTrackSetting` public type to define the object that may be given to the `setAudioTrack` method
113
+ - types: Add `IVideoTrackSetting` public type to define the object that may be given to the `setVideoTrack` method
114
+ - types: Add `ITextTrackSetting` public type to define the object that may be given to the `setTextTrack` method
115
+
116
+ ### Bug fixes
117
+
118
+ - Tizen (Samsung TVs): Try again to work around all potential issues that could arise due to tizen seeking back by itself [#1327, #1355]
119
+
120
+ ### Other improvements
121
+
122
+ - Provide both commonJS and ES6-style exports to improve compatibilities with applications
123
+ - Implement better error messages by not repeating the Error Type in it [#1290]
124
+ - DRM: Reload when playback is unexpectedly frozen with encrypted but only decipherable data in the buffer to work-around rare encryption-related issues [#1236]
125
+ - Add cache when checking for codec support, improving performance on some devices and potentially working around some xbox bugs on long-lived pages [#1324]
126
+ - Demo: Add possibility to see the debug element in the demo page
127
+
128
+
129
+ ## v3.33.0 (2024-01-24)
4
130
 
5
131
  ### Features
6
132
 
7
133
  - Add `getLivePosition` RxPlayer method [#1300]
8
134
  - Add `startAt.fromLivePosition` `loadVideo` option [#1300]
9
- - add `connectionTimeout` property to the `requestConfig` `loadVideo` option for both the manifest and segment requests to set a timeout just linked to HTTP connection establishment [#1319]
10
135
  - Add the possibility to set a new `keySystems` option on the `reload` API [#1308]
11
136
 
12
137
  ### Bug fixes
13
138
 
14
139
  - Fix subtitles "blinking" in some specific conditions, especially with some DASH low-latency contents [#1314]
15
140
  - DASH: Fix Period overlap resolution logic for when the first Period is removed [#1311]
141
+ - TTML: Fix handling of the `tts:lineHeight` attribute [#1320]
16
142
  - Fix import of the `LOCAL_MANIFEST` experimental feature
17
- - Smooth: Rely on a defined `segmentLoader` when playing smooth streaming contents.
143
+ - Avoid very rarely skipping segments which initially were too big to be pushed due to memory limitations [#1323]
144
+ - Fix issue arising when using track APIs at the exact last possible position of a Period with no consecutive Period [#1337]
145
+ - Starting at the end (through a `startAt` `loadVideo` option) or reloading at the end led to the restart of the content [#1338]
146
+ - DRM/Safari: also perform Safari DRM work-arounds when the page is launched from the dock [#1351, #1356]
18
147
 
19
148
  ### Other improvements
20
149
 
21
- - Provide both commonJS and ES6-style exports to improve compatibilities with applications
22
150
  - DASH: rely on SCTE214 `supplementalCodecs` instead of `codecs` if it's supported to better support backward compatible Dolby Vision contents [#1307]
23
151
  - DASH: Provide better support of the `availabilityTimeOffset` attribute [#1300]
24
152
  - DEBUG_ELEMENT: Add unsupported and undecipherable bitrates to the debug element [#1321]
25
153
  - DEBUG_ELEMENT: update buffer graph maximum size so it becomes more readable for lengthy contents [#1316]
26
154
  - DEBUG_ELEMENT: always synchronize inventory of segments before rendering it [#1317]
27
155
  - Remove remaining RxPlayer dependency removing possibility of some application-side bundling errors [#1312]
28
- - Add cache when checking for codec support, improving performance on some devices and potentially working around some xbox bugs on long-lived pages [#1324]
29
- - Demo: Add possibility to see the debug element in the demo page
156
+ - Add exception to text Garbage collection logic to avoid unnecessarily reload text segments frequently [#1325]
157
+ - Avoid logging too much the buffer's content when our debugging UI or the demo is used [#1341]
158
+ - Demo: Fix reporting of live position in demo page [#1313]
30
159
 
31
160
 
32
161
  ## v3.32.1 (2023-10-19)
package/CONTRIBUTING.md CHANGED
@@ -47,6 +47,17 @@ the `features` object exported at `/src/features`. This is to reduce bundle size
47
47
  when an application doesn't need all of the RxPlayer's features.
48
48
 
49
49
 
50
+ ### Multithreading
51
+
52
+ Some parts of the code are intented to be runnable in a WebWorker. In that
53
+ environment some API, more specifically DOM-related API, are not available
54
+ directly (if some interaction with the DOM is needed, it will have to go through
55
+ an asynchronous `postMessage` round-trip).
56
+
57
+ Whether the code needs to be runnable or not in a WebWorker is generally
58
+ documented in the `README.md` of concerned directories.
59
+
60
+
50
61
 
51
62
  ## Code style
52
63
 
package/FILES.md CHANGED
@@ -114,6 +114,14 @@ Defines a common `Manifest` class, regardless of the streaming technology (DASH,
114
114
  HSS...). This class is then used by the rest of the RxPlayer, to allow
115
115
  interaction with it without considering the underlying technology used.
116
116
 
117
+ ### `src/mse/`: MSE abstractions
118
+
119
+ Abstraction over Media Source Extensions API, which are the browser API allowing
120
+ to buffer media.
121
+
122
+ This allows to provide a common API to the rest of the RxPlayer's code
123
+ regardless of the environment (e.g. in a WebWorker without MSE API or in an
124
+ environment with MSE API).
117
125
 
118
126
  ### `src/transports/`: Streaming protocols implementation
119
127
 
@@ -141,12 +149,6 @@ The parsed data being either:
141
149
  - image containers: BIF
142
150
 
143
151
 
144
- ### `src/typings/`: Typescript typings
145
-
146
- This directory contains only declaration files for TypeScript. It is
147
- automatically added as a `typeRoots` when the TypeScript code is transpiled.
148
-
149
-
150
152
  ### `src/utils/`: Util functions
151
153
 
152
154
  This directory contains general helpers which are used in different parts of the
package/README.md CHANGED
@@ -179,21 +179,11 @@ Demo pages for our previous versions are also available
179
179
 
180
180
 
181
181
 
182
- ## Your questions ##############################################################
183
-
184
- You can ask directly your questions about the project on [our
185
- gitter](https://gitter.im/canalplus/rx-player).
186
- We will try our best to answer them as quickly as possible.
187
-
188
-
189
-
190
182
  ## Contribute ##################################################################
191
183
 
192
184
  Details on how to contribute is written in the [CONTRIBUTING.md
193
185
  file](./CONTRIBUTING.md) at the root of this repository.
194
186
 
195
- If you need more information, you can contact us via our [gitter
196
- room](https://gitter.im/canalplus/rx-player).
197
187
 
198
188
 
199
189
  ### Dependencies ###############################################################
@@ -213,7 +203,7 @@ Canal+ Group is a media company with many advanced needs when it comes to media
213
203
  playback: it provides both live and VoD stream with multiple encryption
214
204
  requirements, supports a very large panel of devices and has many other
215
205
  specificities (like adult content restrictions, ad-insertion, Peer-To-Peer
216
- integration...).
206
+ integration, low-latency live streaming...).
217
207
 
218
208
  When the time came to switch from a plugin-based web player approach to an HTML5
219
209
  one back in 2015, no media player had the key features we wanted, and including
@@ -224,7 +214,7 @@ The R&D department of Canal+ Group thus started to work on a new featureful
224
214
  media-player: the RxPlayer. To both help and profit from the community, it also
225
215
  decided to share it to everyone under a permissive open-source licence.
226
216
 
227
- Now, more than 6 years later, the RxPlayer continues to evolve at the same fast
217
+ Now, more than 8 years later, the RxPlayer continues to evolve at the same fast
228
218
  pace to include a lot of features and improvements you may not find in other
229
219
  media players.
230
220
  You can look at our
@@ -271,24 +261,3 @@ them. Amongst those:
271
261
  risks always low.
272
262
 
273
263
  \* In "directfile" mode, on compatible browsers
274
-
275
-
276
- ## Target support ##############################################################
277
-
278
- Here is a basic list of supported platforms:
279
-
280
- | | Chrome | IE [1] | Edge | Firefox | Safari | Opera |
281
- |-------------|:-------:|:-------:|:------:|:---------:|:--------:|:-------:|
282
- | Windows | >= 30 | >= 11 | >= 12 | >= 42 | >= 8 | >= 25 |
283
- | OSX | >= 30 | - | - | >= 42 | >= 8 | >= 25 |
284
- | Linux | >= 37 | - | - | >= 42 | - | >= 25 |
285
- | Android [2] | >= 30 | - | - | >= 42 | - | >= 15 |
286
- | iOS | No | - | - | No | No | No |
287
-
288
- [1] Only on Windows >= 8.
289
-
290
- [2] Android version >= 4.2
291
-
292
- And more. A good way to know if the browser should be supported by our player is
293
- to go on the page https://www.youtube.com/html5 and check for "Media Source
294
- Extensions" support.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.0-dev.2023120600
1
+ 4.0.0-rc.1
@@ -23,9 +23,11 @@ import { ICompatTextTrack } from "./browser_compatibility_types";
23
23
  * undefined if no trackElement was added.
24
24
  *
25
25
  * @param {HTMLMediaElement} mediaElement
26
+ * @param {Boolean} hidden - If `true`, the text track will be hidden by
27
+ * default. If `false`, the text track will be directly showing.
26
28
  * @returns {Object}
27
29
  */
28
- export default function addTextTrack(mediaElement: HTMLMediaElement): {
30
+ export default function addTextTrack(mediaElement: HTMLMediaElement, hidden: boolean): {
29
31
  track: ICompatTextTrack;
30
32
  trackElement: HTMLTrackElement | undefined;
31
33
  };
@@ -23,10 +23,12 @@ import { isIEOrEdge } from "./browser_detection";
23
23
  * undefined if no trackElement was added.
24
24
  *
25
25
  * @param {HTMLMediaElement} mediaElement
26
+ * @param {Boolean} hidden - If `true`, the text track will be hidden by
27
+ * default. If `false`, the text track will be directly showing.
26
28
  * @returns {Object}
27
29
  */
28
- export default function addTextTrack(mediaElement) {
29
- var _a;
30
+ export default function addTextTrack(mediaElement, hidden) {
31
+ var _a, _b;
30
32
  var track;
31
33
  var trackElement;
32
34
  var kind = "subtitles";
@@ -34,14 +36,15 @@ export default function addTextTrack(mediaElement) {
34
36
  var tracksLength = mediaElement.textTracks.length;
35
37
  track = (tracksLength > 0 ? mediaElement.textTracks[tracksLength - 1] :
36
38
  mediaElement.addTextTrack(kind));
37
- track.mode = (_a = track.SHOWING) !== null && _a !== void 0 ? _a : "showing";
39
+ track.mode = hidden ? ((_a = track.HIDDEN) !== null && _a !== void 0 ? _a : "hidden") :
40
+ ((_b = track.SHOWING) !== null && _b !== void 0 ? _b : "showing");
38
41
  }
39
42
  else {
40
43
  trackElement = document.createElement("track");
41
44
  mediaElement.appendChild(trackElement);
42
45
  track = trackElement.track;
43
46
  trackElement.kind = kind;
44
- track.mode = "showing";
47
+ track.mode = hidden ? "hidden" : "showing";
45
48
  }
46
49
  return { track: track, trackElement: trackElement };
47
50
  }
@@ -52,8 +52,15 @@ interface ICompatTextTrack extends TextTrack {
52
52
  * functions for some "old" browsers.
53
53
  */
54
54
  interface ICompatDocument extends Document {
55
+ fullscreenElement: Element | null;
56
+ mozCancelFullScreen?: () => void;
57
+ mozFullScreenElement?: HTMLElement;
55
58
  mozHidden?: boolean;
59
+ msExitFullscreen?: () => void;
60
+ msFullscreenElement?: Element | null;
56
61
  msHidden?: boolean;
62
+ webkitExitFullscreen: () => void;
63
+ webkitFullscreenElement: Element | null;
57
64
  webkitHidden?: boolean;
58
65
  }
59
66
  /**
@@ -39,4 +39,6 @@ declare let isWebOs2022: boolean;
39
39
  declare let isPanasonic: boolean;
40
40
  /** `true` for the PlayStation 5 game console. */
41
41
  declare let isPlayStation5: boolean;
42
- export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation5, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
42
+ /** `true` for the Xbox game consoles. */
43
+ declare let isXbox: boolean;
44
+ export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation5, isXbox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
@@ -40,8 +40,10 @@ var isWebOs2022 = false;
40
40
  var isPanasonic = false;
41
41
  /** `true` for the PlayStation 5 game console. */
42
42
  var isPlayStation5 = false;
43
+ /** `true` for the Xbox game consoles. */
44
+ var isXbox = false;
43
45
  ((function findCurrentBrowser() {
44
- var _a, _b;
46
+ var _a, _b, _c;
45
47
  if (isNode) {
46
48
  return;
47
49
  }
@@ -66,9 +68,24 @@ var isPlayStation5 = false;
66
68
  /iPad|iPhone|iPod/.test(navigator.platform)) {
67
69
  isSafariMobile = true;
68
70
  }
69
- else if (Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") >= 0 ||
71
+ else if (
72
+ // the following statement check if the window.safari contains the method
73
+ // "pushNotification", this condition is not met when using web app from the dock
74
+ // on macOS, this is why we also check userAgent.
75
+ Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") >= 0 ||
70
76
  ((_b = (_a = window.safari) === null || _a === void 0 ? void 0 : _a.pushNotification) === null || _b === void 0 ? void 0 : _b.toString()) ===
71
- "[object SafariRemoteNotification]") {
77
+ "[object SafariRemoteNotification]" ||
78
+ // browsers are lying: Chrome reports both as Chrome and Safari in user
79
+ // agent string, So to detect Safari we have to check for the Safari string
80
+ // and the absence of the Chrome string
81
+ // eslint-disable-next-line max-len
82
+ // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#which_part_of_the_user_agent_contains_the_information_you_are_looking_for
83
+ ((/Safari\/(\d+)/).test(navigator.userAgent) &&
84
+ // Safari should contain Version/ in userAgent
85
+ (/Version\/(\d+)/).test(navigator.userAgent) &&
86
+ (((_c = navigator.vendor) === null || _c === void 0 ? void 0 : _c.indexOf("Apple")) !== -1) &&
87
+ !(/Chrome\/(\d+)/).test(navigator.userAgent) &&
88
+ !(/Chromium\/(\d+)/).test(navigator.userAgent))) {
72
89
  isSafariDesktop = true;
73
90
  }
74
91
  // 2 - Find out specific device/platform information
@@ -99,5 +116,8 @@ var isPlayStation5 = false;
99
116
  else if (/[Pp]anasonic/.test(navigator.userAgent)) {
100
117
  isPanasonic = true;
101
118
  }
119
+ else if (navigator.userAgent.indexOf("Xbox") !== -1) {
120
+ isXbox = true;
121
+ }
102
122
  })());
103
- export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation5, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
123
+ export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isPlayStation5, isXbox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
@@ -34,6 +34,15 @@ export type IEventTargetLike = HTMLElement | IEventEmitterLike | IEventEmitter<u
34
34
  * be triggered when that event is emitted on a given event target.
35
35
  */
36
36
  declare function createCompatibleEventListener(eventNames: string[], prefixes?: string[]): (element: IEventTargetLike, listener: (event?: unknown) => void, cancelSignal: CancellationSignal) => void;
37
+ /**
38
+ * Returns a reference:
39
+ * - Set to `true` when the current page is considered visible and active.
40
+ * - Set to `false` otherwise.
41
+ * @param {Object} stopListening - `CancellationSignal` allowing to free the
42
+ * resources allocated to update this value.
43
+ * @returns {Object}
44
+ */
45
+ declare function getPageActivityRef(stopListening: CancellationSignal): IReadOnlySharedReference<boolean>;
37
46
  export interface IPictureInPictureEvent {
38
47
  isEnabled: boolean;
39
48
  pipWindow: ICompatPictureInPictureWindow | null;
@@ -74,7 +83,11 @@ declare const onLoadedMetadata: (element: IEventTargetLike, listener: (event?: u
74
83
  */
75
84
  declare const onTimeUpdate: (element: IEventTargetLike, listener: (event?: unknown) => void, cancelSignal: CancellationSignal) => void;
76
85
  /**
77
- * @param {TextTrackList} mediaElement
86
+ * @param {HTMLElement} element
87
+ */
88
+ declare const onFullscreenChange: (element: IEventTargetLike, listener: (event?: unknown) => void, cancelSignal: CancellationSignal) => void;
89
+ /**
90
+ * @param {TextTrackList} textTrackList
78
91
  */
79
92
  declare const onTextTrackAdded: (element: IEventTargetLike, listener: (event?: unknown) => void, cancelSignal: CancellationSignal) => void;
80
93
  /**
@@ -150,4 +163,4 @@ declare const onEnded: (element: IEventTargetLike, listener: (event?: unknown) =
150
163
  * emits
151
164
  */
152
165
  declare function addEventListener(elt: IEventEmitterLike, evt: string, listener: (x?: unknown) => void, stopListening: CancellationSignal): void;
153
- export { addEventListener, createCompatibleEventListener, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef, onEnded, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };
166
+ export { addEventListener, createCompatibleEventListener, getPageActivityRef, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef, onEnded, onFullscreenChange, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };
@@ -166,6 +166,35 @@ function getDocumentVisibilityRef(stopListening) {
166
166
  }, stopListening);
167
167
  return ref;
168
168
  }
169
+ /**
170
+ * Returns a reference:
171
+ * - Set to `true` when the current page is considered visible and active.
172
+ * - Set to `false` otherwise.
173
+ * @param {Object} stopListening - `CancellationSignal` allowing to free the
174
+ * resources allocated to update this value.
175
+ * @returns {Object}
176
+ */
177
+ function getPageActivityRef(stopListening) {
178
+ var isDocVisibleRef = getDocumentVisibilityRef(stopListening);
179
+ var currentTimeout;
180
+ var ref = new SharedReference(true, stopListening);
181
+ stopListening.register(function () {
182
+ clearTimeout(currentTimeout);
183
+ currentTimeout = undefined;
184
+ });
185
+ isDocVisibleRef.onUpdate(function onDocVisibilityChange(isVisible) {
186
+ clearTimeout(currentTimeout); // clear potential previous timeout
187
+ currentTimeout = undefined;
188
+ if (!isVisible) {
189
+ var INACTIVITY_DELAY = config.getCurrent().INACTIVITY_DELAY;
190
+ currentTimeout = window.setTimeout(function () {
191
+ ref.setValueIfChanged(false);
192
+ }, INACTIVITY_DELAY);
193
+ }
194
+ ref.setValueIfChanged(true);
195
+ }, { clearSignal: stopListening, emitCurrentValue: true });
196
+ return ref;
197
+ }
169
198
  /**
170
199
  * Get video width from Picture-in-Picture window
171
200
  * @param {HTMLMediaElement} mediaElement
@@ -303,7 +332,13 @@ var onLoadedMetadata = createCompatibleEventListener(["loadedmetadata"]);
303
332
  */
304
333
  var onTimeUpdate = createCompatibleEventListener(["timeupdate"]);
305
334
  /**
306
- * @param {TextTrackList} mediaElement
335
+ * @param {HTMLElement} element
336
+ */
337
+ var onFullscreenChange = createCompatibleEventListener(["fullscreenchange", "FullscreenChange"],
338
+ // On IE11, fullscreen change events is called MSFullscreenChange
339
+ BROWSER_PREFIXES.concat("MS"));
340
+ /**
341
+ * @param {TextTrackList} textTrackList
307
342
  */
308
343
  var onTextTrackAdded = createCompatibleEventListener(["addtrack"]);
309
344
  /**
@@ -384,4 +419,4 @@ function addEventListener(elt, evt, listener, stopListening) {
384
419
  elt.removeEventListener(evt, listener);
385
420
  });
386
421
  }
387
- export { addEventListener, createCompatibleEventListener, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef, onEnded, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };
422
+ export { addEventListener, createCompatibleEventListener, getPageActivityRef, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef, onEnded, onFullscreenChange, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };