rx-player 4.0.0-dev.2023120600 → 4.0.0-dev.2023121900

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 (326) hide show
  1. package/CHANGELOG.md +178 -2
  2. package/README.md +2 -33
  3. package/VERSION +1 -1
  4. package/dist/_esm5.processed/compat/add_text_track.d.ts +3 -1
  5. package/dist/_esm5.processed/compat/add_text_track.js +7 -4
  6. package/dist/_esm5.processed/compat/browser_compatibility_types.d.ts +7 -0
  7. package/dist/_esm5.processed/compat/event_listeners.d.ts +15 -2
  8. package/dist/_esm5.processed/compat/event_listeners.js +37 -2
  9. package/dist/_esm5.processed/compat/fullscreen.d.ts +32 -0
  10. package/dist/_esm5.processed/compat/fullscreen.js +78 -0
  11. package/dist/_esm5.processed/compat/index.d.ts +3 -1
  12. package/dist/_esm5.processed/compat/index.js +3 -1
  13. package/dist/_esm5.processed/compat/is_offline.d.ts +39 -0
  14. package/dist/_esm5.processed/compat/is_offline.js +43 -0
  15. package/dist/_esm5.processed/config.d.ts +21 -9
  16. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +58 -0
  17. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +54 -14
  18. package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.d.ts +8 -2
  19. package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.js +11 -2
  20. package/dist/_esm5.processed/core/api/debug/modules/general_info.js +46 -17
  21. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +3 -3
  22. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.js +1 -1
  23. package/dist/_esm5.processed/core/api/option_utils.d.ts +35 -14
  24. package/dist/_esm5.processed/core/api/option_utils.js +230 -47
  25. package/dist/_esm5.processed/core/api/public_api.d.ts +266 -92
  26. package/dist/_esm5.processed/core/api/public_api.js +802 -444
  27. package/dist/_esm5.processed/core/api/{track_management/media_element_tracks_store.d.ts → tracks_management/media_element_track_choice_manager.d.ts} +75 -15
  28. package/dist/_esm5.processed/core/api/{track_management/media_element_tracks_store.js → tracks_management/media_element_track_choice_manager.js} +193 -74
  29. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.d.ts +258 -0
  30. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +989 -0
  31. package/dist/_esm5.processed/core/api/utils.d.ts +0 -1
  32. package/dist/_esm5.processed/core/api/utils.js +11 -28
  33. package/dist/_esm5.processed/core/decrypt/content_decryptor.js +3 -3
  34. package/dist/_esm5.processed/core/decrypt/find_key_system.js +71 -83
  35. package/dist/_esm5.processed/core/decrypt/get_media_keys.js +5 -6
  36. package/dist/_esm5.processed/core/decrypt/session_events_listener.js +72 -10
  37. package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.d.ts +4 -4
  38. package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.js +4 -6
  39. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +3 -1
  40. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +26 -7
  41. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +9 -3
  42. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +9 -16
  43. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.d.ts +3 -1
  44. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +1 -1
  45. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.d.ts +6 -1
  46. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +41 -4
  47. package/dist/_esm5.processed/core/init/media_source_content_initializer.d.ts +8 -1
  48. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +5 -2
  49. package/dist/_esm5.processed/core/init/types.d.ts +15 -5
  50. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  51. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.d.ts +75 -0
  52. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +133 -0
  53. package/dist/_esm5.processed/core/{api/track_management → segment_buffers/implementations/image}/index.d.ts +2 -3
  54. package/dist/_esm5.processed/core/{api/track_management → segment_buffers/implementations/image}/index.js +2 -3
  55. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  56. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +2 -1
  57. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +4 -3
  58. package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +2 -2
  59. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
  60. package/dist/_esm5.processed/core/segment_buffers/index.js +1 -2
  61. package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +2 -3
  62. package/dist/_esm5.processed/core/segment_buffers/inventory/index.js +0 -1
  63. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
  64. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +19 -10
  65. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.d.ts +1 -0
  66. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +16 -2
  67. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +15 -0
  68. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +93 -183
  69. package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +13 -27
  70. package/dist/_esm5.processed/core/stream/index.d.ts +3 -2
  71. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +0 -2
  72. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +7 -5
  73. package/dist/_esm5.processed/core/stream/period/period_stream.js +12 -13
  74. package/dist/_esm5.processed/core/stream/period/types.d.ts +14 -5
  75. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -2
  76. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.js +46 -10
  77. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +23 -29
  78. package/dist/_esm5.processed/core/stream/representation/types.d.ts +1 -11
  79. package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.js +1 -1
  80. package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.js +1 -1
  81. package/dist/_esm5.processed/default_config.d.ts +98 -35
  82. package/dist/_esm5.processed/default_config.js +113 -36
  83. package/dist/_esm5.processed/errors/custom_loader_error.d.ts +3 -1
  84. package/dist/_esm5.processed/errors/custom_loader_error.js +3 -1
  85. package/dist/_esm5.processed/errors/media_error.js +2 -2
  86. package/dist/_esm5.processed/errors/network_error.d.ts +1 -0
  87. package/dist/_esm5.processed/errors/network_error.js +1 -0
  88. package/dist/_esm5.processed/errors/request_error.d.ts +3 -2
  89. package/dist/_esm5.processed/errors/request_error.js +5 -2
  90. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -3
  91. package/dist/_esm5.processed/features/features_object.js +2 -0
  92. package/dist/_esm5.processed/{transports/smooth/is_mp4_embedded_track.js → features/list/bif_parser.d.ts} +6 -7
  93. package/dist/_esm5.processed/features/list/bif_parser.js +27 -0
  94. package/dist/_esm5.processed/features/list/directfile.js +5 -2
  95. package/dist/_esm5.processed/features/list/image_buffer.d.ts +23 -0
  96. package/dist/_esm5.processed/features/list/image_buffer.js +25 -0
  97. package/dist/_esm5.processed/features/list/index.d.ts +2 -0
  98. package/dist/_esm5.processed/features/list/index.js +2 -0
  99. package/dist/_esm5.processed/features/types.d.ts +27 -3
  100. package/dist/_esm5.processed/manifest/adaptation.d.ts +11 -9
  101. package/dist/_esm5.processed/manifest/adaptation.js +30 -41
  102. package/dist/_esm5.processed/manifest/index.d.ts +4 -3
  103. package/dist/_esm5.processed/manifest/manifest.d.ts +54 -5
  104. package/dist/_esm5.processed/manifest/manifest.js +110 -5
  105. package/dist/_esm5.processed/manifest/period.d.ts +5 -4
  106. package/dist/_esm5.processed/manifest/representation.d.ts +5 -10
  107. package/dist/_esm5.processed/manifest/representation.js +5 -15
  108. package/dist/_esm5.processed/manifest/representation_index/index.d.ts +2 -2
  109. package/dist/_esm5.processed/manifest/representation_index/static.d.ts +0 -2
  110. package/dist/_esm5.processed/manifest/representation_index/static.js +0 -6
  111. package/dist/_esm5.processed/manifest/representation_index/types.d.ts +21 -42
  112. package/dist/_esm5.processed/manifest/types.d.ts +2 -0
  113. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +31 -17
  114. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +19 -26
  115. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +0 -2
  116. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +1 -7
  117. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +6 -2
  118. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +8 -11
  119. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +0 -2
  120. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +0 -6
  121. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +2 -2
  122. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.js +6 -1
  123. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +5 -3
  124. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +2 -0
  125. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +1 -1
  126. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +2 -2
  127. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +2 -0
  128. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +2 -2
  129. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +6 -10
  130. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +2 -4
  131. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.d.ts +1 -10
  132. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.js +2 -18
  133. package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +4 -4
  134. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +6 -3
  135. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +2 -1
  136. package/dist/_esm5.processed/parsers/manifest/local/representation_index.d.ts +0 -2
  137. package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +0 -6
  138. package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +6 -6
  139. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.d.ts +3 -12
  140. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.js +2 -11
  141. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +1 -0
  142. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +17 -11
  143. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +83 -21
  144. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +125 -53
  145. package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.d.ts +6 -3
  146. package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.js +4 -4
  147. package/dist/_esm5.processed/parsers/manifest/types.d.ts +3 -3
  148. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  149. package/dist/_esm5.processed/public_types.d.ts +310 -396
  150. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.d.ts +4 -5
  151. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +4 -5
  152. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +4 -4
  153. package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +38 -0
  154. package/dist/_esm5.processed/transports/dash/image_pipelines.js +129 -0
  155. package/dist/_esm5.processed/transports/dash/manifest_parser.js +3 -2
  156. package/dist/_esm5.processed/transports/dash/pipelines.js +4 -1
  157. package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +2 -2
  158. package/dist/_esm5.processed/transports/dash/segment_loader.js +20 -26
  159. package/dist/_esm5.processed/transports/dash/segment_parser.js +24 -19
  160. package/dist/_esm5.processed/transports/dash/text_loader.js +5 -5
  161. package/dist/_esm5.processed/transports/dash/text_parser.js +33 -28
  162. package/dist/_esm5.processed/transports/local/pipelines.js +10 -1
  163. package/dist/_esm5.processed/transports/local/segment_loader.js +2 -2
  164. package/dist/_esm5.processed/transports/local/segment_parser.d.ts +1 -1
  165. package/dist/_esm5.processed/transports/local/segment_parser.js +10 -10
  166. package/dist/_esm5.processed/transports/local/text_parser.d.ts +2 -2
  167. package/dist/_esm5.processed/transports/local/text_parser.js +23 -23
  168. package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +52 -34
  169. package/dist/_esm5.processed/transports/smooth/pipelines.js +190 -33
  170. package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +1 -1
  171. package/dist/_esm5.processed/transports/smooth/segment_loader.js +22 -28
  172. package/dist/_esm5.processed/transports/smooth/utils.d.ts +26 -1
  173. package/dist/_esm5.processed/transports/smooth/utils.js +55 -1
  174. package/dist/_esm5.processed/transports/types.d.ts +89 -94
  175. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +3 -3
  176. package/dist/_esm5.processed/transports/utils/infer_segment_container.d.ts +3 -3
  177. package/dist/_esm5.processed/transports/utils/infer_segment_container.js +7 -5
  178. package/dist/_esm5.processed/transports/utils/parse_text_track.d.ts +12 -8
  179. package/dist/_esm5.processed/transports/utils/parse_text_track.js +21 -19
  180. package/dist/_esm5.processed/utils/array_includes.d.ts +1 -2
  181. package/dist/_esm5.processed/utils/array_includes.js +28 -30
  182. package/dist/_esm5.processed/{transports/smooth/is_mp4_embedded_track.d.ts → utils/list_to_map.d.ts} +5 -5
  183. package/dist/_esm5.processed/utils/list_to_map.js +28 -0
  184. package/dist/_esm5.processed/utils/request/xhr.js +5 -5
  185. package/dist/_esm5.processed/utils/simple_set.d.ts +51 -0
  186. package/dist/_esm5.processed/utils/simple_set.js +57 -0
  187. package/dist/_esm5.processed/utils/uniq.d.ts +36 -0
  188. package/dist/_esm5.processed/utils/uniq.js +43 -0
  189. package/dist/commonjs/config.d.ts +1 -1
  190. package/dist/commonjs/core/adaptive/adaptive_representation_selector.d.ts +2 -19
  191. package/dist/commonjs/core/adaptive/adaptive_representation_selector.js +2 -2
  192. package/dist/commonjs/core/adaptive/network_analyzer.js +3 -3
  193. package/dist/commonjs/core/api/index.d.ts +1 -1
  194. package/dist/commonjs/core/api/playback_observer.d.ts +128 -8
  195. package/dist/commonjs/core/api/playback_observer.js +217 -64
  196. package/dist/commonjs/core/api/public_api.js +9 -9
  197. package/dist/commonjs/core/api/utils.js +1 -1
  198. package/dist/commonjs/core/decrypt/get_media_keys.js +2 -6
  199. package/dist/commonjs/core/init/directfile_content_initializer.js +5 -1
  200. package/dist/commonjs/core/init/media_source_content_initializer.js +28 -14
  201. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.js +1 -2
  202. package/dist/commonjs/core/init/utils/create_stream_playback_observer.d.ts +1 -5
  203. package/dist/commonjs/core/init/utils/create_stream_playback_observer.js +16 -14
  204. package/dist/commonjs/core/init/utils/initial_seek_and_play.d.ts +9 -11
  205. package/dist/commonjs/core/init/utils/initial_seek_and_play.js +121 -91
  206. package/dist/commonjs/core/init/utils/rebuffering_controller.js +27 -70
  207. package/dist/commonjs/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -2
  208. package/dist/commonjs/core/segment_buffers/garbage_collector.js +1 -2
  209. package/dist/commonjs/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  210. package/dist/commonjs/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  211. package/dist/commonjs/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
  212. package/dist/commonjs/core/segment_buffers/index.d.ts +2 -2
  213. package/dist/commonjs/core/segment_buffers/inventory/index.d.ts +2 -2
  214. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
  215. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.js +19 -10
  216. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.d.ts +2 -2
  217. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.js +16 -9
  218. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +14 -18
  219. package/dist/commonjs/core/stream/period/period_stream.js +5 -8
  220. package/dist/commonjs/core/stream/period/types.d.ts +2 -3
  221. package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
  222. package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.js +17 -13
  223. package/dist/commonjs/core/stream/representation/representation_stream.js +3 -4
  224. package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
  225. package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.js +11 -12
  226. package/dist/commonjs/core/stream/representation/utils/get_buffer_status.js +1 -1
  227. package/dist/commonjs/default_config.d.ts +7 -16
  228. package/dist/commonjs/default_config.js +16 -16
  229. package/dist/commonjs/manifest/adaptation.js +2 -1
  230. package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  231. package/dist/commonjs/public_types.d.ts +29 -2
  232. package/dist/es2017/config.d.ts +1 -1
  233. package/dist/es2017/core/adaptive/adaptive_representation_selector.d.ts +2 -19
  234. package/dist/es2017/core/adaptive/adaptive_representation_selector.js +2 -2
  235. package/dist/es2017/core/adaptive/network_analyzer.js +3 -3
  236. package/dist/es2017/core/api/index.d.ts +1 -1
  237. package/dist/es2017/core/api/playback_observer.d.ts +128 -8
  238. package/dist/es2017/core/api/playback_observer.js +217 -66
  239. package/dist/es2017/core/api/public_api.js +9 -9
  240. package/dist/es2017/core/api/utils.js +1 -1
  241. package/dist/es2017/core/decrypt/get_media_keys.js +2 -6
  242. package/dist/es2017/core/init/directfile_content_initializer.js +7 -1
  243. package/dist/es2017/core/init/media_source_content_initializer.js +30 -16
  244. package/dist/es2017/core/init/utils/content_time_boundaries_observer.js +1 -2
  245. package/dist/es2017/core/init/utils/create_stream_playback_observer.d.ts +1 -5
  246. package/dist/es2017/core/init/utils/create_stream_playback_observer.js +16 -14
  247. package/dist/es2017/core/init/utils/initial_seek_and_play.d.ts +9 -11
  248. package/dist/es2017/core/init/utils/initial_seek_and_play.js +120 -91
  249. package/dist/es2017/core/init/utils/rebuffering_controller.js +27 -70
  250. package/dist/es2017/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -2
  251. package/dist/es2017/core/segment_buffers/garbage_collector.js +1 -2
  252. package/dist/es2017/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  253. package/dist/es2017/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  254. package/dist/es2017/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
  255. package/dist/es2017/core/segment_buffers/index.d.ts +2 -2
  256. package/dist/es2017/core/segment_buffers/inventory/index.d.ts +2 -2
  257. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
  258. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.js +19 -10
  259. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.d.ts +2 -2
  260. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.js +16 -9
  261. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +16 -18
  262. package/dist/es2017/core/stream/period/period_stream.js +4 -7
  263. package/dist/es2017/core/stream/period/types.d.ts +2 -3
  264. package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
  265. package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.js +17 -13
  266. package/dist/es2017/core/stream/representation/representation_stream.js +3 -4
  267. package/dist/es2017/core/stream/representation/types.d.ts +2 -2
  268. package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.js +1 -2
  269. package/dist/es2017/core/stream/representation/utils/get_buffer_status.js +1 -1
  270. package/dist/es2017/default_config.d.ts +7 -16
  271. package/dist/es2017/default_config.js +16 -16
  272. package/dist/es2017/manifest/adaptation.js +2 -1
  273. package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  274. package/dist/es2017/public_types.d.ts +29 -2
  275. package/dist/mpd-parser.wasm +0 -0
  276. package/dist/rx-player.js +614 -438
  277. package/dist/rx-player.min.js +1 -1
  278. package/package.json +5 -1
  279. package/scripts/canal-release.patch +78 -0
  280. package/scripts/make-dev-releases +65 -0
  281. package/scripts/update-version +5 -0
  282. package/sonar-project.properties +1 -1
  283. package/src/core/adaptive/adaptive_representation_selector.ts +4 -21
  284. package/src/core/adaptive/network_analyzer.ts +3 -3
  285. package/src/core/api/index.ts +1 -0
  286. package/src/core/api/playback_observer.ts +327 -107
  287. package/src/core/api/public_api.ts +9 -9
  288. package/src/core/api/utils.ts +3 -1
  289. package/src/core/decrypt/get_media_keys.ts +2 -8
  290. package/src/core/init/directfile_content_initializer.ts +8 -8
  291. package/src/core/init/media_source_content_initializer.ts +27 -20
  292. package/src/core/init/utils/content_time_boundaries_observer.ts +1 -1
  293. package/src/core/init/utils/create_stream_playback_observer.ts +19 -20
  294. package/src/core/init/utils/initial_seek_and_play.ts +140 -108
  295. package/src/core/init/utils/rebuffering_controller.ts +32 -77
  296. package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +5 -2
  297. package/src/core/segment_buffers/garbage_collector.ts +1 -1
  298. package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +10 -2
  299. package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +1 -1
  300. package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +1 -1
  301. package/src/core/segment_buffers/index.ts +2 -0
  302. package/src/core/segment_buffers/inventory/index.ts +2 -0
  303. package/src/core/segment_buffers/inventory/segment_inventory.ts +49 -17
  304. package/src/core/stream/adaptation/get_representations_switch_strategy.ts +21 -12
  305. package/src/core/stream/orchestrator/stream_orchestrator.ts +14 -19
  306. package/src/core/stream/period/period_stream.ts +7 -8
  307. package/src/core/stream/period/types.ts +2 -3
  308. package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +21 -15
  309. package/src/core/stream/representation/representation_stream.ts +3 -5
  310. package/src/core/stream/representation/types.ts +2 -2
  311. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +1 -1
  312. package/src/core/stream/representation/utils/get_buffer_status.ts +2 -1
  313. package/src/default_config.ts +17 -17
  314. package/src/manifest/adaptation.ts +2 -1
  315. package/src/parsers/texttracks/ttml/html/apply_line_height.ts +3 -1
  316. package/src/public_types.ts +29 -2
  317. package/dist/_esm5.processed/core/api/track_management/track_dispatcher.d.ts +0 -84
  318. package/dist/_esm5.processed/core/api/track_management/track_dispatcher.js +0 -158
  319. package/dist/_esm5.processed/core/api/track_management/tracks_store.d.ts +0 -406
  320. package/dist/_esm5.processed/core/api/track_management/tracks_store.js +0 -932
  321. package/dist/_esm5.processed/core/segment_buffers/inventory/utils.d.ts +0 -33
  322. package/dist/_esm5.processed/core/segment_buffers/inventory/utils.js +0 -49
  323. package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.d.ts +0 -39
  324. package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.js +0 -133
  325. package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.d.ts +0 -119
  326. package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.js +0 -159
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rx-player",
3
3
  "author": "Canal+",
4
- "version": "4.0.0-dev.2023120600",
4
+ "version": "4.0.0-dev.2023121900",
5
5
  "description": "Canal+ HTML5 Video Player",
6
6
  "main": "./dist/commonjs/index.js",
7
7
  "module": "./dist/es2017/index.js",
@@ -144,6 +144,7 @@
144
144
  "lint:tests": "eslint tests/**/*.js --ignore-pattern '/tests/performance/bundle*'",
145
145
  "list": "node scripts/list-npm-scripts.mjs",
146
146
  "prepublishOnly": "npm run build:all",
147
+ "releases:dev": "./scripts/make-dev-releases",
147
148
  "standalone": "node ./scripts/run_standalone_demo.mjs",
148
149
  "start": "node ./scripts/start_demo_web_server.mjs",
149
150
  "sart:wasm": "node ./scripts/start_demo_web_server.mjs --include-wasm",
@@ -282,6 +283,9 @@
282
283
  "doc": "Generate the HTML documentation in doc/generated/pages"
283
284
  },
284
285
  "Update the RxPlayer's version": {
286
+ },
287
+ "Make a release": {
288
+ "releases:dev": "Produce dev npm releases (which are tagged pre-releases on npm) with the code in the current branch",
285
289
  "update-version": "Update the version to the string given in argument (example: `npm run update-version 3.8.0`). Will update the codebase and perform every builds."
286
290
  }
287
291
  }
@@ -0,0 +1,78 @@
1
+ diff --git a/src/parsers/texttracks/ttml/html/apply_extent.ts b/src/parsers/texttracks/ttml/html/apply_extent.ts
2
+ index 5772fa8fb..eb3a051e4 100644
3
+ --- a/src/parsers/texttracks/ttml/html/apply_extent.ts
4
+ +++ b/src/parsers/texttracks/ttml/html/apply_extent.ts
5
+ @@ -54,7 +54,14 @@ export default function applyExtent(
6
+ secondExtent[2] === "%" ||
7
+ secondExtent[2] === "em")
8
+ {
9
+ - element.style.height = secondExtent[1] + secondExtent[2];
10
+ + const toNum = Number(secondExtent[1]);
11
+ + if (secondExtent[2] === "%" && !isNaN(toNum) &&
12
+ + (toNum < 0 || toNum > 100))
13
+ + {
14
+ + element.style.width = "80%";
15
+ + } else {
16
+ + element.style.height = secondExtent[1] + secondExtent[2];
17
+ + }
18
+ } else if (secondExtent[2] === "c") {
19
+ addClassName(element, "proportional-style");
20
+ element.setAttribute("data-proportional-height", secondExtent[1]);
21
+ diff --git a/src/parsers/texttracks/ttml/html/apply_line_height.ts b/src/parsers/texttracks/ttml/html/apply_line_height.ts
22
+ index 4f727229a..253aa1a72 100644
23
+ --- a/src/parsers/texttracks/ttml/html/apply_line_height.ts
24
+ +++ b/src/parsers/texttracks/ttml/html/apply_line_height.ts
25
+ @@ -14,16 +14,15 @@
26
+ * limitations under the License.
27
+ */
28
+
29
+ -import { addClassName } from "../../../../compat";
30
+ import log from "../../../../log";
31
+ import { REGXP_LENGTH } from "../regexps";
32
+
33
+ /**
34
+ - * @param {HTMLElement} element
35
+ + * @param {HTMLElement} _element
36
+ * @param {string} lineHeight
37
+ */
38
+ export default function applyLineHeight(
39
+ - element : HTMLElement,
40
+ + _element : HTMLElement,
41
+ lineHeight : string
42
+ ) : void {
43
+ const trimmedLineHeight = lineHeight.trim();
44
+ @@ -40,10 +39,10 @@ export default function applyLineHeight(
45
+ firstLineHeight[2] === "%" ||
46
+ firstLineHeight[2] === "em")
47
+ {
48
+ - element.style.lineHeight = firstLineHeight[1] + firstLineHeight[2];
49
+ + // element.style.lineHeight = firstLineHeight[1] + firstLineHeight[2];
50
+ } else if (firstLineHeight[2] === "c") {
51
+ - addClassName(element, "proportional-style");
52
+ - element.setAttribute("data-proportional-line-height", firstLineHeight[1]);
53
+ + // addClassName(element, "proportional-style");
54
+ + // element.setAttribute("data-proportional-line-height", firstLineHeight[1]);
55
+ } else {
56
+ log.warn("TTML Parser: unhandled lineHeight unit:", firstLineHeight[2]);
57
+ }
58
+ diff --git a/src/parsers/texttracks/ttml/html/apply_origin.ts b/src/parsers/texttracks/ttml/html/apply_origin.ts
59
+ index 01a205aad..91d69fa3c 100644
60
+ --- a/src/parsers/texttracks/ttml/html/apply_origin.ts
61
+ +++ b/src/parsers/texttracks/ttml/html/apply_origin.ts
62
+ @@ -53,7 +53,15 @@ export default function applyOrigin(
63
+ secondOrigin[2] === "%" ||
64
+ secondOrigin[2] === "em")
65
+ {
66
+ - element.style.top = secondOrigin[1] + secondOrigin[2];
67
+ + const toNum = Number(secondOrigin[1]);
68
+ + if (secondOrigin[2] === "%" && !isNaN(toNum) &&
69
+ + (toNum < 0 || toNum > 100))
70
+ + {
71
+ + element.style.bottom = "5%";
72
+ + element.style.left = "10%";
73
+ + } else {
74
+ + element.style.top = secondOrigin[1] + secondOrigin[2];
75
+ + }
76
+ } else if (secondOrigin[2] === "c") {
77
+ addClassName(element, "proportional-style");
78
+ element.setAttribute("data-proportional-top", secondOrigin[1]);
@@ -0,0 +1,65 @@
1
+ #!/bin/bash
2
+
3
+ # make-dev-releases
4
+ # =================
5
+ #
6
+ # This script produces pre-releases on top of the current branch for the
7
+ # `dev-v4` and `canal-v4` versions (as per their npm tags).
8
+ #
9
+ # To use it:
10
+ #
11
+ # 1. Be sure that you're on the branch corresponding to the pre-release you
12
+ # want to publish, at the repository's root directory.
13
+ #
14
+ # 2. Call this script followed with the corresponding version number it would
15
+ # have as an official release in the `MAJOR.MINOR.PATCH` format (e.g.
16
+ # `./update-version 4.1.3`). Special suffix corresponding to the date and
17
+ # tag will be added automatically by this script.
18
+ #
19
+ # 3. When the script ask you to confirm, check that the preceding commands did
20
+ # not output any issue and if it didn't you can confirm.
21
+ #
22
+ # 4. That's it!
23
+
24
+ set -e
25
+
26
+ current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
27
+ version=$1
28
+ date=$(date "+%Y%m%d")
29
+ dev_branch="release/v${version}-dev.${date}00"
30
+ canal_branch="release/v${version}-canal.${date}00"
31
+
32
+ git checkout -b ${dev_branch}
33
+ ./scripts/update-version $1-dev.${date}00
34
+ git add --all
35
+ git commit -m "update version"
36
+ while true; do
37
+ read -n1 -p "Do you wish to push and publish the dev build? [y/n] " yn
38
+ echo ""
39
+ case $yn in
40
+ [Yy]* ) break;;
41
+ [Nn]* ) exit;;
42
+ * ) echo "Please answer y or n.";;
43
+ esac
44
+ done
45
+ git push origin ${dev_branch}
46
+ npm publish --tag dev-v4
47
+
48
+ git checkout $current_branch
49
+
50
+ git checkout -b ${canal_branch}
51
+ git apply ./scripts/canal-release.patch
52
+ ./scripts/update-version $1-canal.${date}00
53
+ git add --all
54
+ git commit -m "update version"
55
+ git push origin ${canal_branch}
56
+ while true; do
57
+ read -n1 -p "Do you wish to push and publish the canal build? [y/n] " yn
58
+ echo ""
59
+ case $yn in
60
+ [Yy]* ) break;;
61
+ [Nn]* ) exit;;
62
+ * ) echo "Please answer y or n.";;
63
+ esac
64
+ done
65
+ npm publish --tag canal-v4
@@ -21,6 +21,11 @@
21
21
 
22
22
  set -e
23
23
 
24
+ if [ $# -eq 0 ]; then
25
+ echo "no version in argument"
26
+ exit 1
27
+ fi
28
+
24
29
  version=$1
25
30
  date_iso=$(date "+%Y-%m-%d")
26
31
 
@@ -1,7 +1,7 @@
1
1
  sonar.projectKey=rx-player
2
2
  sonar.organization=rx-player
3
3
  sonar.projectName=rx-player
4
- sonar.projectVersion=4.0.0-dev.2023120600
4
+ sonar.projectVersion=4.0.0-dev.2023121900
5
5
  sonar.sources=./src,./demo,./tests
6
6
  sonar.exclusions=demo/full/bundle.js,demo/standalone/lib.js,demo/bundle.js
7
7
  sonar.host.url=https://sonarcloud.io
@@ -30,7 +30,7 @@ import SharedReference, {
30
30
  import TaskCanceller, {
31
31
  CancellationSignal,
32
32
  } from "../../utils/task_canceller";
33
- import { IReadOnlyPlaybackObserver } from "../api";
33
+ import { IObservationPosition, IReadOnlyPlaybackObserver } from "../api";
34
34
  import { IBufferType } from "../segment_buffers";
35
35
  import BufferBasedChooser from "./buffer_based_chooser";
36
36
  import GuessBasedChooser from "./guess_based_chooser";
@@ -272,7 +272,7 @@ function getEstimateReference(
272
272
  }
273
273
  const { position, speed } = lastPlaybackObservation;
274
274
  const timeRanges = val.buffered;
275
- const bufferGap = getLeftSizeOfBufferedTimeRange(timeRanges, position.last);
275
+ const bufferGap = getLeftSizeOfBufferedTimeRange(timeRanges, position.getWanted());
276
276
  const { representation } = val.content;
277
277
  const currentScore = scoreCalculator.getEstimate(representation);
278
278
  const currentBitrate = representation.bitrate;
@@ -389,7 +389,7 @@ function getEstimateReference(
389
389
  if (lowLatencyMode &&
390
390
  currentRepresentationVal !== null &&
391
391
  context.manifest.isDynamic &&
392
- maximumPosition - position.last < 40)
392
+ maximumPosition - position.getWanted() < 40)
393
393
  {
394
394
  chosenRepFromGuessMode = guessBasedChooser
395
395
  .getGuess(sortedRepresentations,
@@ -595,24 +595,7 @@ export interface IRepresentationEstimatorPlaybackObservation {
595
595
  * Information on the current media position in seconds at the time of a
596
596
  * Playback Observation.
597
597
  */
598
- position : {
599
- /**
600
- * Known position at the time the Observation was emitted, in seconds.
601
- *
602
- * Note that it might have changed since. If you want truly precize
603
- * information, you should recuperate it from the HTMLMediaElement directly
604
- * through another mean.
605
- */
606
- last : number;
607
- /**
608
- * Actually wanted position in seconds that is not yet reached.
609
- *
610
- * This might for example be set to the initial position when the content is
611
- * loading (and thus potentially at a `0` position) but which will be seeked
612
- * to a given position once possible.
613
- */
614
- pending : number | undefined;
615
- };
598
+ position : IObservationPosition;
616
599
  /**
617
600
  * Last "playback rate" set by the user. This is the ideal "playback rate" at
618
601
  * which the media should play.
@@ -154,7 +154,7 @@ function estimateStarvationModeBitrate(
154
154
  const { bufferGap, speed, position } = playbackInfo;
155
155
  const realBufferGap = isFinite(bufferGap) ? bufferGap :
156
156
  0;
157
- const nextNeededPosition = position.last + realBufferGap;
157
+ const nextNeededPosition = position.getWanted() + realBufferGap;
158
158
  const concernedRequests = getConcernedRequests(pendingRequests, nextNeededPosition);
159
159
 
160
160
  if (concernedRequests.length !== 1) { // 0 == no request
@@ -238,7 +238,7 @@ function shouldDirectlySwitchToLowBitrate(
238
238
  }
239
239
  const realBufferGap = isFinite(playbackInfo.bufferGap) ? playbackInfo.bufferGap :
240
240
  0;
241
- const nextNeededPosition = playbackInfo.position.last + realBufferGap;
241
+ const nextNeededPosition = playbackInfo.position.getWanted() + realBufferGap;
242
242
  const nextRequest = arrayFind(requests, ({ content }) =>
243
243
  content.segment.duration > 0 &&
244
244
  (content.segment.time + content.segment.duration) > nextNeededPosition);
@@ -334,7 +334,7 @@ export default class NetworkAnalyzer {
334
334
  const { ABR_STARVATION_DURATION_DELTA } = config.getCurrent();
335
335
  // check if should get in/out of starvation mode
336
336
  if (isNaN(duration) ||
337
- realBufferGap + position.last < duration - ABR_STARVATION_DURATION_DELTA)
337
+ realBufferGap + position.getWanted() < duration - ABR_STARVATION_DURATION_DELTA)
338
338
  {
339
339
  if (!this._inStarvationMode && realBufferGap <= localConf.starvationGap) {
340
340
  log.info("ABR: enter starvation mode.");
@@ -18,6 +18,7 @@ import PlaybackObserver from "./playback_observer";
18
18
  import Player from "./public_api";
19
19
  export { PlaybackObserver };
20
20
  export {
21
+ IObservationPosition,
21
22
  IPlaybackObservation,
22
23
  IPlaybackObserverEventType,
23
24
  IReadOnlyPlaybackObserver,