rx-player 4.0.0-dev.2023111400 → 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 (336) hide show
  1. package/CHANGELOG.md +20 -60
  2. package/FILES.md +1 -1
  3. package/README.md +2 -33
  4. package/VERSION +1 -1
  5. package/dist/_esm5.processed/core/api/debug/buffer_graph.js +2 -6
  6. package/dist/_esm5.processed/core/api/debug/modules/general_info.js +20 -10
  7. package/dist/_esm5.processed/core/api/option_utils.d.ts +0 -2
  8. package/dist/_esm5.processed/core/api/option_utils.js +0 -6
  9. package/dist/_esm5.processed/core/api/public_api.d.ts +1 -2
  10. package/dist/_esm5.processed/core/api/public_api.js +9 -17
  11. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +1 -1
  12. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +3 -14
  13. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +2 -36
  14. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +2 -82
  15. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  16. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +1 -1
  17. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  18. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
  19. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
  20. package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +2 -2
  21. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
  22. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +19 -10
  23. package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.js +1 -1
  24. package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.js +1 -1
  25. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_extent.js +1 -8
  26. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  27. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_origin.js +1 -9
  28. package/dist/_esm5.processed/public_types.d.ts +2 -0
  29. package/dist/commonjs/compat/is_codec_supported.js +22 -1
  30. package/dist/commonjs/config.d.ts +2 -1
  31. package/dist/commonjs/core/adaptive/adaptive_representation_selector.d.ts +2 -19
  32. package/dist/commonjs/core/adaptive/adaptive_representation_selector.js +2 -2
  33. package/dist/commonjs/core/adaptive/network_analyzer.js +3 -3
  34. package/dist/commonjs/core/api/debug/buffer_graph.js +2 -6
  35. package/dist/commonjs/core/api/debug/modules/general_info.js +17 -10
  36. package/dist/commonjs/core/api/index.d.ts +1 -1
  37. package/dist/commonjs/core/api/option_utils.d.ts +2 -0
  38. package/dist/commonjs/core/api/option_utils.js +2 -3
  39. package/dist/commonjs/core/api/playback_observer.d.ts +128 -8
  40. package/dist/commonjs/core/api/playback_observer.js +217 -64
  41. package/dist/commonjs/core/api/public_api.d.ts +9 -0
  42. package/dist/commonjs/core/api/public_api.js +41 -16
  43. package/dist/commonjs/core/api/utils.js +1 -1
  44. package/dist/commonjs/core/decrypt/get_media_keys.js +2 -6
  45. package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
  46. package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.js +11 -3
  47. package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts +8 -1
  48. package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +8 -4
  49. package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
  50. package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
  51. package/dist/commonjs/core/init/directfile_content_initializer.js +29 -8
  52. package/dist/commonjs/core/init/media_source_content_initializer.d.ts +6 -0
  53. package/dist/commonjs/core/init/media_source_content_initializer.js +32 -20
  54. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  55. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.js +17 -19
  56. package/dist/commonjs/core/init/utils/create_stream_playback_observer.d.ts +1 -5
  57. package/dist/commonjs/core/init/utils/create_stream_playback_observer.js +16 -14
  58. package/dist/commonjs/core/init/utils/get_initial_time.d.ts +17 -3
  59. package/dist/commonjs/core/init/utils/get_initial_time.js +9 -7
  60. package/dist/commonjs/core/init/utils/initial_seek_and_play.d.ts +9 -11
  61. package/dist/commonjs/core/init/utils/initial_seek_and_play.js +121 -91
  62. package/dist/commonjs/core/init/utils/rebuffering_controller.js +27 -70
  63. package/dist/commonjs/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -2
  64. package/dist/commonjs/core/segment_buffers/garbage_collector.js +1 -2
  65. package/dist/commonjs/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  66. package/dist/commonjs/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  67. package/dist/commonjs/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
  68. package/dist/commonjs/core/segment_buffers/index.d.ts +2 -2
  69. package/dist/commonjs/core/segment_buffers/inventory/index.d.ts +2 -2
  70. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
  71. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.js +19 -10
  72. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.d.ts +2 -2
  73. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.js +16 -9
  74. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +14 -18
  75. package/dist/commonjs/core/stream/period/period_stream.js +5 -8
  76. package/dist/commonjs/core/stream/period/types.d.ts +2 -3
  77. package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
  78. package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.js +17 -13
  79. package/dist/commonjs/core/stream/representation/representation_stream.js +3 -4
  80. package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
  81. package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.js +11 -12
  82. package/dist/commonjs/core/stream/representation/utils/get_buffer_status.js +4 -4
  83. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +1 -1
  84. package/dist/commonjs/default_config.d.ts +12 -16
  85. package/dist/commonjs/default_config.js +21 -16
  86. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
  87. package/dist/commonjs/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
  88. package/dist/commonjs/manifest/adaptation.js +2 -1
  89. package/dist/commonjs/manifest/representation_index/static.d.ts +1 -1
  90. package/dist/commonjs/manifest/representation_index/static.js +2 -2
  91. package/dist/commonjs/manifest/representation_index/types.d.ts +4 -4
  92. package/dist/commonjs/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
  93. package/dist/commonjs/parsers/manifest/dash/common/indexes/base.js +4 -3
  94. package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  95. package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  96. package/dist/commonjs/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  97. package/dist/commonjs/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
  98. package/dist/commonjs/parsers/manifest/dash/common/indexes/list.js +2 -2
  99. package/dist/commonjs/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
  100. package/dist/commonjs/parsers/manifest/dash/common/indexes/template.js +42 -29
  101. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  102. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
  103. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +250 -51
  104. package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  105. package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  106. package/dist/commonjs/parsers/manifest/dash/common/parse_adaptation_sets.js +13 -10
  107. package/dist/commonjs/parsers/manifest/dash/common/parse_mpd.js +27 -14
  108. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  109. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +17 -18
  110. package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
  111. package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.js +21 -8
  112. package/dist/commonjs/parsers/manifest/dash/common/parse_representations.js +7 -3
  113. package/dist/commonjs/parsers/manifest/local/representation_index.d.ts +1 -1
  114. package/dist/commonjs/parsers/manifest/local/representation_index.js +3 -3
  115. package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
  116. package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.js +2 -2
  117. package/dist/commonjs/parsers/manifest/smooth/representation_index.d.ts +5 -5
  118. package/dist/commonjs/parsers/manifest/smooth/representation_index.js +25 -9
  119. package/dist/commonjs/parsers/manifest/utils/index_helpers.js +1 -1
  120. package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  121. package/dist/commonjs/public_types.d.ts +107 -36
  122. package/dist/commonjs/transports/dash/init_segment_loader.js +10 -5
  123. package/dist/commonjs/transports/dash/manifest_parser.js +5 -2
  124. package/dist/commonjs/transports/dash/segment_loader.js +2 -1
  125. package/dist/commonjs/transports/dash/text_loader.js +2 -0
  126. package/dist/commonjs/transports/metaplaylist/manifest_loader.js +2 -1
  127. package/dist/commonjs/transports/metaplaylist/pipelines.js +4 -1
  128. package/dist/commonjs/transports/smooth/pipelines.js +4 -2
  129. package/dist/commonjs/transports/smooth/segment_loader.js +2 -1
  130. package/dist/commonjs/transports/types.d.ts +12 -0
  131. package/dist/commonjs/transports/utils/generate_manifest_loader.js +6 -3
  132. package/dist/commonjs/utils/request/fetch.d.ts +6 -0
  133. package/dist/commonjs/utils/request/fetch.js +29 -8
  134. package/dist/commonjs/utils/request/xhr.d.ts +11 -5
  135. package/dist/commonjs/utils/request/xhr.js +29 -8
  136. package/dist/es2017/compat/is_codec_supported.js +22 -1
  137. package/dist/es2017/config.d.ts +2 -1
  138. package/dist/es2017/core/adaptive/adaptive_representation_selector.d.ts +2 -19
  139. package/dist/es2017/core/adaptive/adaptive_representation_selector.js +2 -2
  140. package/dist/es2017/core/adaptive/network_analyzer.js +3 -3
  141. package/dist/es2017/core/api/debug/buffer_graph.js +2 -6
  142. package/dist/es2017/core/api/debug/modules/general_info.js +17 -10
  143. package/dist/es2017/core/api/index.d.ts +1 -1
  144. package/dist/es2017/core/api/option_utils.d.ts +2 -0
  145. package/dist/es2017/core/api/option_utils.js +2 -3
  146. package/dist/es2017/core/api/playback_observer.d.ts +128 -8
  147. package/dist/es2017/core/api/playback_observer.js +217 -66
  148. package/dist/es2017/core/api/public_api.d.ts +9 -0
  149. package/dist/es2017/core/api/public_api.js +40 -15
  150. package/dist/es2017/core/api/utils.js +1 -1
  151. package/dist/es2017/core/decrypt/get_media_keys.js +2 -6
  152. package/dist/es2017/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
  153. package/dist/es2017/core/fetchers/manifest/manifest_fetcher.js +11 -3
  154. package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts +8 -1
  155. package/dist/es2017/core/fetchers/segment/segment_fetcher.js +8 -4
  156. package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
  157. package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
  158. package/dist/es2017/core/init/directfile_content_initializer.js +31 -8
  159. package/dist/es2017/core/init/media_source_content_initializer.d.ts +6 -0
  160. package/dist/es2017/core/init/media_source_content_initializer.js +34 -22
  161. package/dist/es2017/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  162. package/dist/es2017/core/init/utils/content_time_boundaries_observer.js +17 -17
  163. package/dist/es2017/core/init/utils/create_stream_playback_observer.d.ts +1 -5
  164. package/dist/es2017/core/init/utils/create_stream_playback_observer.js +16 -14
  165. package/dist/es2017/core/init/utils/get_initial_time.d.ts +17 -3
  166. package/dist/es2017/core/init/utils/get_initial_time.js +9 -7
  167. package/dist/es2017/core/init/utils/initial_seek_and_play.d.ts +9 -11
  168. package/dist/es2017/core/init/utils/initial_seek_and_play.js +120 -91
  169. package/dist/es2017/core/init/utils/rebuffering_controller.js +27 -70
  170. package/dist/es2017/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -2
  171. package/dist/es2017/core/segment_buffers/garbage_collector.js +1 -2
  172. package/dist/es2017/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  173. package/dist/es2017/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  174. package/dist/es2017/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
  175. package/dist/es2017/core/segment_buffers/index.d.ts +2 -2
  176. package/dist/es2017/core/segment_buffers/inventory/index.d.ts +2 -2
  177. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
  178. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.js +19 -10
  179. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.d.ts +2 -2
  180. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.js +16 -9
  181. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +16 -18
  182. package/dist/es2017/core/stream/period/period_stream.js +4 -7
  183. package/dist/es2017/core/stream/period/types.d.ts +2 -3
  184. package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
  185. package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.js +17 -13
  186. package/dist/es2017/core/stream/representation/representation_stream.js +3 -4
  187. package/dist/es2017/core/stream/representation/types.d.ts +2 -2
  188. package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.js +1 -2
  189. package/dist/es2017/core/stream/representation/utils/get_buffer_status.js +4 -4
  190. package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -1
  191. package/dist/es2017/default_config.d.ts +12 -16
  192. package/dist/es2017/default_config.js +21 -16
  193. package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
  194. package/dist/es2017/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
  195. package/dist/es2017/manifest/adaptation.js +2 -1
  196. package/dist/es2017/manifest/representation_index/static.d.ts +1 -1
  197. package/dist/es2017/manifest/representation_index/static.js +2 -2
  198. package/dist/es2017/manifest/representation_index/types.d.ts +4 -4
  199. package/dist/es2017/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
  200. package/dist/es2017/parsers/manifest/dash/common/indexes/base.js +4 -3
  201. package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  202. package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  203. package/dist/es2017/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  204. package/dist/es2017/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
  205. package/dist/es2017/parsers/manifest/dash/common/indexes/list.js +2 -2
  206. package/dist/es2017/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
  207. package/dist/es2017/parsers/manifest/dash/common/indexes/template.js +40 -27
  208. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  209. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
  210. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +246 -51
  211. package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  212. package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  213. package/dist/es2017/parsers/manifest/dash/common/parse_adaptation_sets.js +11 -8
  214. package/dist/es2017/parsers/manifest/dash/common/parse_mpd.js +27 -13
  215. package/dist/es2017/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  216. package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +13 -16
  217. package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
  218. package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.js +10 -8
  219. package/dist/es2017/parsers/manifest/dash/common/parse_representations.js +7 -3
  220. package/dist/es2017/parsers/manifest/local/representation_index.d.ts +1 -1
  221. package/dist/es2017/parsers/manifest/local/representation_index.js +3 -3
  222. package/dist/es2017/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
  223. package/dist/es2017/parsers/manifest/metaplaylist/representation_index.js +2 -2
  224. package/dist/es2017/parsers/manifest/smooth/representation_index.d.ts +5 -5
  225. package/dist/es2017/parsers/manifest/smooth/representation_index.js +25 -9
  226. package/dist/es2017/parsers/manifest/utils/index_helpers.js +1 -1
  227. package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  228. package/dist/es2017/public_types.d.ts +107 -36
  229. package/dist/es2017/transports/dash/init_segment_loader.js +5 -0
  230. package/dist/es2017/transports/dash/manifest_parser.js +3 -0
  231. package/dist/es2017/transports/dash/segment_loader.js +1 -0
  232. package/dist/es2017/transports/dash/text_loader.js +2 -0
  233. package/dist/es2017/transports/metaplaylist/manifest_loader.js +1 -0
  234. package/dist/es2017/transports/metaplaylist/pipelines.js +4 -1
  235. package/dist/es2017/transports/smooth/pipelines.js +2 -0
  236. package/dist/es2017/transports/smooth/segment_loader.js +1 -0
  237. package/dist/es2017/transports/types.d.ts +12 -0
  238. package/dist/es2017/transports/utils/generate_manifest_loader.js +3 -0
  239. package/dist/es2017/utils/request/fetch.d.ts +6 -0
  240. package/dist/es2017/utils/request/fetch.js +29 -8
  241. package/dist/es2017/utils/request/xhr.d.ts +11 -5
  242. package/dist/es2017/utils/request/xhr.js +30 -9
  243. package/dist/mpd-parser.wasm +0 -0
  244. package/dist/rx-player.js +1335 -812
  245. package/dist/rx-player.min.js +1 -1
  246. package/package.json +7 -4
  247. package/scripts/canal-release.patch +78 -0
  248. package/scripts/make-dev-releases +65 -0
  249. package/scripts/update-version +7 -0
  250. package/sonar-project.properties +1 -1
  251. package/src/compat/is_codec_supported.ts +23 -1
  252. package/src/core/adaptive/adaptive_representation_selector.ts +4 -21
  253. package/src/core/adaptive/network_analyzer.ts +3 -3
  254. package/src/core/api/debug/buffer_graph.ts +2 -5
  255. package/src/core/api/debug/modules/general_info.ts +15 -10
  256. package/src/core/api/index.ts +1 -0
  257. package/src/core/api/option_utils.ts +3 -3
  258. package/src/core/api/playback_observer.ts +327 -107
  259. package/src/core/api/public_api.ts +42 -14
  260. package/src/core/api/utils.ts +3 -1
  261. package/src/core/decrypt/get_media_keys.ts +2 -8
  262. package/src/core/fetchers/manifest/manifest_fetcher.ts +21 -3
  263. package/src/core/fetchers/segment/segment_fetcher.ts +19 -5
  264. package/src/core/fetchers/segment/segment_fetcher_creator.ts +1 -0
  265. package/src/core/fetchers/utils/schedule_request.ts +1 -1
  266. package/src/core/init/directfile_content_initializer.ts +31 -15
  267. package/src/core/init/media_source_content_initializer.ts +40 -27
  268. package/src/core/init/utils/content_time_boundaries_observer.ts +24 -23
  269. package/src/core/init/utils/create_stream_playback_observer.ts +19 -20
  270. package/src/core/init/utils/get_initial_time.ts +25 -12
  271. package/src/core/init/utils/initial_seek_and_play.ts +140 -108
  272. package/src/core/init/utils/rebuffering_controller.ts +32 -77
  273. package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +5 -2
  274. package/src/core/segment_buffers/garbage_collector.ts +1 -1
  275. package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +10 -2
  276. package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +1 -1
  277. package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +1 -1
  278. package/src/core/segment_buffers/index.ts +2 -0
  279. package/src/core/segment_buffers/inventory/index.ts +2 -0
  280. package/src/core/segment_buffers/inventory/segment_inventory.ts +49 -17
  281. package/src/core/stream/adaptation/get_representations_switch_strategy.ts +21 -12
  282. package/src/core/stream/orchestrator/stream_orchestrator.ts +14 -19
  283. package/src/core/stream/period/period_stream.ts +7 -8
  284. package/src/core/stream/period/types.ts +2 -3
  285. package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +21 -15
  286. package/src/core/stream/representation/representation_stream.ts +3 -5
  287. package/src/core/stream/representation/types.ts +2 -2
  288. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +1 -1
  289. package/src/core/stream/representation/utils/get_buffer_status.ts +5 -4
  290. package/src/core/stream/representation/utils/get_needed_segments.ts +2 -2
  291. package/src/default_config.ts +22 -17
  292. package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +3 -1
  293. package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +2 -0
  294. package/src/manifest/adaptation.ts +2 -1
  295. package/src/manifest/representation_index/static.ts +2 -2
  296. package/src/manifest/representation_index/types.ts +4 -4
  297. package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +182 -36
  298. package/src/parsers/manifest/dash/common/indexes/base.ts +12 -4
  299. package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +19 -5
  300. package/src/parsers/manifest/dash/common/indexes/index.ts +16 -4
  301. package/src/parsers/manifest/dash/common/indexes/list.ts +2 -2
  302. package/src/parsers/manifest/dash/common/indexes/template.ts +52 -31
  303. package/src/parsers/manifest/dash/common/indexes/timeline/index.ts +4 -1
  304. package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +366 -60
  305. package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +63 -25
  306. package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +10 -4
  307. package/src/parsers/manifest/dash/common/parse_mpd.ts +28 -15
  308. package/src/parsers/manifest/dash/common/parse_periods.ts +12 -17
  309. package/src/parsers/manifest/dash/common/parse_representation_index.ts +50 -26
  310. package/src/parsers/manifest/dash/common/parse_representations.ts +9 -3
  311. package/src/parsers/manifest/local/representation_index.ts +3 -3
  312. package/src/parsers/manifest/metaplaylist/representation_index.ts +2 -2
  313. package/src/parsers/manifest/smooth/representation_index.ts +23 -9
  314. package/src/parsers/manifest/utils/__tests__/get_first_time_from_adaptations.test.ts +1 -1
  315. package/src/parsers/manifest/utils/__tests__/get_last_time_from_adaptation.test.ts +1 -1
  316. package/src/parsers/manifest/utils/index_helpers.ts +1 -1
  317. package/src/parsers/texttracks/ttml/html/apply_line_height.ts +3 -1
  318. package/src/public_types.ts +108 -36
  319. package/src/transports/dash/init_segment_loader.ts +5 -0
  320. package/src/transports/dash/manifest_parser.ts +6 -0
  321. package/src/transports/dash/segment_loader.ts +1 -0
  322. package/src/transports/dash/text_loader.ts +2 -0
  323. package/src/transports/metaplaylist/manifest_loader.ts +1 -0
  324. package/src/transports/metaplaylist/pipelines.ts +4 -1
  325. package/src/transports/smooth/pipelines.ts +2 -0
  326. package/src/transports/smooth/segment_loader.ts +1 -0
  327. package/src/transports/types.ts +12 -0
  328. package/src/transports/utils/generate_manifest_loader.ts +3 -0
  329. package/src/utils/request/fetch.ts +35 -8
  330. package/src/utils/request/xhr.ts +45 -14
  331. package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  332. package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.js +0 -54
  333. package/dist/es2017/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  334. package/dist/es2017/parsers/manifest/utils/is_segment_still_available.js +0 -51
  335. package/src/parsers/manifest/utils/is_segment_still_available.ts +0 -58
  336. package/src/typings/object-assign.d.ts +0 -48
package/CHANGELOG.md CHANGED
@@ -1,23 +1,40 @@
1
- # Changelog
1
+ ## v4.0.0-dev.2023121900 (2023-12-19)
2
2
 
3
- ## v4.0.0-dev.2023111400 (2023-11-14)
3
+ ### Changes
4
+
5
+ - A `representationFilter`'s advertised `codec` has now been renamed to `codecs` and is an Array when defined [#1332]
4
6
 
5
7
  ### Features
6
8
 
7
- - Add the possibility to set a new `keySystems` option on the `reload` API [#1308]
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]
8
13
 
9
14
  ### Bug fixes
10
15
 
11
16
  - Fix subtitles "blinking" in some specific conditions, especially with some DASH low-latency contents [#1314]
12
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]
13
19
  - Fix import of the `LOCAL_MANIFEST` experimental feature
14
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]
15
23
 
16
24
  ### Other improvements
17
25
 
18
26
  - Provide both commonJS and ES6-style exports to improve compatibilities with applications
19
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]
20
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]
21
38
 
22
39
 
23
40
  ## v4.0.0-beta.3 (2023-10-19)
@@ -245,63 +262,6 @@
245
262
  - doc: externalize documentation-generator code
246
263
 
247
264
 
248
- ## v3.32.0
249
-
250
- ### Features
251
-
252
- - DASH: add optional `isSpatialAudio` boolean property to Representation returned by `getAvailableAudioTracks`, `getAudioTrack`, corresponding events, and `trackInfo` optional property of `MediaError` objects to signal Dolby Atmos techology [#1275]
253
- - `LOCAL`: add `isSpatialAudio` property to Representation of the experiment `"local"` transport (used for offline playback) [#1275]
254
- - `addFeatures` static method is now available on all RxPlayer builds. It was previously only in the minimal (`rx-player/minimal` import path) [#1287]
255
- - The `NATIVE_TEXT_BUFFER`, `HTML_TEXT_BUFFER` and `IMAGE_BUFFER` features are now totally optional [#1287, #1293]
256
-
257
- ### Bug fixes
258
-
259
- - Fix `setVideoBitrate` and `setAudioBitrate` API which may have led to a higher quality than wanted in the default `"seamless"` `manualBitrateSwitchingMode` if our buffer-based adaptive logic decided to [#1267, #1271]
260
- - On the PlayStation 5, only switch to the `"LOADED"` state once the HTMLMediaElement's `readyState` of `4` has been reached, as it seems to switch to `3` too soon there [#1257]
261
- - DASH: Fix potential track duplication if more than two `AdaptationSet` have an `adaptation-set-switching` `<SupplementalProperty>` between one another [#1279]
262
- - DASH-WASM: availabilityTimeOffset is actually a floating number [#1278]
263
-
264
- ### Other improvements
265
-
266
- - Do not load the last text segment if the current position goes after it as it is unnecessary [#1256]
267
- - Implement better `NetworkError` messages [#1274]
268
- - Set a better error message for when no `keySystems` option is set when playing an encrypted content
269
- - Fix very small memory leak when reloading a content [#1286]
270
- - Re-check for segments to load immediately after the manifest has been refreshed [#1282]
271
- - When "fallbacking" an undecipherable Representation, now empty the whole buffer if we can't make out where content was in the buffer [#1283]
272
- - Improve segment start detection in buffer when there's unknown data buffered before it [#1284]
273
- - DRM: Selection of alternative EME API like those used on IE11 or Safari has been refactored to facilitate future developments [#1261]
274
-
275
- ### Deprecated
276
-
277
- - Deprecate the `manifestUpdateUrl` `loadVideo` option as it doesn't seem used anymore [#1288]
278
- - Deprecate the `NATIVE_TEXT_BUFFER`, `HTML_TEXT_BUFFER` and `IMAGE_BUFFER` features as they are now unneeded [#1287, #1293]
279
-
280
-
281
- ## v3.31.0 (2023-06-14)
282
-
283
- ### Features
284
-
285
- - Add `isContentLoaded`, `isBuffering`, `isPaused`, and `getLastStoredContentPosition` methods [#1248]
286
- - Add `play` and `paused` events [#1253]
287
- - Add `trackInfo` property to some `MediaError` to expose information on the track that caused the error [#1241]
288
-
289
- ### Bug fixes
290
-
291
- - DASH: Fix issue which could lead to infinite rebuffering when switching between multiple Periods [#1232]
292
- - Return actual ending duration through the `getVideoDuration` method when playing dynamic contents whose future end is already known [#1235]
293
- - DASH/WASM: actually reject the `DASH_WASM.initialize`'s Promise if it fails [#1238]
294
- - On the PlayStation 5, set `Infinity` MediaSource duration for live contents to prevent playback issues [#1250]
295
-
296
- ### Other improvements
297
-
298
- - adaptive: Perform various adaptive tweaks to avoid switching too much between qualities in some conditions [#1237]
299
- - Directfile: Detect "forced" subtitles on Safari when playing directfile contents (such as HLS) [#1239]
300
- - Improve `"direct"` `audioTrackSwitchingMode` compatibility by re-seeking [#1246]
301
- - The `DEBUG_ELEMENT` feature now uses the `monospace` fallback font as a default for a better rendering on apple devices
302
- - doc: externalize documentation-generator code
303
-
304
-
305
265
  ## v3.30.0 (2023-03-07)
306
266
 
307
267
  ### Features
package/FILES.md CHANGED
@@ -20,7 +20,7 @@ At the time of writing, there are two distinct demos:
20
20
 
21
21
  ## `dist/`: Builds
22
22
 
23
- The `demo/` directory stores the player builds of the last version released.
23
+ The `dist/` directory stores the player builds of the last version released.
24
24
 
25
25
  Directories can also be generated in here if the right scripts are called.
26
26
  These allow to publish more modular codebases to npm.
package/README.md CHANGED
@@ -179,21 +179,11 @@ Demo pages for our previous versions are also available
179
179
 
180
180
 
181
181
 
182
- ## Your questions ##############################################################
183
-
184
- You can ask directly your questions about the project on [our
185
- gitter](https://gitter.im/canalplus/rx-player).
186
- We will try our best to answer them as quickly as possible.
187
-
188
-
189
-
190
182
  ## Contribute ##################################################################
191
183
 
192
184
  Details on how to contribute is written in the [CONTRIBUTING.md
193
185
  file](./CONTRIBUTING.md) at the root of this repository.
194
186
 
195
- If you need more information, you can contact us via our [gitter
196
- room](https://gitter.im/canalplus/rx-player).
197
187
 
198
188
 
199
189
  ### Dependencies ###############################################################
@@ -213,7 +203,7 @@ Canal+ Group is a media company with many advanced needs when it comes to media
213
203
  playback: it provides both live and VoD stream with multiple encryption
214
204
  requirements, supports a very large panel of devices and has many other
215
205
  specificities (like adult content restrictions, ad-insertion, Peer-To-Peer
216
- integration...).
206
+ integration, low-latency live streaming...).
217
207
 
218
208
  When the time came to switch from a plugin-based web player approach to an HTML5
219
209
  one back in 2015, no media player had the key features we wanted, and including
@@ -224,7 +214,7 @@ The R&D department of Canal+ Group thus started to work on a new featureful
224
214
  media-player: the RxPlayer. To both help and profit from the community, it also
225
215
  decided to share it to everyone under a permissive open-source licence.
226
216
 
227
- Now, more than 6 years later, the RxPlayer continues to evolve at the same fast
217
+ Now, more than 8 years later, the RxPlayer continues to evolve at the same fast
228
218
  pace to include a lot of features and improvements you may not find in other
229
219
  media players.
230
220
  You can look at our
@@ -271,24 +261,3 @@ them. Amongst those:
271
261
  risks always low.
272
262
 
273
263
  \* In "directfile" mode, on compatible browsers
274
-
275
-
276
- ## Target support ##############################################################
277
-
278
- Here is a basic list of supported platforms:
279
-
280
- | | Chrome | IE [1] | Edge | Firefox | Safari | Opera |
281
- |-------------|:-------:|:-------:|:------:|:---------:|:--------:|:-------:|
282
- | Windows | >= 30 | >= 11 | >= 12 | >= 42 | >= 8 | >= 25 |
283
- | OSX | >= 30 | - | - | >= 42 | >= 8 | >= 25 |
284
- | Linux | >= 37 | - | - | >= 42 | - | >= 25 |
285
- | Android [2] | >= 30 | - | - | >= 42 | - | >= 15 |
286
- | iOS | No | - | - | No | No | No |
287
-
288
- [1] Only on Windows >= 8.
289
-
290
- [2] Android version >= 4.2
291
-
292
- And more. A good way to know if the browser should be supported by our player is
293
- to go on the page https://www.youtube.com/html5 and check for "Media Source
294
- Extensions" support.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.0-dev.2023111400
1
+ 4.0.0-dev.2023121900
@@ -1,4 +1,4 @@
1
- var BUFFER_WIDTH_IN_SECONDS = 10000;
1
+ var BUFFER_WIDTH_IN_SECONDS = 30 * 60;
2
2
  var COLORS = [
3
3
  "#2ab7ca",
4
4
  "#fed766",
@@ -65,11 +65,7 @@ var SegmentBufferGraph = /** @class */ (function () {
65
65
  var minimumPosition;
66
66
  var maximumPosition;
67
67
  if (maximumPoint - minimumPoint > BUFFER_WIDTH_IN_SECONDS) {
68
- if (currentTime === undefined) {
69
- minimumPosition = minimumPoint;
70
- maximumPosition = maximumPoint;
71
- }
72
- else if (maximumPoint - currentTime < BUFFER_WIDTH_IN_SECONDS / 2) {
68
+ if (maximumPoint - currentTime < BUFFER_WIDTH_IN_SECONDS / 2) {
73
69
  maximumPosition = maximumPoint;
74
70
  minimumPosition = maximumPoint - BUFFER_WIDTH_IN_SECONDS;
75
71
  }
@@ -17,6 +17,7 @@ export default function constructDebugGeneralInfo(instance, parentElt, cancelSig
17
17
  representationsElt,
18
18
  ]);
19
19
  function updateGeneralInfo() {
20
+ var _a, _b, _c, _d;
20
21
  var videoElement = instance.getVideoElement();
21
22
  if (videoElement === null) {
22
23
  // disposed player. Clean-up everything
@@ -99,12 +100,12 @@ export default function constructDebugGeneralInfo(instance, parentElt, cancelSig
99
100
  valuesLine3.push(["er", "\"".concat(String(error), "\"")]);
100
101
  }
101
102
  generalInfoElt.innerHTML = "";
102
- for (var _i = 0, _a = [valuesLine1, valuesLine2, valuesLine3]; _i < _a.length; _i++) {
103
- var valueSet = _a[_i];
103
+ for (var _i = 0, _e = [valuesLine1, valuesLine2, valuesLine3]; _i < _e.length; _i++) {
104
+ var valueSet = _e[_i];
104
105
  if (valueSet.length > 0) {
105
106
  var lineInfoElt = createElement("div");
106
- for (var _b = 0, valueSet_1 = valueSet; _b < valueSet_1.length; _b++) {
107
- var value = valueSet_1[_b];
107
+ for (var _f = 0, valueSet_1 = valueSet; _f < valueSet_1.length; _f++) {
108
+ var value = valueSet_1[_f];
108
109
  lineInfoElt.appendChild(createMetricTitle(value[0]));
109
110
  lineInfoElt.appendChild(createElement("span", {
110
111
  textContent: value[1] + " ",
@@ -175,19 +176,28 @@ export default function constructDebugGeneralInfo(instance, parentElt, cancelSig
175
176
  ]);
176
177
  adaptationsElt.appendChild(textAdaps);
177
178
  }
178
- var videoBitrates = instance.getAvailableVideoBitrates();
179
- var audioBitrates = instance.getAvailableAudioBitrates();
179
+ var adaptations = instance.getCurrentAdaptations();
180
+ var videoBitratesStr = (_b = (_a = adaptations === null || adaptations === void 0 ? void 0 : adaptations.video) === null || _a === void 0 ? void 0 : _a.representations.map(function (r) {
181
+ return String(r.bitrate) +
182
+ (r.isSupported ? "" : " U!") +
183
+ (r.decipherable !== false ? "" : " E!");
184
+ })) !== null && _b !== void 0 ? _b : [];
185
+ var audioBitratesStr = (_d = (_c = adaptations === null || adaptations === void 0 ? void 0 : adaptations.video) === null || _c === void 0 ? void 0 : _c.representations.map(function (r) {
186
+ return String(r.bitrate) +
187
+ (r.isSupported ? "" : " U!") +
188
+ (r.decipherable !== false ? "" : " E!");
189
+ })) !== null && _d !== void 0 ? _d : [];
180
190
  representationsElt.innerHTML = "";
181
- if (videoBitrates.length > 0) {
191
+ if (videoBitratesStr.length > 0) {
182
192
  representationsElt.appendChild(createMetricTitle("vb"));
183
193
  representationsElt.appendChild(createElement("span", {
184
- textContent: videoBitrates.join(" ") + " ",
194
+ textContent: videoBitratesStr.join(" ") + " ",
185
195
  }));
186
196
  }
187
- if (audioBitrates.length > 0) {
197
+ if (audioBitratesStr.length > 0) {
188
198
  representationsElt.appendChild(createMetricTitle("ab"));
189
199
  representationsElt.appendChild(createElement("span", {
190
- textContent: audioBitrates.join(" ") + " ",
200
+ textContent: audioBitratesStr.join(" ") + " ",
191
201
  }));
192
202
  }
193
203
  }
@@ -125,8 +125,6 @@ declare function checkReloadOptions(options?: {
125
125
  position?: number;
126
126
  relative?: number;
127
127
  };
128
- keySystems?: IKeySystemOption[];
129
- autoPlay?: boolean;
130
128
  }): void;
131
129
  /**
132
130
  * Parse options given to loadVideo and set default options as found
@@ -255,12 +255,6 @@ 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
- }
264
258
  }
265
259
  /**
266
260
  * Parse options given to loadVideo and set default options as found
@@ -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, IKeySystemOption, 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, 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,7 +169,6 @@ declare class Player extends EventEmitter<IPublicAPIEvent> {
169
169
  position?: number;
170
170
  relative?: number;
171
171
  };
172
- keySystems?: IKeySystemOption[];
173
172
  autoPlay?: boolean;
174
173
  }): void;
175
174
  createDebugElement(element: HTMLElement): {
@@ -88,7 +88,7 @@ var Player = /** @class */ (function (_super) {
88
88
  // Workaround to support Firefox autoplay on FF 42.
89
89
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
90
90
  videoElement.preload = "auto";
91
- _this.version = /* PLAYER_VERSION */ "3.33.0-canal.2023111400";
91
+ _this.version = /* PLAYER_VERSION */ "3.32.1";
92
92
  _this.log = log;
93
93
  _this.state = "STOPPED";
94
94
  _this.videoElement = videoElement;
@@ -283,8 +283,8 @@ var Player = /** @class */ (function (_super) {
283
283
  * @param {Object} reloadOpts
284
284
  */
285
285
  Player.prototype.reload = function (reloadOpts) {
286
- var _a, _b, _c;
287
- var _d = this._priv_reloadingMetadata, options = _d.options, manifest = _d.manifest, reloadPosition = _d.reloadPosition, reloadInPause = _d.reloadInPause;
286
+ var _a, _b;
287
+ var _c = this._priv_reloadingMetadata, options = _c.options, manifest = _c.manifest, reloadPosition = _c.reloadPosition, reloadInPause = _c.reloadInPause;
288
288
  if (options === undefined) {
289
289
  throw new Error("API: Can't reload without having previously loaded a content.");
290
290
  }
@@ -311,13 +311,6 @@ var Player = /** @class */ (function (_super) {
311
311
  else if (reloadInPause !== undefined) {
312
312
  autoPlay = !reloadInPause;
313
313
  }
314
- var keySystems;
315
- if ((reloadOpts === null || reloadOpts === void 0 ? void 0 : reloadOpts.keySystems) !== undefined) {
316
- keySystems = reloadOpts.keySystems;
317
- }
318
- else if (((_c = this._priv_reloadingMetadata.options) === null || _c === void 0 ? void 0 : _c.keySystems) !== undefined) {
319
- keySystems = this._priv_reloadingMetadata.options.keySystems;
320
- }
321
314
  var newOptions = __assign(__assign({}, options), { initialManifest: manifest });
322
315
  if (startAt !== undefined) {
323
316
  newOptions.startAt = startAt;
@@ -325,9 +318,6 @@ var Player = /** @class */ (function (_super) {
325
318
  if (autoPlay !== undefined) {
326
319
  newOptions.autoPlay = autoPlay;
327
320
  }
328
- if (keySystems !== undefined) {
329
- newOptions.keySystems = keySystems;
330
- }
331
321
  this._priv_initializeContentPlayback(newOptions);
332
322
  };
333
323
  Player.prototype.createDebugElement = function (element) {
@@ -1920,9 +1910,11 @@ var Player = /** @class */ (function (_super) {
1920
1910
  }
1921
1911
  var segmentBufferStatus = this._priv_contentInfos
1922
1912
  .segmentBuffersStore.getStatus(bufferType);
1923
- return segmentBufferStatus.type === "initialized" ?
1924
- segmentBufferStatus.value.getInventory() :
1925
- null;
1913
+ if (segmentBufferStatus.type === "initialized") {
1914
+ segmentBufferStatus.value.synchronizeInventory();
1915
+ return segmentBufferStatus.value.getInventory();
1916
+ }
1917
+ return null;
1926
1918
  };
1927
1919
  /**
1928
1920
  * Reset all state properties relative to a playing content.
@@ -2449,5 +2441,5 @@ var Player = /** @class */ (function (_super) {
2449
2441
  };
2450
2442
  return Player;
2451
2443
  }(EventEmitter));
2452
- Player.version = /* PLAYER_VERSION */ "3.33.0-canal.2023111400";
2444
+ Player.version = /* PLAYER_VERSION */ "3.32.1";
2453
2445
  export default Player;
@@ -98,7 +98,7 @@ var DirectFileContentInitializer = /** @class */ (function (_super) {
98
98
  * Class trying to avoid various stalling situations, emitting "stalled"
99
99
  * events when it cannot, as well as "unstalled" events when it get out of one.
100
100
  */
101
- var rebufferingController = new RebufferingController(playbackObserver, null, null, speed);
101
+ var rebufferingController = new RebufferingController(playbackObserver, null, speed);
102
102
  rebufferingController.addEventListener("stalled", function (evt) {
103
103
  return _this.trigger("stalled", evt);
104
104
  });
@@ -352,18 +352,7 @@ var MediaSourceContentInitializer = /** @class */ (function (_super) {
352
352
  }
353
353
  }, { clearSignal: cancelSignal, emitCurrentValue: true });
354
354
  var streamObserver = createStreamPlaybackObserver(playbackObserver, { autoPlay: autoPlay, manifest: manifest, initialPlayPerformed: initialPlayPerformed, initialSeekPerformed: initialSeekPerformed, speed: speed, startTime: initialTime }, cancelSignal);
355
- var rebufferingController = this._createRebufferingController(playbackObserver, manifest, segmentBuffersStore, speed, cancelSignal);
356
- rebufferingController.addEventListener("needsReload", function () {
357
- // NOTE couldn't both be always calculated at event destination?
358
- // Maybe there are exceptions?
359
- var position = initialSeekPerformed.getValue() ?
360
- playbackObserver.getCurrentTime() :
361
- initialTime;
362
- var autoplay = initialPlayPerformed.getValue() ?
363
- !playbackObserver.getIsPaused() :
364
- autoPlay;
365
- onReloadOrder({ position: position, autoPlay: autoplay });
366
- }, cancelSignal);
355
+ var rebufferingController = this._createRebufferingController(playbackObserver, manifest, speed, cancelSignal);
367
356
  var contentTimeBoundariesObserver = this
368
357
  ._createContentTimeBoundariesObserver(manifest, mediaSource, streamObserver, segmentBuffersStore, cancelSignal);
369
358
  /**
@@ -620,9 +609,9 @@ var MediaSourceContentInitializer = /** @class */ (function (_super) {
620
609
  * @param {Object} cancelSignal
621
610
  * @returns {Object}
622
611
  */
623
- MediaSourceContentInitializer.prototype._createRebufferingController = function (playbackObserver, manifest, segmentBuffersStore, speed, cancelSignal) {
612
+ MediaSourceContentInitializer.prototype._createRebufferingController = function (playbackObserver, manifest, speed, cancelSignal) {
624
613
  var _this = this;
625
- var rebufferingController = new RebufferingController(playbackObserver, manifest, segmentBuffersStore, speed);
614
+ var rebufferingController = new RebufferingController(playbackObserver, manifest, speed);
626
615
  // Bubble-up events
627
616
  rebufferingController.addEventListener("stalled", function (evt) { return _this.trigger("stalled", evt); });
628
617
  rebufferingController.addEventListener("unstalled", function () { return _this.trigger("unstalled", null); });
@@ -18,7 +18,7 @@ import { IPlayerError } from "../../../public_types";
18
18
  import EventEmitter from "../../../utils/event_emitter";
19
19
  import { IReadOnlySharedReference } from "../../../utils/reference";
20
20
  import { PlaybackObserver } from "../../api";
21
- import SegmentBuffersStore, { IBufferType } from "../../segment_buffers";
21
+ import { IBufferType } from "../../segment_buffers";
22
22
  import { IStallingSituation } from "../types";
23
23
  /**
24
24
  * Monitor playback, trying to avoid stalling situation.
@@ -32,7 +32,6 @@ export default class RebufferingController extends EventEmitter<IRebufferingCont
32
32
  /** Emit the current playback conditions */
33
33
  private _playbackObserver;
34
34
  private _manifest;
35
- private _segmentBuffersStore;
36
35
  private _speed;
37
36
  private _isStarted;
38
37
  /**
@@ -41,23 +40,12 @@ export default class RebufferingController extends EventEmitter<IRebufferingCont
41
40
  */
42
41
  private _discontinuitiesStore;
43
42
  private _canceller;
44
- /**
45
- * If set to something else than `null`, this is the DOMHighResTimestamp as
46
- * outputed by `performance.now()` when playback begin to seem to not start
47
- * despite having decipherable data in the buffer(s).
48
- *
49
- * If enough time in that condition is spent, special considerations are
50
- * taken at which point `_currentFreezeTimestamp` is reset to `null`.
51
- *
52
- * It is also reset to `null` when and if there is no such issue anymore.
53
- */
54
- private _currentFreezeTimestamp;
55
43
  /**
56
44
  * @param {object} playbackObserver - emit the current playback conditions.
57
45
  * @param {Object} manifest - The Manifest of the currently-played content.
58
46
  * @param {Object} speed - The last speed set by the user
59
47
  */
60
- constructor(playbackObserver: PlaybackObserver, manifest: Manifest | null, segmentBuffersStore: SegmentBuffersStore | null, speed: IReadOnlySharedReference<number>);
48
+ constructor(playbackObserver: PlaybackObserver, manifest: Manifest | null, speed: IReadOnlySharedReference<number>);
61
49
  start(): void;
62
50
  /**
63
51
  * Update information on an upcoming discontinuity for a given buffer type and
@@ -80,32 +68,10 @@ export default class RebufferingController extends EventEmitter<IRebufferingCont
80
68
  * forever.
81
69
  */
82
70
  destroy(): void;
83
- /**
84
- * Support of contents with DRM on all the platforms out there is a pain in
85
- * the *ss considering all the DRM-related bugs there are.
86
- *
87
- * We found out a frequent issue which is to be unable to play despite having
88
- * all the decryption keys to play what is currently buffered.
89
- * When this happens, re-creating the buffers from scratch, with a reload, is
90
- * usually sufficient to unlock the situation.
91
- *
92
- * Although we prefer providing more targeted fixes or telling to platform
93
- * developpers to fix their implementation, it's not always possible.
94
- * We thus resorted to developping an heuristic which detects such situation
95
- * and reload in that case.
96
- *
97
- * @param {Object} observation - The last playback observation produced, it
98
- * has to be recent (just triggered for example).
99
- * @returns {boolean} - Returns `true` if it seems to be such kind of
100
- * decipherability freeze, in which case this method already performed the
101
- * right handling steps.
102
- */
103
- private _checkDecipherabilityFreeze;
104
71
  }
105
72
  export interface IRebufferingControllerEvent {
106
73
  stalled: IStallingSituation;
107
74
  unstalled: null;
108
- needsReload: null;
109
75
  warning: IPlayerError;
110
76
  }
111
77
  /**
@@ -55,16 +55,14 @@ var RebufferingController = /** @class */ (function (_super) {
55
55
  * @param {Object} manifest - The Manifest of the currently-played content.
56
56
  * @param {Object} speed - The last speed set by the user
57
57
  */
58
- function RebufferingController(playbackObserver, manifest, segmentBuffersStore, speed) {
58
+ function RebufferingController(playbackObserver, manifest, speed) {
59
59
  var _this = _super.call(this) || this;
60
60
  _this._playbackObserver = playbackObserver;
61
61
  _this._manifest = manifest;
62
- _this._segmentBuffersStore = segmentBuffersStore;
63
62
  _this._speed = speed;
64
63
  _this._discontinuitiesStore = [];
65
64
  _this._isStarted = false;
66
65
  _this._canceller = new TaskCanceller();
67
- _this._currentFreezeTimestamp = null;
68
66
  return _this;
69
67
  }
70
68
  RebufferingController.prototype.start = function () {
@@ -119,9 +117,6 @@ var RebufferingController = /** @class */ (function (_super) {
119
117
  lastSeekingPosition = observation.seeking ?
120
118
  Math.max((_a = observation.pendingInternalSeek) !== null && _a !== void 0 ? _a : 0, observation.position) :
121
119
  null;
122
- if (_this._checkDecipherabilityFreeze(observation)) {
123
- return;
124
- }
125
120
  if (freezing !== null) {
126
121
  var now = performance.now();
127
122
  var referenceTimestamp = prevFreezingState === null ?
@@ -180,7 +175,7 @@ var RebufferingController = /** @class */ (function (_super) {
180
175
  return;
181
176
  }
182
177
  else {
183
- log.warn("Init: ignored stall for too long, considering it", now - ignoredStallTimeStamp);
178
+ log.warn("Init: ignored stall for too long, checking discontinuity", now - ignoredStallTimeStamp);
184
179
  }
185
180
  }
186
181
  ignoredStallTimeStamp = null;
@@ -296,81 +291,6 @@ var RebufferingController = /** @class */ (function (_super) {
296
291
  RebufferingController.prototype.destroy = function () {
297
292
  this._canceller.cancel();
298
293
  };
299
- /**
300
- * Support of contents with DRM on all the platforms out there is a pain in
301
- * the *ss considering all the DRM-related bugs there are.
302
- *
303
- * We found out a frequent issue which is to be unable to play despite having
304
- * all the decryption keys to play what is currently buffered.
305
- * When this happens, re-creating the buffers from scratch, with a reload, is
306
- * usually sufficient to unlock the situation.
307
- *
308
- * Although we prefer providing more targeted fixes or telling to platform
309
- * developpers to fix their implementation, it's not always possible.
310
- * We thus resorted to developping an heuristic which detects such situation
311
- * and reload in that case.
312
- *
313
- * @param {Object} observation - The last playback observation produced, it
314
- * has to be recent (just triggered for example).
315
- * @returns {boolean} - Returns `true` if it seems to be such kind of
316
- * decipherability freeze, in which case this method already performed the
317
- * right handling steps.
318
- */
319
- RebufferingController.prototype._checkDecipherabilityFreeze = function (observation) {
320
- var readyState = observation.readyState, rebuffering = observation.rebuffering, freezing = observation.freezing;
321
- var bufferGap = observation.bufferGap !== undefined &&
322
- isFinite(observation.bufferGap) ? observation.bufferGap :
323
- 0;
324
- if (this._segmentBuffersStore === null ||
325
- bufferGap < 6 ||
326
- (rebuffering === null && freezing === null) ||
327
- readyState > 1) {
328
- this._currentFreezeTimestamp = null;
329
- return false;
330
- }
331
- var now = performance.now();
332
- if (this._currentFreezeTimestamp === null) {
333
- this._currentFreezeTimestamp = now;
334
- }
335
- var rebufferingForTooLong = rebuffering !== null && now - rebuffering.timestamp > 4000;
336
- var frozenForTooLong = freezing !== null && now - freezing.timestamp > 4000;
337
- if ((rebufferingForTooLong || frozenForTooLong) &&
338
- this._currentFreezeTimestamp > 4000) {
339
- var statusAudio = this._segmentBuffersStore.getStatus("audio");
340
- var statusVideo = this._segmentBuffersStore.getStatus("video");
341
- var hasOnlyDecipherableSegments = true;
342
- var isClear = true;
343
- for (var _i = 0, _a = [statusAudio, statusVideo]; _i < _a.length; _i++) {
344
- var status_1 = _a[_i];
345
- if (status_1.type === "initialized") {
346
- for (var _b = 0, _c = status_1.value.getInventory(); _b < _c.length; _b++) {
347
- var segment = _c[_b];
348
- var representation = segment.infos.representation;
349
- if (representation.decipherable === false) {
350
- log.warn("Init: we have undecipherable segments left in the buffer, reloading");
351
- this._currentFreezeTimestamp = null;
352
- this.trigger("needsReload", null);
353
- return true;
354
- }
355
- else if (representation.contentProtections !== undefined) {
356
- isClear = false;
357
- if (representation.decipherable !== true) {
358
- hasOnlyDecipherableSegments = false;
359
- }
360
- }
361
- }
362
- }
363
- }
364
- if (!isClear && hasOnlyDecipherableSegments) {
365
- log.warn("Init: we are frozen despite only having decipherable " +
366
- "segments left in the buffer, reloading");
367
- this._currentFreezeTimestamp = null;
368
- this.trigger("needsReload", null);
369
- return true;
370
- }
371
- }
372
- return false;
373
- };
374
294
  return RebufferingController;
375
295
  }(EventEmitter));
376
296
  export default RebufferingController;
@@ -224,7 +224,14 @@ var AudioVideoSegmentBuffer = /** @class */ (function (_super) {
224
224
  err :
225
225
  new Error("An unknown error occured when doing operations " +
226
226
  "on the SourceBuffer");
227
- this._pendingTask.reject(error);
227
+ var task = this._pendingTask;
228
+ if (task.type === SegmentBufferOperation.Push &&
229
+ task.data.length === 0 &&
230
+ task.inventoryData !== null) {
231
+ this._segmentInventory.insertChunk(task.inventoryData, false);
232
+ }
233
+ this._pendingTask = null;
234
+ task.reject(error);
228
235
  }
229
236
  };
230
237
  /**
@@ -272,7 +279,7 @@ var AudioVideoSegmentBuffer = /** @class */ (function (_super) {
272
279
  switch (task.type) {
273
280
  case SegmentBufferOperation.Push:
274
281
  if (task.inventoryData !== null) {
275
- this._segmentInventory.insertChunk(task.inventoryData);
282
+ this._segmentInventory.insertChunk(task.inventoryData, true);
276
283
  }
277
284
  break;
278
285
  case SegmentBufferOperation.EndOfSegment:
@@ -80,7 +80,7 @@ var ImageSegmentBuffer = /** @class */ (function (_super) {
80
80
  try {
81
81
  this._buffered.insert(startTime, endTime);
82
82
  if (infos.inventoryInfos !== null) {
83
- this._segmentInventory.insertChunk(infos.inventoryInfos);
83
+ this._segmentInventory.insertChunk(infos.inventoryInfos, true);
84
84
  }
85
85
  }
86
86
  catch (err) {