rx-player 4.0.0-dev.2023121900 → 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 (1062) hide show
  1. package/.eslintrc.js +2 -0
  2. package/.github/workflows/checks.yml +24 -47
  3. package/CHANGELOG.md +71 -118
  4. package/CONTRIBUTING.md +11 -0
  5. package/FILES.md +8 -6
  6. package/VERSION +1 -1
  7. package/dist/_esm5.processed/compat/browser_detection.d.ts +3 -1
  8. package/dist/_esm5.processed/compat/browser_detection.js +24 -4
  9. package/dist/_esm5.processed/compat/should_prevent_seeking_at_0_initially.d.ts +14 -0
  10. package/dist/_esm5.processed/compat/should_prevent_seeking_at_0_initially.js +17 -0
  11. package/dist/_esm5.processed/config.d.ts +1 -0
  12. package/dist/_esm5.processed/core/api/option_utils.d.ts +4 -0
  13. package/dist/_esm5.processed/core/api/option_utils.js +8 -3
  14. package/dist/_esm5.processed/core/api/public_api.d.ts +11 -1
  15. package/dist/_esm5.processed/core/api/public_api.js +36 -5
  16. package/dist/_esm5.processed/core/decrypt/attach_media_keys.d.ts +2 -1
  17. package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +2 -1
  18. package/dist/_esm5.processed/core/decrypt/init_media_keys.js +13 -5
  19. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +25 -8
  20. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +4 -6
  21. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  22. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.js +16 -17
  23. package/dist/_esm5.processed/core/init/utils/get_initial_time.d.ts +17 -3
  24. package/dist/_esm5.processed/core/init/utils/get_initial_time.js +9 -7
  25. package/dist/_esm5.processed/core/init/utils/get_loaded_reference.js +7 -5
  26. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.d.ts +2 -1
  27. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +59 -6
  28. package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +6 -1
  29. package/dist/_esm5.processed/core/segment_buffers/implementations/types.js +7 -2
  30. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +6 -1
  31. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +8 -2
  32. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +16 -11
  33. package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.js +5 -4
  34. package/dist/_esm5.processed/default_config.d.ts +7 -0
  35. package/dist/_esm5.processed/default_config.js +16 -0
  36. package/dist/_esm5.processed/manifest/manifest.js +8 -4
  37. package/dist/_esm5.processed/manifest/period.d.ts +3 -1
  38. package/dist/_esm5.processed/manifest/period.js +16 -3
  39. package/dist/_esm5.processed/manifest/representation_index/static.d.ts +1 -1
  40. package/dist/_esm5.processed/manifest/representation_index/static.js +2 -2
  41. package/dist/_esm5.processed/manifest/representation_index/types.d.ts +4 -4
  42. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
  43. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +4 -3
  44. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  45. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  46. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  47. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
  48. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +2 -2
  49. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +12 -11
  50. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +43 -34
  51. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  52. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
  53. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +247 -51
  54. package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  55. package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  56. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +13 -11
  57. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +27 -14
  58. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  59. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +16 -17
  60. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -8
  61. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +21 -8
  62. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +7 -3
  63. package/dist/_esm5.processed/parsers/manifest/local/representation_index.d.ts +1 -1
  64. package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +3 -3
  65. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
  66. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.js +2 -2
  67. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +5 -5
  68. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +25 -9
  69. package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.js +1 -1
  70. package/dist/_esm5.processed/public_types.d.ts +12 -2
  71. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts +3 -0
  72. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +6 -0
  73. package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts +3 -0
  74. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +6 -0
  75. package/dist/commonjs/__GENERATED_CODE/index.d.ts +2 -0
  76. package/dist/commonjs/__GENERATED_CODE/index.js +7 -0
  77. package/dist/commonjs/compat/browser_compatibility_types.js +1 -1
  78. package/dist/commonjs/compat/browser_detection.d.ts +3 -1
  79. package/dist/commonjs/compat/browser_detection.js +27 -6
  80. package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +1 -1
  81. package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +1 -1
  82. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts +1 -1
  83. package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +1 -2
  84. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -1
  85. package/dist/commonjs/compat/eme/eme-api-implementation.js +4 -3
  86. package/dist/commonjs/compat/event_listeners.js +1 -1
  87. package/dist/commonjs/compat/has_mse_in_worker.d.ts +2 -0
  88. package/dist/commonjs/compat/has_mse_in_worker.js +6 -0
  89. package/dist/commonjs/compat/has_webassembly.d.ts +6 -0
  90. package/dist/commonjs/compat/has_webassembly.js +9 -0
  91. package/dist/commonjs/compat/index.d.ts +1 -2
  92. package/dist/commonjs/compat/index.js +1 -3
  93. package/dist/commonjs/compat/is_codec_supported.js +5 -0
  94. package/dist/commonjs/compat/is_vtt_cue.js +1 -1
  95. package/dist/commonjs/compat/make_vtt_cue.js +1 -1
  96. package/dist/commonjs/compat/on_height_width_change.js +1 -1
  97. package/dist/commonjs/compat/patch_webkit_source_buffer.js +2 -2
  98. package/dist/commonjs/config.d.ts +6 -17
  99. package/dist/commonjs/config.js +4 -12
  100. package/dist/commonjs/core/adaptive/adaptive_representation_selector.d.ts +2 -1
  101. package/dist/commonjs/core/adaptive/adaptive_representation_selector.js +1 -1
  102. package/dist/commonjs/core/api/debug/buffer_graph.js +3 -3
  103. package/dist/commonjs/core/api/debug/modules/general_info.js +23 -11
  104. package/dist/commonjs/core/api/debug/modules/segment_buffer_content.js +5 -4
  105. package/dist/commonjs/core/api/option_utils.d.ts +3 -2
  106. package/dist/commonjs/core/api/option_utils.js +14 -4
  107. package/dist/commonjs/core/api/playback_observer.d.ts +55 -24
  108. package/dist/commonjs/core/api/playback_observer.js +105 -72
  109. package/dist/commonjs/core/api/public_api.d.ts +35 -12
  110. package/dist/commonjs/core/api/public_api.js +321 -154
  111. package/dist/commonjs/core/api/track_management/track_dispatcher.d.ts +12 -8
  112. package/dist/commonjs/core/api/track_management/track_dispatcher.js +28 -22
  113. package/dist/commonjs/core/api/track_management/tracks_store.d.ts +26 -14
  114. package/dist/commonjs/core/api/track_management/tracks_store.js +134 -66
  115. package/dist/commonjs/core/decrypt/attach_media_keys.d.ts +2 -1
  116. package/dist/commonjs/core/decrypt/attach_media_keys.js +2 -1
  117. package/dist/commonjs/core/decrypt/content_decryptor.js +70 -181
  118. package/dist/commonjs/core/decrypt/init_media_keys.js +13 -5
  119. package/dist/commonjs/core/decrypt/types.d.ts +11 -5
  120. package/dist/commonjs/core/decrypt/utils/check_key_statuses.js +4 -4
  121. package/dist/{es2017/utils → commonjs/core/fetchers/segment}/initialization_segment_cache.d.ts +1 -1
  122. package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +2 -2
  123. package/dist/commonjs/core/fetchers/utils/error_selector.js +2 -1
  124. package/dist/commonjs/core/fetchers/utils/schedule_request.js +2 -1
  125. package/dist/commonjs/core/init/directfile_content_initializer.js +8 -3
  126. package/dist/commonjs/core/init/media_source_content_initializer.d.ts +7 -22
  127. package/dist/commonjs/core/init/media_source_content_initializer.js +313 -115
  128. package/dist/commonjs/core/init/multithread/main_thread/multi_thread_content_initializer.d.ts +167 -0
  129. package/dist/commonjs/core/init/multithread/main_thread/multi_thread_content_initializer.js +1389 -0
  130. package/dist/commonjs/core/init/multithread/main_thread/send_message.d.ts +2 -0
  131. package/dist/commonjs/core/init/multithread/main_thread/send_message.js +13 -0
  132. package/dist/commonjs/core/init/multithread/worker/content_preparer.d.ts +92 -0
  133. package/dist/commonjs/core/init/multithread/worker/content_preparer.js +259 -0
  134. package/dist/commonjs/core/init/multithread/worker/globals.d.ts +13 -0
  135. package/dist/commonjs/core/init/multithread/worker/globals.js +26 -0
  136. package/dist/commonjs/core/init/multithread/worker/index.d.ts +2 -0
  137. package/dist/commonjs/core/init/multithread/worker/index.js +4 -0
  138. package/dist/commonjs/core/init/multithread/worker/send_message.d.ts +3 -0
  139. package/dist/commonjs/core/init/multithread/worker/send_message.js +25 -0
  140. package/dist/commonjs/core/init/multithread/worker/track_choice_setter.d.ts +19 -0
  141. package/dist/commonjs/core/init/multithread/worker/track_choice_setter.js +140 -0
  142. package/dist/commonjs/core/init/multithread/worker/worker_playback_observer.d.ts +21 -0
  143. package/dist/commonjs/core/init/multithread/worker/worker_playback_observer.js +47 -0
  144. package/dist/commonjs/core/init/multithread/worker/worker_portal.d.ts +1 -0
  145. package/dist/commonjs/core/init/multithread/worker/worker_portal.js +721 -0
  146. package/dist/commonjs/core/init/multithread/worker/worker_text_displayer_interface.d.ts +64 -0
  147. package/dist/commonjs/core/init/multithread/worker/worker_text_displayer_interface.js +127 -0
  148. package/dist/commonjs/core/init/types.d.ts +21 -12
  149. package/dist/commonjs/core/init/types.js +0 -1
  150. package/dist/commonjs/core/init/utils/DecipherabilityFreezeDetector.d.ts +54 -0
  151. package/dist/commonjs/core/init/utils/DecipherabilityFreezeDetector.js +129 -0
  152. package/dist/commonjs/core/init/utils/create_content_time_boundaries_observer.d.ts +28 -0
  153. package/dist/commonjs/core/init/utils/create_content_time_boundaries_observer.js +48 -0
  154. package/dist/commonjs/core/init/utils/create_core_playback_observer.d.ts +61 -0
  155. package/dist/commonjs/core/init/utils/create_core_playback_observer.js +130 -0
  156. package/dist/commonjs/core/init/utils/create_media_source.d.ts +3 -3
  157. package/dist/commonjs/core/init/utils/create_media_source.js +29 -38
  158. package/dist/commonjs/core/init/utils/get_initial_time.d.ts +2 -2
  159. package/dist/commonjs/core/init/utils/get_initial_time.js +6 -5
  160. package/dist/commonjs/core/init/utils/get_loaded_reference.js +7 -5
  161. package/dist/commonjs/core/init/utils/initial_seek_and_play.js +55 -6
  162. package/dist/commonjs/core/init/utils/initialize_content_decryption.d.ts +7 -1
  163. package/dist/commonjs/core/init/utils/initialize_content_decryption.js +6 -0
  164. package/dist/commonjs/core/init/utils/main_thread_text_displayer_interface.d.ts +35 -0
  165. package/dist/commonjs/core/init/utils/main_thread_text_displayer_interface.js +54 -0
  166. package/dist/commonjs/core/init/utils/rebuffering_controller.d.ts +5 -38
  167. package/dist/commonjs/core/init/utils/rebuffering_controller.js +3 -112
  168. package/dist/commonjs/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.d.ts +2 -2
  169. package/dist/commonjs/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.js +24 -1
  170. package/dist/commonjs/core/init/utils/stream_events_emitter/stream_events_emitter.d.ts +3 -2
  171. package/dist/commonjs/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -4
  172. package/dist/commonjs/core/segment_buffers/garbage_collector.d.ts +3 -1
  173. package/dist/commonjs/core/segment_buffers/garbage_collector.js +13 -4
  174. package/dist/commonjs/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +26 -74
  175. package/dist/commonjs/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +183 -297
  176. package/dist/commonjs/core/segment_buffers/implementations/index.d.ts +2 -1
  177. package/dist/commonjs/core/segment_buffers/implementations/text/index.d.ts +3 -0
  178. package/dist/commonjs/core/segment_buffers/implementations/text/index.js +4 -0
  179. package/dist/commonjs/core/segment_buffers/implementations/text/text_segment_buffer.d.ts +89 -0
  180. package/dist/commonjs/core/segment_buffers/implementations/text/text_segment_buffer.js +253 -0
  181. package/dist/commonjs/core/segment_buffers/implementations/types.d.ts +46 -57
  182. package/dist/commonjs/core/segment_buffers/implementations/types.js +22 -29
  183. package/dist/commonjs/core/segment_buffers/index.d.ts +3 -3
  184. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.d.ts +23 -9
  185. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.js +53 -22
  186. package/dist/commonjs/core/segment_buffers/segment_buffers_store.d.ts +7 -16
  187. package/dist/commonjs/core/segment_buffers/segment_buffers_store.js +14 -24
  188. package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +15 -8
  189. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.d.ts +19 -5
  190. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.js +62 -57
  191. package/dist/commonjs/core/stream/adaptation/types.d.ts +17 -28
  192. package/dist/commonjs/core/stream/index.d.ts +2 -1
  193. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts +4 -4
  194. package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
  195. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +11 -2
  196. package/dist/commonjs/core/stream/period/period_stream.js +55 -21
  197. package/dist/commonjs/core/stream/period/types.d.ts +11 -4
  198. package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.js +75 -72
  199. package/dist/commonjs/core/stream/representation/representation_stream.js +4 -4
  200. package/dist/commonjs/core/stream/representation/types.d.ts +30 -3
  201. package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.d.ts +5 -2
  202. package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.js +36 -19
  203. package/dist/commonjs/core/stream/representation/utils/get_buffer_status.d.ts +2 -2
  204. package/dist/commonjs/core/stream/representation/utils/get_buffer_status.js +22 -12
  205. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts +2 -2
  206. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +2 -6
  207. package/dist/commonjs/core/stream/representation/utils/push_init_segment.d.ts +3 -1
  208. package/dist/commonjs/core/stream/representation/utils/push_init_segment.js +3 -4
  209. package/dist/commonjs/core/stream/representation/utils/push_media_segment.d.ts +3 -1
  210. package/dist/commonjs/core/stream/representation/utils/push_media_segment.js +3 -4
  211. package/dist/commonjs/default_config.d.ts +31 -34
  212. package/dist/commonjs/default_config.js +44 -47
  213. package/dist/commonjs/errors/encrypted_media_error.d.ts +17 -0
  214. package/dist/commonjs/errors/encrypted_media_error.js +13 -0
  215. package/dist/commonjs/errors/error_codes.d.ts +4 -3
  216. package/dist/commonjs/errors/error_codes.js +3 -8
  217. package/dist/commonjs/errors/index.d.ts +7 -8
  218. package/dist/commonjs/errors/index.js +3 -5
  219. package/dist/commonjs/errors/media_error.d.ts +21 -18
  220. package/dist/commonjs/errors/media_error.js +15 -19
  221. package/dist/commonjs/errors/network_error.d.ts +15 -1
  222. package/dist/commonjs/errors/network_error.js +12 -0
  223. package/dist/commonjs/errors/other_error.d.ts +14 -0
  224. package/dist/commonjs/errors/other_error.js +12 -0
  225. package/dist/commonjs/errors/source_buffer_error.d.ts +40 -0
  226. package/dist/commonjs/errors/source_buffer_error.js +62 -0
  227. package/dist/commonjs/experimental/features/index.d.ts +1 -2
  228. package/dist/commonjs/experimental/features/index.js +3 -5
  229. package/dist/commonjs/experimental/features/local.js +3 -1
  230. package/dist/commonjs/experimental/features/metaplaylist.js +3 -1
  231. package/dist/commonjs/experimental/features/multi_thread.d.ts +8 -0
  232. package/dist/commonjs/experimental/features/multi_thread.js +14 -0
  233. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/load_and_push_segment.d.ts +3 -3
  234. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/load_and_push_segment.js +13 -14
  235. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts +3 -3
  236. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +24 -17
  237. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.d.ts +3 -5
  238. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.js +4 -5
  239. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +17 -12
  240. package/dist/commonjs/experimental/tools/index.d.ts +1 -2
  241. package/dist/commonjs/experimental/tools/index.js +1 -3
  242. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/index.d.ts +2 -0
  243. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +4 -4
  244. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +1 -1
  245. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -1
  246. package/dist/commonjs/features/features_object.js +5 -3
  247. package/dist/commonjs/features/list/dash.js +3 -1
  248. package/dist/commonjs/{experimental/features → features/list}/dash_wasm.js +3 -1
  249. package/dist/commonjs/features/list/html_sami_parser.js +4 -4
  250. package/dist/commonjs/features/list/html_srt_parser.js +4 -4
  251. package/dist/commonjs/features/list/html_text_buffer.js +2 -2
  252. package/dist/commonjs/features/list/html_ttml_parser.js +4 -4
  253. package/dist/commonjs/features/list/html_vtt_parser.js +4 -4
  254. package/dist/commonjs/features/list/index.d.ts +3 -0
  255. package/dist/commonjs/features/list/index.js +7 -1
  256. package/dist/commonjs/features/list/media_source_main.d.ts +8 -0
  257. package/dist/commonjs/features/list/media_source_main.js +14 -0
  258. package/dist/commonjs/features/list/native_sami_parser.js +4 -5
  259. package/dist/commonjs/features/list/native_srt_parser.js +4 -5
  260. package/dist/commonjs/features/list/native_text_buffer.js +2 -3
  261. package/dist/commonjs/features/list/native_ttml_parser.js +4 -5
  262. package/dist/commonjs/features/list/native_vtt_parser.js +4 -5
  263. package/dist/commonjs/features/list/smooth.d.ts +1 -1
  264. package/dist/commonjs/features/list/smooth.js +7 -3
  265. package/dist/commonjs/features/types.d.ts +28 -5
  266. package/dist/commonjs/manifest/adaptation.d.ts +66 -44
  267. package/dist/commonjs/manifest/adaptation.js +96 -78
  268. package/dist/commonjs/manifest/index.d.ts +4 -3
  269. package/dist/commonjs/manifest/index.js +16 -1
  270. package/dist/commonjs/manifest/manifest.d.ts +132 -9
  271. package/dist/commonjs/manifest/manifest.js +114 -72
  272. package/dist/commonjs/manifest/period.d.ts +41 -3
  273. package/dist/commonjs/manifest/period.js +120 -24
  274. package/dist/commonjs/manifest/representation.d.ts +61 -74
  275. package/dist/commonjs/manifest/representation.js +125 -45
  276. package/dist/commonjs/manifest/types.d.ts +382 -0
  277. package/dist/commonjs/manifest/types.js +0 -15
  278. package/dist/commonjs/manifest/update_period_in_place.d.ts +12 -9
  279. package/dist/commonjs/manifest/update_period_in_place.js +10 -6
  280. package/dist/commonjs/manifest/update_periods.d.ts +7 -4
  281. package/dist/commonjs/manifest/update_periods.js +53 -14
  282. package/dist/commonjs/manifest/utils.d.ts +156 -0
  283. package/dist/commonjs/manifest/utils.js +689 -1
  284. package/dist/commonjs/minimal.d.ts +3 -0
  285. package/dist/commonjs/minimal.js +6 -0
  286. package/dist/commonjs/mse/index.d.ts +1 -0
  287. package/dist/commonjs/mse/index.js +2 -0
  288. package/dist/commonjs/mse/main_codec_support_prober.d.ts +26 -0
  289. package/dist/commonjs/mse/main_codec_support_prober.js +44 -0
  290. package/dist/commonjs/mse/main_media_source_interface.d.ts +112 -0
  291. package/dist/commonjs/mse/main_media_source_interface.js +504 -0
  292. package/dist/commonjs/mse/types.d.ts +301 -0
  293. package/dist/commonjs/mse/types.js +2 -0
  294. package/dist/commonjs/mse/worker_codec_support_prober.d.ts +42 -0
  295. package/dist/commonjs/mse/worker_codec_support_prober.js +61 -0
  296. package/dist/commonjs/mse/worker_media_source_interface.d.ts +105 -0
  297. package/dist/commonjs/mse/worker_media_source_interface.js +368 -0
  298. package/dist/commonjs/multithread_types.d.ts +781 -0
  299. package/dist/commonjs/multithread_types.js +7 -0
  300. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +14 -16
  301. package/dist/commonjs/parsers/manifest/dash/js-parser/parse_from_document.js +2 -2
  302. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts +1 -1
  303. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +22 -7
  304. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/types.d.ts +55 -55
  305. package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +13 -1
  306. package/dist/commonjs/parsers/manifest/smooth/parse_protection_node.js +1 -1
  307. package/dist/commonjs/parsers/manifest/types.d.ts +8 -1
  308. package/dist/commonjs/public_types.d.ts +66 -21
  309. package/dist/commonjs/public_types.js +3 -13
  310. package/dist/commonjs/{core/segment_buffers/implementations/text/html/parsers.d.ts → text_displayer/html/html_parsers.d.ts} +0 -15
  311. package/dist/commonjs/{core/segment_buffers/implementations/text/html/parsers.js → text_displayer/html/html_parsers.js} +2 -17
  312. package/dist/commonjs/text_displayer/html/html_text_displayer.d.ts +100 -0
  313. package/dist/commonjs/{core/segment_buffers/implementations/text/html/html_text_segment_buffer.js → text_displayer/html/html_text_displayer.js} +96 -186
  314. package/dist/commonjs/text_displayer/html/index.d.ts +2 -0
  315. package/dist/commonjs/text_displayer/html/index.js +4 -0
  316. package/dist/commonjs/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.d.ts +4 -18
  317. package/dist/commonjs/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.js +6 -18
  318. package/dist/commonjs/text_displayer/html/update_proportional_elements.d.ts +15 -0
  319. package/dist/commonjs/{core/segment_buffers/implementations/text → text_displayer}/html/update_proportional_elements.js +0 -15
  320. package/dist/{es2017/core/segment_buffers/implementations/text → commonjs/text_displayer}/html/utils.d.ts +10 -16
  321. package/dist/commonjs/{core/segment_buffers/implementations/text → text_displayer}/html/utils.js +1 -17
  322. package/dist/commonjs/text_displayer/index.d.ts +2 -0
  323. package/dist/commonjs/text_displayer/index.js +2 -0
  324. package/dist/commonjs/text_displayer/manual_time_ranges.d.ts +14 -0
  325. package/dist/commonjs/text_displayer/manual_time_ranges.js +52 -0
  326. package/dist/commonjs/text_displayer/native/index.d.ts +2 -0
  327. package/dist/commonjs/text_displayer/native/index.js +4 -0
  328. package/dist/commonjs/text_displayer/native/native_parsers.d.ts +11 -0
  329. package/dist/commonjs/{core/segment_buffers/implementations/text/native/parsers.js → text_displayer/native/native_parsers.js} +2 -17
  330. package/dist/commonjs/text_displayer/native/native_text_displayer.d.ts +56 -0
  331. package/dist/commonjs/text_displayer/native/native_text_displayer.js +207 -0
  332. package/dist/commonjs/text_displayer/types.d.ts +74 -0
  333. package/dist/commonjs/text_displayer/types.js +2 -0
  334. package/dist/commonjs/tools/TextTrackRenderer/text_track_renderer.d.ts +1 -1
  335. package/dist/commonjs/tools/TextTrackRenderer/text_track_renderer.js +11 -15
  336. package/dist/commonjs/tools/index.d.ts +2 -1
  337. package/dist/commonjs/tools/index.js +3 -1
  338. package/dist/commonjs/{experimental/tools → tools}/parseBIFThumbnails/index.js +1 -1
  339. package/dist/commonjs/transports/dash/extract_complete_chunks.d.ts +1 -1
  340. package/dist/commonjs/transports/dash/extract_complete_chunks.js +35 -6
  341. package/dist/commonjs/transports/dash/get_events_out_of_emsgs.js +0 -1
  342. package/dist/commonjs/transports/dash/low_latency_segment_loader.js +2 -2
  343. package/dist/commonjs/transports/utils/generate_manifest_loader.js +2 -2
  344. package/dist/commonjs/utils/assert.d.ts +41 -0
  345. package/dist/commonjs/utils/assert.js +69 -3
  346. package/dist/commonjs/utils/event_emitter.js +8 -2
  347. package/dist/commonjs/utils/languages/ISO_639-1_to_ISO_639-3.js +182 -182
  348. package/dist/commonjs/utils/languages/ISO_639-2_to_ISO_639-3.js +19 -19
  349. package/dist/commonjs/utils/logger.d.ts +13 -3
  350. package/dist/commonjs/utils/logger.js +78 -21
  351. package/dist/commonjs/utils/monotonic_timestamp.d.ts +20 -4
  352. package/dist/commonjs/utils/monotonic_timestamp.js +22 -5
  353. package/dist/commonjs/utils/object_assign.d.ts +26 -5
  354. package/dist/commonjs/utils/object_assign.js +14 -3
  355. package/dist/commonjs/utils/request/fetch.js +8 -8
  356. package/dist/commonjs/utils/request/index.d.ts +2 -1
  357. package/dist/commonjs/utils/request/index.js +4 -1
  358. package/dist/{es2017/errors → commonjs/utils/request}/request_error.d.ts +12 -3
  359. package/dist/commonjs/{errors → utils/request}/request_error.js +11 -0
  360. package/dist/commonjs/utils/request/xhr.d.ts +4 -4
  361. package/dist/commonjs/utils/request/xhr.js +7 -7
  362. package/dist/commonjs/utils/retry_promise_with_backoff.d.ts +1 -2
  363. package/dist/commonjs/utils/string_parsing.js +1 -1
  364. package/dist/commonjs/utils/sync_or_async.d.ts +70 -0
  365. package/dist/commonjs/utils/sync_or_async.js +47 -0
  366. package/dist/commonjs/worker_entry_point.d.ts +5 -0
  367. package/dist/commonjs/worker_entry_point.js +8 -0
  368. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts +3 -0
  369. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +3 -0
  370. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts +3 -0
  371. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +3 -0
  372. package/dist/es2017/__GENERATED_CODE/index.d.ts +2 -0
  373. package/dist/es2017/__GENERATED_CODE/index.js +2 -0
  374. package/dist/es2017/compat/browser_compatibility_types.js +1 -1
  375. package/dist/es2017/compat/browser_detection.d.ts +3 -1
  376. package/dist/es2017/compat/browser_detection.js +26 -6
  377. package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +1 -1
  378. package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +1 -1
  379. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts +1 -1
  380. package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +1 -2
  381. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -1
  382. package/dist/es2017/compat/eme/eme-api-implementation.js +4 -3
  383. package/dist/es2017/compat/event_listeners.js +1 -1
  384. package/dist/es2017/compat/has_mse_in_worker.d.ts +2 -0
  385. package/dist/es2017/compat/has_mse_in_worker.js +4 -0
  386. package/dist/es2017/compat/has_webassembly.d.ts +6 -0
  387. package/dist/es2017/compat/has_webassembly.js +7 -0
  388. package/dist/es2017/compat/index.d.ts +1 -2
  389. package/dist/es2017/compat/index.js +1 -2
  390. package/dist/es2017/compat/is_codec_supported.js +5 -0
  391. package/dist/es2017/compat/is_vtt_cue.js +1 -1
  392. package/dist/es2017/compat/make_vtt_cue.js +1 -1
  393. package/dist/es2017/compat/on_height_width_change.js +1 -1
  394. package/dist/es2017/compat/patch_webkit_source_buffer.js +2 -2
  395. package/dist/es2017/config.d.ts +6 -17
  396. package/dist/es2017/config.js +4 -12
  397. package/dist/es2017/core/adaptive/adaptive_representation_selector.d.ts +2 -1
  398. package/dist/es2017/core/adaptive/adaptive_representation_selector.js +2 -2
  399. package/dist/es2017/core/api/debug/buffer_graph.js +3 -3
  400. package/dist/es2017/core/api/debug/modules/general_info.js +20 -8
  401. package/dist/es2017/core/api/debug/modules/segment_buffer_content.js +5 -4
  402. package/dist/es2017/core/api/option_utils.d.ts +3 -2
  403. package/dist/es2017/core/api/option_utils.js +15 -4
  404. package/dist/es2017/core/api/playback_observer.d.ts +55 -24
  405. package/dist/es2017/core/api/playback_observer.js +103 -75
  406. package/dist/es2017/core/api/public_api.d.ts +35 -12
  407. package/dist/es2017/core/api/public_api.js +323 -143
  408. package/dist/es2017/core/api/track_management/track_dispatcher.d.ts +12 -8
  409. package/dist/es2017/core/api/track_management/track_dispatcher.js +30 -23
  410. package/dist/es2017/core/api/track_management/tracks_store.d.ts +26 -14
  411. package/dist/es2017/core/api/track_management/tracks_store.js +95 -58
  412. package/dist/es2017/core/decrypt/attach_media_keys.d.ts +2 -1
  413. package/dist/es2017/core/decrypt/attach_media_keys.js +2 -1
  414. package/dist/es2017/core/decrypt/content_decryptor.js +35 -89
  415. package/dist/es2017/core/decrypt/init_media_keys.js +11 -1
  416. package/dist/es2017/core/decrypt/types.d.ts +11 -5
  417. package/dist/es2017/core/decrypt/utils/check_key_statuses.js +1 -1
  418. package/dist/{commonjs/utils → es2017/core/fetchers/segment}/initialization_segment_cache.d.ts +1 -1
  419. package/dist/es2017/core/fetchers/segment/segment_fetcher.js +2 -2
  420. package/dist/es2017/core/fetchers/utils/error_selector.js +2 -1
  421. package/dist/es2017/core/fetchers/utils/schedule_request.js +2 -1
  422. package/dist/es2017/core/init/directfile_content_initializer.js +8 -3
  423. package/dist/es2017/core/init/media_source_content_initializer.d.ts +7 -22
  424. package/dist/es2017/core/init/media_source_content_initializer.js +214 -106
  425. package/dist/es2017/core/init/multithread/main_thread/multi_thread_content_initializer.d.ts +167 -0
  426. package/dist/es2017/core/init/multithread/main_thread/multi_thread_content_initializer.js +1313 -0
  427. package/dist/es2017/core/init/multithread/main_thread/send_message.d.ts +2 -0
  428. package/dist/es2017/core/init/multithread/main_thread/send_message.js +10 -0
  429. package/dist/es2017/core/init/multithread/worker/content_preparer.d.ts +92 -0
  430. package/dist/es2017/core/init/multithread/worker/content_preparer.js +236 -0
  431. package/dist/es2017/core/init/multithread/worker/globals.d.ts +13 -0
  432. package/dist/es2017/core/init/multithread/worker/globals.js +18 -0
  433. package/dist/es2017/core/init/multithread/worker/index.d.ts +2 -0
  434. package/dist/es2017/core/init/multithread/worker/index.js +2 -0
  435. package/dist/es2017/core/init/multithread/worker/send_message.d.ts +3 -0
  436. package/dist/es2017/core/init/multithread/worker/send_message.js +20 -0
  437. package/dist/es2017/core/init/multithread/worker/track_choice_setter.d.ts +19 -0
  438. package/dist/es2017/core/init/multithread/worker/track_choice_setter.js +114 -0
  439. package/dist/es2017/core/init/multithread/worker/worker_playback_observer.d.ts +21 -0
  440. package/dist/es2017/core/init/multithread/worker/worker_playback_observer.js +43 -0
  441. package/dist/es2017/core/init/multithread/worker/worker_portal.d.ts +1 -0
  442. package/dist/es2017/core/init/multithread/worker/worker_portal.js +665 -0
  443. package/dist/es2017/core/init/multithread/worker/worker_text_displayer_interface.d.ts +64 -0
  444. package/dist/es2017/core/init/multithread/worker/worker_text_displayer_interface.js +121 -0
  445. package/dist/es2017/core/init/types.d.ts +21 -12
  446. package/dist/es2017/core/init/types.js +0 -1
  447. package/dist/es2017/core/init/utils/DecipherabilityFreezeDetector.d.ts +54 -0
  448. package/dist/es2017/core/init/utils/DecipherabilityFreezeDetector.js +93 -0
  449. package/dist/es2017/core/init/utils/create_content_time_boundaries_observer.d.ts +28 -0
  450. package/dist/es2017/core/init/utils/create_content_time_boundaries_observer.js +41 -0
  451. package/dist/es2017/core/init/utils/create_core_playback_observer.d.ts +61 -0
  452. package/dist/es2017/core/init/utils/create_core_playback_observer.js +122 -0
  453. package/dist/es2017/core/init/utils/create_media_source.d.ts +3 -3
  454. package/dist/es2017/core/init/utils/create_media_source.js +28 -37
  455. package/dist/es2017/core/init/utils/get_initial_time.d.ts +2 -2
  456. package/dist/es2017/core/init/utils/get_initial_time.js +6 -5
  457. package/dist/es2017/core/init/utils/get_loaded_reference.js +7 -5
  458. package/dist/es2017/core/init/utils/initial_seek_and_play.js +55 -6
  459. package/dist/es2017/core/init/utils/initialize_content_decryption.d.ts +7 -1
  460. package/dist/es2017/core/init/utils/initialize_content_decryption.js +6 -0
  461. package/dist/es2017/core/init/utils/main_thread_text_displayer_interface.d.ts +35 -0
  462. package/dist/es2017/core/init/utils/main_thread_text_displayer_interface.js +50 -0
  463. package/dist/es2017/core/init/utils/rebuffering_controller.d.ts +5 -38
  464. package/dist/es2017/core/init/utils/rebuffering_controller.js +3 -80
  465. package/dist/es2017/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.d.ts +2 -2
  466. package/dist/es2017/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.js +24 -1
  467. package/dist/es2017/core/init/utils/stream_events_emitter/stream_events_emitter.d.ts +3 -2
  468. package/dist/es2017/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -4
  469. package/dist/es2017/core/segment_buffers/garbage_collector.d.ts +3 -1
  470. package/dist/es2017/core/segment_buffers/garbage_collector.js +14 -5
  471. package/dist/es2017/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +26 -74
  472. package/dist/es2017/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +111 -294
  473. package/dist/es2017/core/segment_buffers/implementations/index.d.ts +2 -1
  474. package/dist/es2017/core/segment_buffers/implementations/index.js +1 -1
  475. package/dist/es2017/core/segment_buffers/implementations/text/index.d.ts +3 -0
  476. package/dist/es2017/core/segment_buffers/implementations/text/index.js +2 -0
  477. package/dist/es2017/core/segment_buffers/implementations/text/text_segment_buffer.d.ts +89 -0
  478. package/dist/es2017/core/segment_buffers/implementations/text/text_segment_buffer.js +152 -0
  479. package/dist/es2017/core/segment_buffers/implementations/types.d.ts +46 -57
  480. package/dist/es2017/core/segment_buffers/implementations/types.js +22 -29
  481. package/dist/es2017/core/segment_buffers/index.d.ts +3 -3
  482. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.d.ts +23 -9
  483. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.js +53 -21
  484. package/dist/es2017/core/segment_buffers/segment_buffers_store.d.ts +7 -16
  485. package/dist/es2017/core/segment_buffers/segment_buffers_store.js +14 -23
  486. package/dist/es2017/core/stream/adaptation/adaptation_stream.js +14 -7
  487. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.d.ts +19 -5
  488. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.js +33 -60
  489. package/dist/es2017/core/stream/adaptation/types.d.ts +17 -28
  490. package/dist/es2017/core/stream/index.d.ts +2 -1
  491. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts +4 -4
  492. package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
  493. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +11 -2
  494. package/dist/es2017/core/stream/period/period_stream.js +55 -21
  495. package/dist/es2017/core/stream/period/types.d.ts +11 -4
  496. package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.js +44 -73
  497. package/dist/es2017/core/stream/representation/representation_stream.js +4 -2
  498. package/dist/es2017/core/stream/representation/types.d.ts +30 -3
  499. package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.d.ts +5 -2
  500. package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.js +28 -11
  501. package/dist/es2017/core/stream/representation/utils/get_buffer_status.d.ts +2 -2
  502. package/dist/es2017/core/stream/representation/utils/get_buffer_status.js +22 -12
  503. package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts +2 -2
  504. package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +2 -6
  505. package/dist/es2017/core/stream/representation/utils/push_init_segment.d.ts +3 -1
  506. package/dist/es2017/core/stream/representation/utils/push_init_segment.js +2 -3
  507. package/dist/es2017/core/stream/representation/utils/push_media_segment.d.ts +3 -1
  508. package/dist/es2017/core/stream/representation/utils/push_media_segment.js +2 -3
  509. package/dist/es2017/default_config.d.ts +31 -34
  510. package/dist/es2017/default_config.js +44 -47
  511. package/dist/es2017/errors/encrypted_media_error.d.ts +17 -0
  512. package/dist/es2017/errors/encrypted_media_error.js +13 -0
  513. package/dist/es2017/errors/error_codes.d.ts +4 -3
  514. package/dist/es2017/errors/error_codes.js +3 -7
  515. package/dist/es2017/errors/index.d.ts +7 -8
  516. package/dist/es2017/errors/index.js +2 -3
  517. package/dist/es2017/errors/media_error.d.ts +21 -18
  518. package/dist/es2017/errors/media_error.js +15 -19
  519. package/dist/es2017/errors/network_error.d.ts +15 -1
  520. package/dist/es2017/errors/network_error.js +12 -0
  521. package/dist/es2017/errors/other_error.d.ts +14 -0
  522. package/dist/es2017/errors/other_error.js +12 -0
  523. package/dist/es2017/errors/source_buffer_error.d.ts +40 -0
  524. package/dist/es2017/errors/source_buffer_error.js +41 -0
  525. package/dist/es2017/experimental/features/index.d.ts +1 -2
  526. package/dist/es2017/experimental/features/index.js +1 -2
  527. package/dist/es2017/experimental/features/local.js +3 -1
  528. package/dist/es2017/experimental/features/metaplaylist.js +3 -1
  529. package/dist/es2017/experimental/features/multi_thread.d.ts +8 -0
  530. package/dist/es2017/experimental/features/multi_thread.js +11 -0
  531. package/dist/es2017/experimental/tools/VideoThumbnailLoader/load_and_push_segment.d.ts +3 -3
  532. package/dist/es2017/experimental/tools/VideoThumbnailLoader/load_and_push_segment.js +11 -15
  533. package/dist/es2017/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts +3 -3
  534. package/dist/es2017/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +25 -18
  535. package/dist/es2017/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.d.ts +3 -5
  536. package/dist/es2017/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.js +4 -5
  537. package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +17 -12
  538. package/dist/es2017/experimental/tools/index.d.ts +1 -2
  539. package/dist/es2017/experimental/tools/index.js +1 -2
  540. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/index.d.ts +2 -0
  541. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +4 -4
  542. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +1 -1
  543. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -1
  544. package/dist/es2017/features/features_object.js +5 -3
  545. package/dist/es2017/features/list/dash.js +3 -1
  546. package/dist/es2017/{experimental/features → features/list}/dash_wasm.js +3 -1
  547. package/dist/es2017/features/list/html_sami_parser.js +2 -2
  548. package/dist/es2017/features/list/html_srt_parser.js +2 -2
  549. package/dist/es2017/features/list/html_text_buffer.js +2 -2
  550. package/dist/es2017/features/list/html_ttml_parser.js +2 -2
  551. package/dist/es2017/features/list/html_vtt_parser.js +2 -2
  552. package/dist/es2017/features/list/index.d.ts +3 -0
  553. package/dist/es2017/features/list/index.js +3 -0
  554. package/dist/es2017/features/list/media_source_main.d.ts +8 -0
  555. package/dist/es2017/features/list/media_source_main.js +11 -0
  556. package/dist/es2017/features/list/native_sami_parser.js +2 -3
  557. package/dist/es2017/features/list/native_srt_parser.js +2 -3
  558. package/dist/es2017/features/list/native_text_buffer.js +2 -3
  559. package/dist/es2017/features/list/native_ttml_parser.js +2 -3
  560. package/dist/es2017/features/list/native_vtt_parser.js +2 -3
  561. package/dist/es2017/features/list/smooth.d.ts +1 -1
  562. package/dist/es2017/features/list/smooth.js +7 -3
  563. package/dist/es2017/features/types.d.ts +28 -5
  564. package/dist/es2017/manifest/adaptation.d.ts +66 -44
  565. package/dist/es2017/manifest/adaptation.js +60 -79
  566. package/dist/es2017/manifest/index.d.ts +4 -3
  567. package/dist/es2017/manifest/index.js +2 -2
  568. package/dist/es2017/manifest/manifest.d.ts +132 -9
  569. package/dist/es2017/manifest/manifest.js +73 -53
  570. package/dist/es2017/manifest/period.d.ts +41 -3
  571. package/dist/es2017/manifest/period.js +87 -24
  572. package/dist/es2017/manifest/representation.d.ts +61 -74
  573. package/dist/es2017/manifest/representation.js +111 -55
  574. package/dist/es2017/manifest/types.d.ts +382 -0
  575. package/dist/es2017/manifest/types.js +0 -15
  576. package/dist/es2017/manifest/update_period_in_place.d.ts +12 -9
  577. package/dist/es2017/manifest/update_period_in_place.js +11 -7
  578. package/dist/es2017/manifest/update_periods.d.ts +7 -4
  579. package/dist/es2017/manifest/update_periods.js +54 -15
  580. package/dist/es2017/manifest/utils.d.ts +156 -0
  581. package/dist/es2017/manifest/utils.js +470 -0
  582. package/dist/es2017/minimal.d.ts +3 -0
  583. package/dist/es2017/minimal.js +6 -0
  584. package/dist/es2017/mse/index.d.ts +1 -0
  585. package/dist/es2017/mse/index.js +1 -0
  586. package/dist/es2017/mse/main_codec_support_prober.d.ts +26 -0
  587. package/dist/es2017/mse/main_codec_support_prober.js +41 -0
  588. package/dist/es2017/mse/main_media_source_interface.d.ts +112 -0
  589. package/dist/es2017/mse/main_media_source_interface.js +406 -0
  590. package/dist/es2017/mse/types.d.ts +301 -0
  591. package/dist/es2017/mse/types.js +1 -0
  592. package/dist/es2017/mse/worker_codec_support_prober.d.ts +42 -0
  593. package/dist/es2017/mse/worker_codec_support_prober.js +58 -0
  594. package/dist/es2017/mse/worker_media_source_interface.d.ts +105 -0
  595. package/dist/es2017/mse/worker_media_source_interface.js +303 -0
  596. package/dist/es2017/multithread_types.d.ts +781 -0
  597. package/dist/es2017/multithread_types.js +6 -0
  598. package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +15 -16
  599. package/dist/es2017/parsers/manifest/dash/js-parser/parse_from_document.js +1 -1
  600. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts +1 -1
  601. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +21 -5
  602. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/types.d.ts +55 -55
  603. package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +13 -1
  604. package/dist/es2017/parsers/manifest/smooth/parse_protection_node.js +1 -1
  605. package/dist/es2017/parsers/manifest/types.d.ts +8 -1
  606. package/dist/es2017/public_types.d.ts +66 -21
  607. package/dist/es2017/public_types.js +3 -13
  608. package/dist/es2017/{core/segment_buffers/implementations/text/html/parsers.d.ts → text_displayer/html/html_parsers.d.ts} +0 -15
  609. package/dist/es2017/{core/segment_buffers/implementations/text/html/parsers.js → text_displayer/html/html_parsers.js} +2 -17
  610. package/dist/es2017/text_displayer/html/html_text_displayer.d.ts +100 -0
  611. package/dist/es2017/{core/segment_buffers/implementations/text/html/html_text_segment_buffer.js → text_displayer/html/html_text_displayer.js} +81 -153
  612. package/dist/es2017/text_displayer/html/index.d.ts +2 -0
  613. package/dist/es2017/text_displayer/html/index.js +2 -0
  614. package/dist/es2017/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.d.ts +4 -18
  615. package/dist/es2017/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.js +6 -18
  616. package/dist/es2017/text_displayer/html/update_proportional_elements.d.ts +15 -0
  617. package/dist/es2017/{core/segment_buffers/implementations/text → text_displayer}/html/update_proportional_elements.js +0 -15
  618. package/dist/{commonjs/core/segment_buffers/implementations/text → es2017/text_displayer}/html/utils.d.ts +10 -16
  619. package/dist/es2017/{core/segment_buffers/implementations/text → text_displayer}/html/utils.js +1 -17
  620. package/dist/es2017/text_displayer/index.d.ts +2 -0
  621. package/dist/es2017/text_displayer/index.js +1 -0
  622. package/dist/es2017/text_displayer/manual_time_ranges.d.ts +14 -0
  623. package/dist/es2017/text_displayer/manual_time_ranges.js +48 -0
  624. package/dist/es2017/text_displayer/native/index.d.ts +2 -0
  625. package/dist/es2017/text_displayer/native/index.js +2 -0
  626. package/dist/es2017/text_displayer/native/native_parsers.d.ts +11 -0
  627. package/dist/es2017/{core/segment_buffers/implementations/text/native/parsers.js → text_displayer/native/native_parsers.js} +2 -17
  628. package/dist/es2017/text_displayer/native/native_text_displayer.d.ts +56 -0
  629. package/dist/es2017/text_displayer/native/native_text_displayer.js +203 -0
  630. package/dist/es2017/text_displayer/types.d.ts +74 -0
  631. package/dist/es2017/text_displayer/types.js +1 -0
  632. package/dist/es2017/tools/TextTrackRenderer/text_track_renderer.d.ts +1 -1
  633. package/dist/es2017/tools/TextTrackRenderer/text_track_renderer.js +12 -17
  634. package/dist/es2017/tools/index.d.ts +2 -1
  635. package/dist/es2017/tools/index.js +4 -2
  636. package/dist/es2017/{experimental/tools → tools}/parseBIFThumbnails/index.js +1 -1
  637. package/dist/es2017/transports/dash/extract_complete_chunks.d.ts +1 -1
  638. package/dist/es2017/transports/dash/extract_complete_chunks.js +11 -7
  639. package/dist/es2017/transports/dash/get_events_out_of_emsgs.js +0 -1
  640. package/dist/es2017/transports/dash/low_latency_segment_loader.js +2 -2
  641. package/dist/es2017/transports/utils/generate_manifest_loader.js +1 -1
  642. package/dist/es2017/utils/assert.d.ts +41 -0
  643. package/dist/es2017/utils/assert.js +47 -1
  644. package/dist/es2017/utils/event_emitter.js +8 -2
  645. package/dist/es2017/utils/languages/ISO_639-1_to_ISO_639-3.js +182 -182
  646. package/dist/es2017/utils/languages/ISO_639-2_to_ISO_639-3.js +19 -19
  647. package/dist/es2017/utils/logger.d.ts +13 -3
  648. package/dist/es2017/utils/logger.js +30 -14
  649. package/dist/es2017/utils/monotonic_timestamp.d.ts +20 -4
  650. package/dist/es2017/utils/monotonic_timestamp.js +21 -5
  651. package/dist/es2017/utils/object_assign.d.ts +26 -5
  652. package/dist/es2017/utils/object_assign.js +14 -3
  653. package/dist/es2017/utils/request/fetch.js +7 -7
  654. package/dist/es2017/utils/request/index.d.ts +2 -1
  655. package/dist/es2017/utils/request/index.js +2 -1
  656. package/dist/{commonjs/errors → es2017/utils/request}/request_error.d.ts +12 -3
  657. package/dist/es2017/{errors → utils/request}/request_error.js +10 -0
  658. package/dist/es2017/utils/request/xhr.d.ts +4 -4
  659. package/dist/es2017/utils/request/xhr.js +7 -7
  660. package/dist/es2017/utils/retry_promise_with_backoff.d.ts +1 -2
  661. package/dist/es2017/utils/string_parsing.js +1 -1
  662. package/dist/es2017/utils/sync_or_async.d.ts +70 -0
  663. package/dist/es2017/utils/sync_or_async.js +45 -0
  664. package/dist/es2017/worker_entry_point.d.ts +5 -0
  665. package/dist/es2017/worker_entry_point.js +6 -0
  666. package/dist/mpd-parser.wasm +0 -0
  667. package/dist/rx-player.js +28189 -26269
  668. package/dist/rx-player.min.js +1 -1
  669. package/dist/worker.js +3 -0
  670. package/package.json +88 -84
  671. package/scripts/build_demo.mjs +31 -2
  672. package/scripts/bundle_worker.mjs +143 -0
  673. package/scripts/generate_build.mjs +185 -0
  674. package/scripts/generate_embeds.mjs +145 -0
  675. package/scripts/make-dev-releases +41 -16
  676. package/scripts/update-version +4 -4
  677. package/scripts/wasm-optimize.mjs +63 -0
  678. package/scripts/wasm-strip.mjs +6 -0
  679. package/sonar-project.properties +1 -1
  680. package/src/README.md +8 -1
  681. package/src/TODO_README.md +231 -0
  682. package/src/__GENERATED_CODE/embedded_dash_wasm.ts +3 -0
  683. package/src/__GENERATED_CODE/embedded_worker.ts +3 -0
  684. package/src/__GENERATED_CODE/index.ts +2 -0
  685. package/src/compat/README.md +7 -0
  686. package/src/compat/__tests__/browser_compatibility_types.test.ts +9 -9
  687. package/src/compat/__tests__/is_vtt_cue.test.ts +1 -1
  688. package/src/compat/__tests__/make_vtt_cue.test.ts +1 -1
  689. package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +1 -1
  690. package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +1 -1
  691. package/src/compat/browser_compatibility_types.ts +1 -1
  692. package/src/compat/browser_detection.ts +23 -3
  693. package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -1
  694. package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -1
  695. package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +4 -3
  696. package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -1
  697. package/src/compat/eme/eme-api-implementation.ts +3 -3
  698. package/src/compat/event_listeners.ts +1 -1
  699. package/src/compat/has_mse_in_worker.ts +5 -0
  700. package/src/compat/has_webassembly.ts +7 -0
  701. package/src/compat/index.ts +0 -2
  702. package/src/compat/is_codec_supported.ts +5 -0
  703. package/src/compat/is_vtt_cue.ts +1 -1
  704. package/src/compat/make_vtt_cue.ts +1 -1
  705. package/src/compat/on_height_width_change.ts +1 -1
  706. package/src/compat/patch_webkit_source_buffer.ts +2 -2
  707. package/src/config.ts +4 -12
  708. package/src/core/README.md +7 -0
  709. package/src/core/adaptive/README.md +11 -0
  710. package/src/core/adaptive/adaptive_representation_selector.ts +4 -4
  711. package/src/core/api/README.md +7 -0
  712. package/src/core/api/__tests__/option_utils.test.ts +8 -0
  713. package/src/core/api/__tests__/public_api.test.ts +13 -25
  714. package/src/core/api/debug/modules/general_info.ts +13 -3
  715. package/src/core/api/debug/modules/segment_buffer_content.ts +11 -10
  716. package/src/core/api/option_utils.ts +20 -7
  717. package/src/core/api/playback_observer.ts +193 -116
  718. package/src/core/api/public_api.ts +398 -181
  719. package/src/core/api/track_management/README.md +7 -0
  720. package/src/core/api/track_management/track_dispatcher.ts +48 -36
  721. package/src/core/api/track_management/tracks_store.ts +162 -100
  722. package/src/core/decrypt/README.md +8 -0
  723. package/src/core/decrypt/attach_media_keys.ts +5 -2
  724. package/src/core/decrypt/content_decryptor.ts +40 -117
  725. package/src/core/decrypt/init_media_keys.ts +10 -1
  726. package/src/core/decrypt/types.ts +17 -8
  727. package/src/core/decrypt/utils/check_key_statuses.ts +1 -1
  728. package/src/core/fetchers/README.md +11 -0
  729. package/src/{utils → core/fetchers/segment}/__tests__/initialization_segment_cache.test.ts +1 -1
  730. package/src/{utils → core/fetchers/segment}/initialization_segment_cache.ts +1 -1
  731. package/src/core/fetchers/segment/segment_fetcher.ts +2 -3
  732. package/src/core/fetchers/utils/error_selector.ts +1 -1
  733. package/src/core/fetchers/utils/schedule_request.ts +1 -1
  734. package/src/core/init/README.md +15 -0
  735. package/src/core/init/directfile_content_initializer.ts +7 -8
  736. package/src/core/init/media_source_content_initializer.ts +275 -145
  737. package/src/core/init/multithread/main_thread/multi_thread_content_initializer.ts +1832 -0
  738. package/src/core/init/multithread/main_thread/send_message.ts +15 -0
  739. package/src/core/init/multithread/worker/content_preparer.ts +392 -0
  740. package/src/core/init/multithread/worker/globals.ts +36 -0
  741. package/src/core/init/multithread/worker/index.ts +2 -0
  742. package/src/core/init/multithread/worker/send_message.ts +29 -0
  743. package/src/core/init/multithread/worker/track_choice_setter.ts +166 -0
  744. package/src/core/init/multithread/worker/worker_playback_observer.ts +79 -0
  745. package/src/core/init/multithread/worker/worker_portal.ts +859 -0
  746. package/src/core/init/multithread/worker/worker_text_displayer_interface.ts +162 -0
  747. package/src/core/init/types.ts +25 -15
  748. package/src/core/init/utils/DecipherabilityFreezeDetector.ts +133 -0
  749. package/src/core/init/utils/create_content_time_boundaries_observer.ts +71 -0
  750. package/src/core/init/utils/create_core_playback_observer.ts +199 -0
  751. package/src/core/init/utils/create_media_source.ts +31 -49
  752. package/src/core/init/utils/get_initial_time.ts +12 -7
  753. package/src/core/init/utils/get_loaded_reference.ts +7 -5
  754. package/src/core/init/utils/initial_seek_and_play.ts +59 -11
  755. package/src/core/init/utils/initialize_content_decryption.ts +19 -2
  756. package/src/core/init/utils/main_thread_text_displayer_interface.ts +59 -0
  757. package/src/core/init/utils/rebuffering_controller.ts +12 -120
  758. package/src/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.ts +27 -3
  759. package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +8 -8
  760. package/src/core/segment_buffers/README.md +11 -0
  761. package/src/core/segment_buffers/garbage_collector.ts +15 -5
  762. package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +145 -427
  763. package/src/core/segment_buffers/implementations/index.ts +5 -1
  764. package/src/core/segment_buffers/implementations/text/index.ts +6 -0
  765. package/src/core/segment_buffers/implementations/text/text_segment_buffer.ts +249 -0
  766. package/src/core/segment_buffers/implementations/types.ts +50 -69
  767. package/src/core/segment_buffers/index.ts +8 -11
  768. package/src/core/segment_buffers/inventory/segment_inventory.ts +89 -23
  769. package/src/core/segment_buffers/segment_buffers_store.ts +29 -39
  770. package/src/core/stream/README.md +10 -0
  771. package/src/core/stream/adaptation/adaptation_stream.ts +19 -7
  772. package/src/core/stream/adaptation/get_representations_switch_strategy.ts +56 -80
  773. package/src/core/stream/adaptation/types.ts +18 -29
  774. package/src/core/stream/index.ts +2 -0
  775. package/src/core/stream/orchestrator/README.md +10 -0
  776. package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +7 -8
  777. package/src/core/stream/orchestrator/stream_orchestrator.ts +12 -2
  778. package/src/core/stream/period/period_stream.ts +58 -30
  779. package/src/core/stream/period/types.ts +10 -4
  780. package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +46 -90
  781. package/src/core/stream/representation/README.md +10 -0
  782. package/src/core/stream/representation/representation_stream.ts +4 -2
  783. package/src/core/stream/representation/types.ts +31 -3
  784. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +34 -16
  785. package/src/core/stream/representation/utils/get_buffer_status.ts +31 -16
  786. package/src/core/stream/representation/utils/get_needed_segments.ts +6 -12
  787. package/src/core/stream/representation/utils/push_init_segment.ts +8 -5
  788. package/src/core/stream/representation/utils/push_media_segment.ts +8 -5
  789. package/src/default_config.ts +36 -40
  790. package/src/errors/README.md +11 -0
  791. package/src/errors/__tests__/is_known_error.test.ts +1 -7
  792. package/src/errors/__tests__/network_error.test.ts +1 -1
  793. package/src/errors/encrypted_media_error.ts +25 -0
  794. package/src/errors/error_codes.ts +5 -13
  795. package/src/errors/index.ts +20 -9
  796. package/src/errors/media_error.ts +32 -50
  797. package/src/errors/network_error.ts +25 -1
  798. package/src/errors/other_error.ts +21 -0
  799. package/src/errors/source_buffer_error.ts +63 -0
  800. package/src/experimental/features/__tests__/index.test.ts +0 -6
  801. package/src/experimental/features/__tests__/local.test.ts +6 -2
  802. package/src/experimental/features/__tests__/metaplaylist.test.ts +6 -2
  803. package/src/experimental/features/__tests__/multi_thread.test.ts +18 -0
  804. package/src/experimental/features/index.ts +1 -2
  805. package/src/experimental/features/local.ts +3 -1
  806. package/src/experimental/features/metaplaylist.ts +3 -1
  807. package/src/experimental/features/multi_thread.ts +16 -0
  808. package/src/experimental/tools/VideoThumbnailLoader/load_and_push_segment.ts +13 -19
  809. package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +29 -20
  810. package/src/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.ts +7 -12
  811. package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +23 -21
  812. package/src/experimental/tools/index.ts +0 -2
  813. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +1 -1
  814. package/src/experimental/tools/mediaCapabilitiesProber/index.ts +2 -0
  815. package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -4
  816. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +1 -1
  817. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -1
  818. package/src/features/features_object.ts +5 -3
  819. package/src/features/list/__tests__/dash.test.ts +7 -3
  820. package/src/features/list/__tests__/html_sami_parser.test.ts +3 -3
  821. package/src/features/list/__tests__/html_srt_parser.test.ts +2 -3
  822. package/src/features/list/__tests__/html_text_buffer.test.ts +3 -4
  823. package/src/features/list/__tests__/html_ttml_parser.test.ts +2 -3
  824. package/src/features/list/__tests__/html_vtt_parser.test.ts +2 -3
  825. package/src/features/list/__tests__/index.test.ts +6 -0
  826. package/src/features/list/__tests__/native_sami_parser.test.ts +3 -3
  827. package/src/features/list/__tests__/native_srt_parser.test.ts +2 -2
  828. package/src/features/list/__tests__/native_text_buffer.test.ts +3 -4
  829. package/src/features/list/__tests__/native_ttml_parser.test.ts +2 -3
  830. package/src/features/list/__tests__/native_vtt_parser.test.ts +2 -3
  831. package/src/features/list/__tests__/smooth.test.ts +5 -3
  832. package/src/features/list/dash.ts +3 -1
  833. package/src/{experimental/features → features/list}/dash_wasm.ts +3 -1
  834. package/src/features/list/html_sami_parser.ts +2 -2
  835. package/src/features/list/html_srt_parser.ts +2 -2
  836. package/src/features/list/html_text_buffer.ts +2 -2
  837. package/src/features/list/html_ttml_parser.ts +2 -2
  838. package/src/features/list/html_vtt_parser.ts +2 -2
  839. package/src/features/list/index.ts +3 -0
  840. package/src/features/list/media_source_main.ts +14 -0
  841. package/src/features/list/native_sami_parser.ts +2 -3
  842. package/src/features/list/native_srt_parser.ts +2 -3
  843. package/src/features/list/native_text_buffer.ts +2 -3
  844. package/src/features/list/native_ttml_parser.ts +2 -3
  845. package/src/features/list/native_vtt_parser.ts +2 -3
  846. package/src/features/list/smooth.ts +8 -3
  847. package/src/features/types.ts +29 -5
  848. package/src/manifest/__tests__/adaptation.test.ts +3 -62
  849. package/src/manifest/__tests__/manifest.test.ts +37 -26
  850. package/src/manifest/__tests__/representation.test.ts +360 -142
  851. package/src/manifest/__tests__/update_period_in_place.test.ts +406 -324
  852. package/src/manifest/__tests__/update_periods.test.ts +240 -162
  853. package/src/manifest/adaptation.ts +115 -132
  854. package/src/manifest/index.ts +40 -2
  855. package/src/manifest/manifest.ts +120 -61
  856. package/src/manifest/period.ts +113 -28
  857. package/src/manifest/representation.ts +150 -137
  858. package/src/manifest/types.ts +407 -0
  859. package/src/manifest/update_period_in_place.ts +31 -18
  860. package/src/manifest/update_periods.ts +71 -19
  861. package/src/manifest/utils.ts +686 -0
  862. package/src/minimal.ts +7 -0
  863. package/src/mse/README.md +33 -0
  864. package/src/mse/index.ts +7 -0
  865. package/src/mse/main_codec_support_prober.ts +52 -0
  866. package/src/mse/main_media_source_interface.ts +569 -0
  867. package/src/mse/types.ts +318 -0
  868. package/src/mse/worker_codec_support_prober.ts +79 -0
  869. package/src/mse/worker_media_source_interface.ts +468 -0
  870. package/src/multithread_types.ts +942 -0
  871. package/src/parsers/README.md +7 -0
  872. package/src/parsers/manifest/dash/common/parse_periods.ts +15 -18
  873. package/src/parsers/manifest/dash/js-parser/parse_from_document.ts +1 -1
  874. package/src/parsers/manifest/dash/wasm-parser/README.md +18 -14
  875. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +22 -6
  876. package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +13 -1
  877. package/src/parsers/manifest/types.ts +5 -1
  878. package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.test.ts +1 -1
  879. package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +1 -1
  880. package/src/public_types.ts +72 -21
  881. package/src/{core/segment_buffers/implementations/text → text_displayer}/html/__tests__/utils.test.ts +1 -1
  882. package/src/{core/segment_buffers/implementations/text/html/parsers.ts → text_displayer/html/html_parsers.ts} +2 -18
  883. package/src/{core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts → text_displayer/html/html_text_displayer.ts} +107 -190
  884. package/src/text_displayer/html/index.ts +2 -0
  885. package/src/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.ts +8 -22
  886. package/src/{core/segment_buffers/implementations/text → text_displayer}/html/update_proportional_elements.ts +0 -16
  887. package/src/{core/segment_buffers/implementations/text → text_displayer}/html/utils.ts +8 -21
  888. package/src/text_displayer/index.ts +9 -0
  889. package/src/text_displayer/manual_time_ranges.ts +64 -0
  890. package/src/text_displayer/native/index.ts +3 -0
  891. package/src/{core/segment_buffers/implementations/text/native/parsers.ts → text_displayer/native/native_parsers.ts} +4 -19
  892. package/src/text_displayer/native/native_text_displayer.ts +268 -0
  893. package/src/text_displayer/types.ts +76 -0
  894. package/src/tools/TextTrackRenderer/text_track_renderer.ts +13 -18
  895. package/src/tools/index.ts +5 -1
  896. package/src/{experimental/tools → tools}/parseBIFThumbnails/index.ts +1 -1
  897. package/src/transports/dash/extract_complete_chunks.ts +12 -8
  898. package/src/transports/dash/get_events_out_of_emsgs.ts +0 -1
  899. package/src/transports/dash/low_latency_segment_loader.ts +2 -2
  900. package/src/transports/utils/generate_manifest_loader.ts +1 -1
  901. package/src/utils/README.md +7 -0
  902. package/src/utils/__tests__/assert.test.ts +31 -0
  903. package/src/utils/__tests__/base64.test.ts +1 -1
  904. package/src/utils/__tests__/event_emitter.test.ts +0 -24
  905. package/src/utils/__tests__/id_generator.test.ts +1 -1
  906. package/src/utils/__tests__/object_assign.test.ts +15 -0
  907. package/src/utils/assert.ts +53 -1
  908. package/src/utils/event_emitter.ts +8 -2
  909. package/src/utils/logger.ts +45 -15
  910. package/src/utils/monotonic_timestamp.ts +24 -5
  911. package/src/utils/object_assign.ts +46 -14
  912. package/src/utils/request/fetch.ts +9 -10
  913. package/src/utils/request/index.ts +10 -0
  914. package/src/{errors → utils/request}/request_error.ts +27 -4
  915. package/src/utils/request/xhr.ts +13 -12
  916. package/src/utils/retry_promise_with_backoff.ts +1 -2
  917. package/src/utils/string_parsing.ts +1 -1
  918. package/src/utils/sync_or_async.ts +90 -0
  919. package/src/worker_entry_point.ts +7 -0
  920. package/tsconfig.dev.commonjs.json +7 -0
  921. package/tsconfig.dev.json +10 -0
  922. package/tsconfig.jest.json +0 -1
  923. package/tsconfig.json +1 -2
  924. package/dist/_esm5.processed/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  925. package/dist/_esm5.processed/parsers/manifest/utils/is_segment_still_available.js +0 -51
  926. package/dist/commonjs/core/init/utils/create_stream_playback_observer.d.ts +0 -41
  927. package/dist/commonjs/core/init/utils/create_stream_playback_observer.js +0 -91
  928. package/dist/commonjs/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +0 -141
  929. package/dist/commonjs/core/segment_buffers/implementations/text/html/index.d.ts +0 -21
  930. package/dist/commonjs/core/segment_buffers/implementations/text/html/index.js +0 -23
  931. package/dist/commonjs/core/segment_buffers/implementations/text/html/types.d.ts +0 -25
  932. package/dist/commonjs/core/segment_buffers/implementations/text/html/types.js +0 -17
  933. package/dist/commonjs/core/segment_buffers/implementations/text/html/update_proportional_elements.d.ts +0 -30
  934. package/dist/commonjs/core/segment_buffers/implementations/text/native/index.d.ts +0 -17
  935. package/dist/commonjs/core/segment_buffers/implementations/text/native/index.js +0 -19
  936. package/dist/commonjs/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +0 -83
  937. package/dist/commonjs/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +0 -273
  938. package/dist/commonjs/core/segment_buffers/implementations/text/native/parsers.d.ts +0 -26
  939. package/dist/commonjs/core/stream/representation/utils/force_garbage_collection.d.ts +0 -29
  940. package/dist/commonjs/core/stream/representation/utils/force_garbage_collection.js +0 -179
  941. package/dist/commonjs/errors/assertion_error.d.ts +0 -31
  942. package/dist/commonjs/errors/assertion_error.js +0 -56
  943. package/dist/commonjs/utils/assert_unreachable.d.ts +0 -40
  944. package/dist/commonjs/utils/assert_unreachable.js +0 -46
  945. package/dist/es2017/core/init/utils/create_stream_playback_observer.d.ts +0 -41
  946. package/dist/es2017/core/init/utils/create_stream_playback_observer.js +0 -87
  947. package/dist/es2017/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +0 -141
  948. package/dist/es2017/core/segment_buffers/implementations/text/html/index.d.ts +0 -21
  949. package/dist/es2017/core/segment_buffers/implementations/text/html/index.js +0 -21
  950. package/dist/es2017/core/segment_buffers/implementations/text/html/types.d.ts +0 -25
  951. package/dist/es2017/core/segment_buffers/implementations/text/html/types.js +0 -16
  952. package/dist/es2017/core/segment_buffers/implementations/text/html/update_proportional_elements.d.ts +0 -30
  953. package/dist/es2017/core/segment_buffers/implementations/text/native/index.d.ts +0 -17
  954. package/dist/es2017/core/segment_buffers/implementations/text/native/index.js +0 -17
  955. package/dist/es2017/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +0 -83
  956. package/dist/es2017/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +0 -251
  957. package/dist/es2017/core/segment_buffers/implementations/text/native/parsers.d.ts +0 -26
  958. package/dist/es2017/core/stream/representation/utils/force_garbage_collection.d.ts +0 -29
  959. package/dist/es2017/core/stream/representation/utils/force_garbage_collection.js +0 -91
  960. package/dist/es2017/errors/assertion_error.d.ts +0 -31
  961. package/dist/es2017/errors/assertion_error.js +0 -35
  962. package/dist/es2017/utils/assert_unreachable.d.ts +0 -40
  963. package/dist/es2017/utils/assert_unreachable.js +0 -43
  964. package/dist/rx-player.d.ts +0 -3
  965. package/dist/rx-player.min.d.ts +0 -3
  966. package/experimental/features/index.d.ts +0 -16
  967. package/experimental/features/index.js +0 -16
  968. package/experimental/index.d.ts +0 -16
  969. package/experimental/index.js +0 -16
  970. package/experimental/tools/VideoThumbnailLoader.d.ts +0 -18
  971. package/experimental/tools/VideoThumbnailLoader.js +0 -18
  972. package/experimental/tools/createMetaplaylist.d.ts +0 -18
  973. package/experimental/tools/createMetaplaylist.js +0 -18
  974. package/experimental/tools/index.d.ts +0 -16
  975. package/experimental/tools/index.js +0 -16
  976. package/experimental/tools/mediaCapabilitiesProber.d.ts +0 -18
  977. package/experimental/tools/mediaCapabilitiesProber.js +0 -18
  978. package/experimental/tools/parseBIFThumbnails.d.ts +0 -18
  979. package/experimental/tools/parseBIFThumbnails.js +0 -18
  980. package/features/index.d.ts +0 -16
  981. package/features/index.js +0 -16
  982. package/logger/index.d.ts +0 -17
  983. package/logger/index.js +0 -17
  984. package/minimal/index.d.ts +0 -17
  985. package/minimal/index.js +0 -17
  986. package/scripts/build/generate_build.mjs +0 -194
  987. package/scripts/build/templates/experimental/features/index.d.ts +0 -16
  988. package/scripts/build/templates/experimental/features/index.js +0 -16
  989. package/scripts/build/templates/experimental/index.d.ts +0 -16
  990. package/scripts/build/templates/experimental/index.js +0 -16
  991. package/scripts/build/templates/experimental/tools/VideoThumbnailLoader.d.ts +0 -18
  992. package/scripts/build/templates/experimental/tools/VideoThumbnailLoader.js +0 -18
  993. package/scripts/build/templates/experimental/tools/createMetaplaylist.d.ts +0 -18
  994. package/scripts/build/templates/experimental/tools/createMetaplaylist.js +0 -18
  995. package/scripts/build/templates/experimental/tools/index.d.ts +0 -16
  996. package/scripts/build/templates/experimental/tools/index.js +0 -16
  997. package/scripts/build/templates/experimental/tools/mediaCapabilitiesProber.d.ts +0 -18
  998. package/scripts/build/templates/experimental/tools/mediaCapabilitiesProber.js +0 -18
  999. package/scripts/build/templates/experimental/tools/parseBIFThumbnails.d.ts +0 -18
  1000. package/scripts/build/templates/experimental/tools/parseBIFThumbnails.js +0 -18
  1001. package/scripts/build/templates/features/index.d.ts +0 -16
  1002. package/scripts/build/templates/features/index.js +0 -16
  1003. package/scripts/build/templates/logger/index.d.ts +0 -17
  1004. package/scripts/build/templates/logger/index.js +0 -17
  1005. package/scripts/build/templates/minimal/index.d.ts +0 -17
  1006. package/scripts/build/templates/minimal/index.js +0 -17
  1007. package/scripts/build/templates/tools/TextTrackRenderer.d.ts +0 -18
  1008. package/scripts/build/templates/tools/TextTrackRenderer.js +0 -18
  1009. package/scripts/build/templates/tools/index.d.ts +0 -16
  1010. package/scripts/build/templates/tools/index.js +0 -16
  1011. package/scripts/build/templates/tools/string-utils.d.ts +0 -18
  1012. package/scripts/build/templates/tools/string-utils.js +0 -18
  1013. package/scripts/build/templates/types/index.d.ts +0 -16
  1014. package/scripts/build/templates/types/index.js +0 -15
  1015. package/src/core/init/utils/create_stream_playback_observer.ts +0 -131
  1016. package/src/core/segment_buffers/implementations/text/html/index.ts +0 -24
  1017. package/src/core/segment_buffers/implementations/text/html/types.ts +0 -23
  1018. package/src/core/segment_buffers/implementations/text/native/index.ts +0 -19
  1019. package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +0 -335
  1020. package/src/core/stream/representation/utils/force_garbage_collection.ts +0 -113
  1021. package/src/errors/__tests__/assertion_error.test.ts +0 -26
  1022. package/src/errors/assertion_error.ts +0 -40
  1023. package/src/typings/README.md +0 -7
  1024. package/src/utils/__tests__/assert_unreachable.test.ts +0 -40
  1025. package/src/utils/assert_unreachable.ts +0 -45
  1026. package/tools/TextTrackRenderer.d.ts +0 -18
  1027. package/tools/TextTrackRenderer.js +0 -18
  1028. package/tools/index.d.ts +0 -16
  1029. package/tools/index.js +0 -16
  1030. package/tools/string-utils.d.ts +0 -18
  1031. package/tools/string-utils.js +0 -18
  1032. package/types/index.d.ts +0 -16
  1033. package/types/index.js +0 -15
  1034. /package/dist/commonjs/{utils → core/fetchers/segment}/initialization_segment_cache.js +0 -0
  1035. /package/dist/commonjs/{experimental/features → features/list}/dash_wasm.d.ts +0 -0
  1036. /package/dist/commonjs/{experimental/features → features/list}/debug_element.d.ts +0 -0
  1037. /package/dist/commonjs/{experimental/features → features/list}/debug_element.js +0 -0
  1038. /package/dist/commonjs/{experimental/tools → tools}/parseBIFThumbnails/index.d.ts +0 -0
  1039. /package/dist/commonjs/{compat → utils}/global_scope.d.ts +0 -0
  1040. /package/dist/commonjs/{compat → utils}/global_scope.js +0 -0
  1041. /package/dist/commonjs/{compat → utils}/is_node.d.ts +0 -0
  1042. /package/dist/commonjs/{compat → utils}/is_node.js +0 -0
  1043. /package/dist/commonjs/{compat → utils}/is_worker.d.ts +0 -0
  1044. /package/dist/commonjs/{compat → utils}/is_worker.js +0 -0
  1045. /package/dist/es2017/{utils → core/fetchers/segment}/initialization_segment_cache.js +0 -0
  1046. /package/dist/es2017/{experimental/features → features/list}/dash_wasm.d.ts +0 -0
  1047. /package/dist/es2017/{experimental/features → features/list}/debug_element.d.ts +0 -0
  1048. /package/dist/es2017/{experimental/features → features/list}/debug_element.js +0 -0
  1049. /package/dist/es2017/{experimental/tools → tools}/parseBIFThumbnails/index.d.ts +0 -0
  1050. /package/dist/es2017/{compat → utils}/global_scope.d.ts +0 -0
  1051. /package/dist/es2017/{compat → utils}/global_scope.js +0 -0
  1052. /package/dist/es2017/{compat → utils}/is_node.d.ts +0 -0
  1053. /package/dist/es2017/{compat → utils}/is_node.js +0 -0
  1054. /package/dist/es2017/{compat → utils}/is_worker.d.ts +0 -0
  1055. /package/dist/es2017/{compat → utils}/is_worker.js +0 -0
  1056. /package/src/{experimental/features → features/list}/__tests__/dash_wasm.test.ts +0 -0
  1057. /package/src/{experimental/features → features/list}/__tests__/debug_element.test.ts +0 -0
  1058. /package/src/{experimental/features → features/list}/debug_element.ts +0 -0
  1059. /package/src/{compat → utils}/global_scope.ts +0 -0
  1060. /package/src/{compat → utils}/is_node.ts +0 -0
  1061. /package/src/{compat → utils}/is_worker.ts +0 -0
  1062. /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,95 +1,4 @@
1
- ## v4.0.0-dev.2023121900 (2023-12-19)
2
-
3
- ### Changes
4
-
5
- - A `representationFilter`'s advertised `codec` has now been renamed to `codecs` and is an Array when defined [#1332]
6
-
7
- ### Features
8
-
9
- - Add `getLivePosition` RxPlayer method [#1300]
10
- - Add `startAt.fromLivePosition` `loadVideo` option [#1300]
11
- - 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]
12
- - Add the possibility to set a new `keySystems` option on the `reload` API [#1308]
13
-
14
- ### Bug fixes
15
-
16
- - Fix subtitles "blinking" in some specific conditions, especially with some DASH low-latency contents [#1314]
17
- - DASH: Fix Period overlap resolution logic for when the first Period is removed [#1311]
18
- - TTML: Fix handling of the `tts:lineHeight` attribute [#1320]
19
- - Fix import of the `LOCAL_MANIFEST` experimental feature
20
- - Smooth: Rely on a defined `segmentLoader` when playing smooth streaming contents.
21
- - Avoid very rarely skipping segments which initially were too big to be pushed due to memory limitations [#1323]
22
- - Tizen (Samsung TVs): Try again to work around all potential issues that could arise due to tizen seeking back by itself [#1327]
23
-
24
- ### Other improvements
25
-
26
- - Provide both commonJS and ES6-style exports to improve compatibilities with applications
27
- - DASH: rely on SCTE214 `supplementalCodecs` instead of `codecs` if it's supported to better support backward compatible Dolby Vision contents [#1307]
28
- - DASH: Provide better support of the `availabilityTimeOffset` attribute [#1300]
29
- - DEBUG_ELEMENT: Add unsupported and undecipherable bitrates to the debug element [#1321]
30
- - DEBUG_ELEMENT: update buffer graph maximum size so it becomes more readable for lengthy contents [#1316]
31
- - DEBUG_ELEMENT: always synchronize inventory of segments before rendering it [#1317]
32
- - Remove remaining RxPlayer dependency removing possibility of some application-side bundling errors [#1312]
33
- - Add cache when checking for codec support, improving performance on some devices and potentially working around some xbox bugs on long-lived pages [#1324]
34
- - Add exception to text Garbage collection logic to avoid unnecessarily reload text segments frequently [#1325]
35
- - Demo: Fix switching mode toggle [#1328]
36
- - Demo: Add possibility to see the debug element in the demo page
37
- - Demo: Fix reporting of live position in demo page [#1313]
38
-
39
-
40
- ## v4.0.0-beta.3 (2023-10-19)
41
-
42
- ### Changes
43
-
44
- - The `MediaError`'s `trackInfo` property is now an array renamed as `tracksInfo` and similar `MediaError` are grouped in one [#1264]
45
- - The `manifestUpdateUrl` `loadVideo` option has been removed as it was unused [#1276]
46
- - The `/dist` directory in the project has been removed [#1270]
47
-
48
- ### Bug fixes
49
-
50
- - Fix adaptive logic on some legacy Edge browsers [#1302]
51
-
52
- ### Other improvements
53
-
54
- - `newAvailablePeriods` is now sent lazily at the time new Periods are considered to improve performance [#1265]
55
- - Implement better error messages by not repeating the Error Type in it [#1290]
56
- - All import path to the RxPlayer now depend on the same RxPlayer modular build (and not just the minimal, as before) [#1301]
57
-
58
-
59
- ## v4.0.0-beta.2 (2023-06-27)
60
-
61
- ### Changes
62
-
63
- - 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]
64
- - 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]
65
-
66
- ### Features
67
-
68
- - Add `representationListUpdate` event for when the list of available Representation for a current track changes [#1240]
69
- - Add `"no-playable-representation"` as a `reason` for `trackUpdate` events when the track switch is due to encrypted Representations [#1234]
70
-
71
- ### Other improvements
72
-
73
- - DRM: Reload when playback is unexpectedly frozen with encrypted but only decipherable data in the buffer to work-around rare encryption-related issues [#1236]
74
-
75
-
76
- ## v4.0.0-beta.1 (2023-03-08)
77
-
78
- ### Bug fixes
79
-
80
- - (v4.0.0-beta.0-only issue) Fix memory leak
81
- - (v4.0.0-beta.0-only issue) Fix MediaSource duration when the maximum buffered end is inferior to current duration but superior to calculated duration
82
- - (v4.0.0-beta.0-only issue) Fix `stopAtEnd` option by also switching to STOPPED state on ended
83
- - (v4.0.0-beta.0-only issue) Fix some target's support by not relying on `Promise.prototype.finally` anymore [#1224]
84
- - (v4.0.0-beta.0-only issue) For dynamic contents, always set a very high duration [#1220]
85
- - (v4.0.0-beta.0-only issue) DRM: Fix fallbacking for an already-played content by checking key statuses initially linked to a MediaKeySession
86
-
87
- ### Other improvements
88
-
89
- - Based on the v3.30.0 of which it inherits all the features, bug fixes and other improvements
90
-
91
-
92
- ## v4.0.0-beta.0 (2023-01-27)
1
+ ## v4.0.0-rc.1 (2024-01-24)
93
2
 
94
3
  ### Changes
95
4
 
@@ -150,9 +59,19 @@
150
59
  - Remove public types `IDefaultAudioTrackOption` and `IDefaultTextTrackOption`. Those are the types respectively for `defaultAudioTrack` and `defaultTextTrack` `loadVideo` options which have been removed
151
60
  - Remove public types `IAudioTrackPreference`, `ITextTrackPreference` and `IVideoTrackPreference` as the corresponding API do not exist anymore.
152
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]
153
71
 
154
72
  ### Features
155
73
 
74
+ - Add `MULTI_THREAD` experimental feature to enable multithreading capabilities through a WebWorker
156
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
157
76
  - Add `switchingMode` optional property to `setVideoTrack` and `setAudioTrack`, to configure the way in which the RxPlayer switches between the previous and new track
158
77
  - Add optional `periodId` property to `setAudioTrack`, `setVideoTrack` and `setTextTrack`, to allow setting the track of another, future or past, Period.
@@ -164,45 +83,79 @@
164
83
  - Add `lockVideoRepresentations`, `lockAudioRepresentations`, `getLockedVideoRepresentations`, `getLockedAudioRepresentations`, `unlockVideoRepresentations` and `unlockAudioRepresentations` methods to allow a complex selection of Representations that are currently allowed to play.
165
84
  - Add `getVideoRepresentation` and `getAudioRepresentation` method to retrieve information on the currently loaded representations [#1144]
166
85
  - Add `audioRepresentationChange` and `videoRepresentationChange` events to be notified when the currently-loaded Representation for the current Period changes.
167
- - Add `updateContentUrls` API, allowing to update the Manifest's URL during playback [#1182]
168
- - DASH: implement forced-subtitles, adding the `forced` property to the audio tracks API and selecting by default a forced text track linked to the audio track's language if present [#1187]
169
86
  - Add `getContentUrls` allowing to retrieve the one or several known URLs through which the current Manifest or content is reachable.
170
87
  - Add `videoResolutionLimit` constructor option allowing to automatically limit a video Representation's resolution.
171
88
  - Add `newAvailablePeriods` event to signal new Period on which a track and/or Representation choice can be made
172
89
  - Add `brokenRepresentationsLock` event for when a Representations lock could not be respected anymore
173
90
  - Add `trackUpdate` event for when a track has been updated for any type and Period
174
- - 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]
175
- - 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]
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]
176
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"`
177
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]
178
- - Add `ISegmentLoaderContext` public type for the first argument of the `segmentLoader` API
179
- - Add `IRepresentationFilterRepresentation` public type for the first argument of the `representationFilter` API
180
- - Add `IRepresentationContext` public type for the second argument of the `representationFilter` API
181
- - Add `IManifestLoaderInfo` public type for the first argument of the `manifestLoader` API
182
- - Add `IPeriodChangeEvent` public type to define the properties send through a `periodChange` event
183
- - Add `IPeriod` public type to define a Period object returned by methods like `getAvailablePeriods` or `getCurrentPeriod`
184
- - Add `IVideoTrackSwitchingMode` public type to define the type of the `switchingMode` property optionally given to `setAudioTrack`
185
- - Add `IAudioRepresentationsSwitchingMode` public type to define the type of the `switchingMode` property optionally given to `lockAudioRepresentations`
186
- - Add `IVideoRepresentationsSwitchingMode` public type to define the type of the `switchingMode` property optionally given to `lockAudioRepresentations`
187
- - Add `IBrokenRepresentationsLockContext` public type to define the type sent as a payload of the `brokenRepresentationsLock` event
188
- - Add `ITrackUpdateEventPayload` public type to define the type sent as a payload of the `trackUpdate` event
189
- - Add `ILockedVideoRepresentationsSettings` public type to define the object that should be given to the new `lockVideoRepresentation` method
190
- - Add `ILockedAudioRepresentationsSettings` public type to define the object that should be given to the new `lockAudioRepresentation` method
191
- - Add `IAudioTrackSetting` public type to define the object that may be given to the `setAudioTrack` method
192
- - Add `IVideoTrackSetting` public type to define the object that may be given to the `setVideoTrack` method
193
- - Add `ITextTrackSetting` public type to define the object that may be given to the `setTextTrack` method
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
194
115
 
195
116
  ### Bug fixes
196
117
 
197
- - Fix segment requesting error when playing a DASH content without an url and without BaseURL elements [#1192]
198
- - API: Stop sending events if the content is stopped due to a side-effect of one of the event handler [#1197]
199
- - text-tracks/ttml: fix inconsistent line spacing when resizing the `textTrackElement` [#1191]
200
- - DRM: Fix race condition leading to a JS error instead of a `NO_PLAYABLE_REPRESENTATION` [#1201]
201
- - DRM/Compat: Renew MediaKeys at each `loadVideo` on all WebOS (LG TV) platforms to work around issues [#1188]
118
+ - Tizen (Samsung TVs): Try again to work around all potential issues that could arise due to tizen seeking back by itself [#1327, #1355]
202
119
 
203
120
  ### Other improvements
204
121
 
205
- - Remove dependency to RxJS, improving the debugging experience and preventing some uncaught Error from being thrown
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)
130
+
131
+ ### Features
132
+
133
+ - Add `getLivePosition` RxPlayer method [#1300]
134
+ - Add `startAt.fromLivePosition` `loadVideo` option [#1300]
135
+ - Add the possibility to set a new `keySystems` option on the `reload` API [#1308]
136
+
137
+ ### Bug fixes
138
+
139
+ - Fix subtitles "blinking" in some specific conditions, especially with some DASH low-latency contents [#1314]
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]
142
+ - Fix import of the `LOCAL_MANIFEST` experimental feature
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]
147
+
148
+ ### Other improvements
149
+
150
+ - DASH: rely on SCTE214 `supplementalCodecs` instead of `codecs` if it's supported to better support backward compatible Dolby Vision contents [#1307]
151
+ - DASH: Provide better support of the `availabilityTimeOffset` attribute [#1300]
152
+ - DEBUG_ELEMENT: Add unsupported and undecipherable bitrates to the debug element [#1321]
153
+ - DEBUG_ELEMENT: update buffer graph maximum size so it becomes more readable for lengthy contents [#1316]
154
+ - DEBUG_ELEMENT: always synchronize inventory of segments before rendering it [#1317]
155
+ - Remove remaining RxPlayer dependency removing possibility of some application-side bundling errors [#1312]
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]
206
159
 
207
160
 
208
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/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.0-dev.2023121900
1
+ 4.0.0-rc.1
@@ -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, };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * We noticed that on Xbox game consoles and Universal windows platforms
3
+ * (presumably an Edge version is in cause here), the browser didn't send
4
+ * a "seeking" event if we were seeking at a 0 position initially.
5
+ *
6
+ * We could theoretically never seek at 0 initially as the initial position of
7
+ * an HTMLMediaElement should be at 0 anyway, but we still do it as a safe
8
+ * solution, as many devices have a buggy integration of HTML5 media API.
9
+ *
10
+ * This function returns `true` when we should avoid doing so, for now only for
11
+ * the non-standard behavior of those Edge platforms.
12
+ * @returns {number}
13
+ */
14
+ export default function shouldPreventSeekingAt0Initially(): boolean;
@@ -0,0 +1,17 @@
1
+ import { isIEOrEdge, isXbox } from "./browser_detection";
2
+ /**
3
+ * We noticed that on Xbox game consoles and Universal windows platforms
4
+ * (presumably an Edge version is in cause here), the browser didn't send
5
+ * a "seeking" event if we were seeking at a 0 position initially.
6
+ *
7
+ * We could theoretically never seek at 0 initially as the initial position of
8
+ * an HTMLMediaElement should be at 0 anyway, but we still do it as a safe
9
+ * solution, as many devices have a buggy integration of HTML5 media API.
10
+ *
11
+ * This function returns `true` when we should avoid doing so, for now only for
12
+ * the non-standard behavior of those Edge platforms.
13
+ * @returns {number}
14
+ */
15
+ export default function shouldPreventSeekingAt0Initially() {
16
+ return isXbox || isIEOrEdge;
17
+ }
@@ -39,6 +39,7 @@ declare class ConfigHandler {
39
39
  DEFAULT_MAX_BUFFER_BEHIND: number;
40
40
  DEFAULT_MAX_VIDEO_BUFFER_SIZE: number;
41
41
  MAXIMUM_MAX_BUFFER_AHEAD: Partial<Record<"audio" | "video" | "image" | "text", number>>;
42
+ MINIMUM_MAX_BUFFER_AHEAD: Partial<Record<"audio" | "video" | "image" | "text", number>>;
42
43
  MAXIMUM_MAX_BUFFER_BEHIND: Partial<Record<"audio" | "video" | "image" | "text", number>>;
43
44
  DEFAULT_INITIAL_BITRATES: {
44
45
  audio: number;
@@ -24,6 +24,8 @@ export type IParsedStartAtOption = {
24
24
  percentage: number;
25
25
  } | {
26
26
  fromLastPosition: number;
27
+ } | {
28
+ fromLivePosition: number;
27
29
  } | {
28
30
  fromFirstPosition: number;
29
31
  };
@@ -125,6 +127,8 @@ declare function checkReloadOptions(options?: {
125
127
  position?: number;
126
128
  relative?: number;
127
129
  };
130
+ keySystems?: IKeySystemOption[];
131
+ autoPlay?: boolean;
128
132
  }): void;
129
133
  /**
130
134
  * Parse options given to loadVideo and set default options as found
@@ -255,6 +255,12 @@ function checkReloadOptions(options) {
255
255
  ((_d = options === null || options === void 0 ? void 0 : options.reloadAt) === null || _d === void 0 ? void 0 : _d.relative) !== undefined) {
256
256
  throw new Error("API: reload - Invalid 'reloadAt.relative' option format.");
257
257
  }
258
+ if (!Array.isArray(options === null || options === void 0 ? void 0 : options.keySystems) && (options === null || options === void 0 ? void 0 : options.keySystems) !== undefined) {
259
+ throw new Error("API: reload - Invalid 'keySystems' option format.");
260
+ }
261
+ if ((options === null || options === void 0 ? void 0 : options.autoPlay) !== undefined && typeof options.autoPlay !== "boolean") {
262
+ throw new Error("API: reload - Invalid 'autoPlay' option format.");
263
+ }
258
264
  }
259
265
  /**
260
266
  * Parse options given to loadVideo and set default options as found
@@ -456,9 +462,8 @@ function parseLoadVideoOptions(options) {
456
462
  "an \"html\" textTrackMode. It will be ignored.");
457
463
  }
458
464
  if (!isNullOrUndefined(options.startAt)) {
459
- // TODO Better way to express that in TypeScript?
460
- if (options.startAt.wallClockTime
461
- instanceof Date) {
465
+ if ("wallClockTime" in options.startAt
466
+ && options.startAt.wallClockTime instanceof Date) {
462
467
  var wallClockTime = options.startAt
463
468
  .wallClockTime.getTime() / 1000;
464
469
  startAt = objectAssign({}, options.startAt, { wallClockTime: wallClockTime });
@@ -16,7 +16,7 @@
16
16
  import { IErrorCode, IErrorType } from "../../errors";
17
17
  import { IFeature } from "../../features";
18
18
  import Manifest from "../../manifest";
19
- import { IAdaptation, IAudioTrack, IAudioTrackPreference, IAvailableAudioTrack, IAvailableTextTrack, IAvailableVideoTrack, IBifThumbnail, IBitrateEstimate, IConstructorOptions, IDecipherabilityUpdateContent, IKeySystemConfigurationOutput, ILoadVideoOptions, IPeriod, IPlayerError, IPlayerState, IPositionUpdate, IRepresentation, IStreamEvent, ITextTrack, ITextTrackPreference, IVideoTrack, IVideoTrackPreference } from "../../public_types";
19
+ import { IAdaptation, IAudioTrack, IAudioTrackPreference, IAvailableAudioTrack, IAvailableTextTrack, IAvailableVideoTrack, IBifThumbnail, IBitrateEstimate, IConstructorOptions, IDecipherabilityUpdateContent, IKeySystemConfigurationOutput, IKeySystemOption, ILoadVideoOptions, IPeriod, IPlayerError, IPlayerState, IPositionUpdate, IRepresentation, IStreamEvent, ITextTrack, ITextTrackPreference, IVideoTrack, IVideoTrackPreference } from "../../public_types";
20
20
  import EventEmitter, { IListener } from "../../utils/event_emitter";
21
21
  import Logger from "../../utils/logger";
22
22
  import { IBufferedChunk, IBufferType } from "../segment_buffers";
@@ -169,6 +169,7 @@ declare class Player extends EventEmitter<IPublicAPIEvent> {
169
169
  position?: number;
170
170
  relative?: number;
171
171
  };
172
+ keySystems?: IKeySystemOption[];
172
173
  autoPlay?: boolean;
173
174
  }): void;
174
175
  createDebugElement(element: HTMLElement): {
@@ -716,6 +717,15 @@ declare class Player extends EventEmitter<IPublicAPIEvent> {
716
717
  * @returns {number}
717
718
  */
718
719
  getMinimumPosition(): number | null;
720
+ /**
721
+ * Returns the current position for live contents.
722
+ *
723
+ * Returns `null` if no content is loaded or if the current loaded content is
724
+ * not considered as a live content.
725
+ * Returns `undefined` if that live position is currently unknown.
726
+ * @returns {number}
727
+ */
728
+ getLivePosition(): number | undefined | null;
719
729
  /**
720
730
  * Get maximum seek-able position.
721
731
  * @returns {number}