rx-player 3.29.0 → 3.30.0-dev.2023011800

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 (439) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/VERSION +1 -1
  3. package/dist/_esm5.processed/compat/can_reuse_media_keys.d.ts +3 -2
  4. package/dist/_esm5.processed/compat/can_reuse_media_keys.js +5 -4
  5. package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.js +16 -7
  6. package/dist/_esm5.processed/compat/event_listeners.d.ts +33 -56
  7. package/dist/_esm5.processed/compat/event_listeners.js +66 -116
  8. package/dist/_esm5.processed/compat/index.d.ts +1 -4
  9. package/dist/_esm5.processed/compat/index.js +1 -4
  10. package/dist/_esm5.processed/compat/on_height_width_change.d.ts +1 -1
  11. package/dist/_esm5.processed/compat/on_height_width_change.js +2 -2
  12. package/dist/_esm5.processed/config.d.ts +1 -0
  13. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +3 -1
  14. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +27 -6
  15. package/dist/_esm5.processed/core/api/playback_observer.d.ts +8 -9
  16. package/dist/_esm5.processed/core/api/playback_observer.js +6 -7
  17. package/dist/_esm5.processed/core/api/public_api.d.ts +39 -41
  18. package/dist/_esm5.processed/core/api/public_api.js +569 -578
  19. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.d.ts +9 -14
  20. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +73 -43
  21. package/dist/_esm5.processed/core/api/utils.d.ts +15 -10
  22. package/dist/_esm5.processed/core/api/utils.js +84 -19
  23. package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.d.ts +22 -5
  24. package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.js +97 -25
  25. package/dist/_esm5.processed/core/decrypt/attach_media_keys.d.ts +3 -2
  26. package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +3 -2
  27. package/dist/_esm5.processed/core/decrypt/clear_on_stop.d.ts +1 -1
  28. package/dist/_esm5.processed/core/decrypt/clear_on_stop.js +1 -1
  29. package/dist/_esm5.processed/core/decrypt/content_decryptor.js +12 -20
  30. package/dist/_esm5.processed/core/decrypt/create_session.js +1 -1
  31. package/dist/_esm5.processed/core/decrypt/find_key_system.js +35 -13
  32. package/dist/_esm5.processed/core/decrypt/get_media_keys.js +1 -1
  33. package/dist/_esm5.processed/core/decrypt/session_events_listener.d.ts +32 -31
  34. package/dist/_esm5.processed/core/decrypt/session_events_listener.js +291 -160
  35. package/dist/_esm5.processed/core/decrypt/set_server_certificate.d.ts +1 -1
  36. package/dist/_esm5.processed/core/decrypt/set_server_certificate.js +1 -1
  37. package/dist/_esm5.processed/core/decrypt/types.d.ts +0 -6
  38. package/dist/_esm5.processed/core/decrypt/utils/clean_old_loaded_sessions.d.ts +1 -1
  39. package/dist/_esm5.processed/core/decrypt/utils/clean_old_loaded_sessions.js +1 -1
  40. package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.js +1 -1
  41. package/dist/_esm5.processed/core/fetchers/index.d.ts +2 -2
  42. package/dist/_esm5.processed/core/fetchers/manifest/index.d.ts +2 -2
  43. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +153 -89
  44. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +419 -144
  45. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.d.ts +0 -24
  46. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +0 -24
  47. package/dist/_esm5.processed/core/init/{initialize_directfile.d.ts → directfile_content_initializer.d.ts} +13 -16
  48. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +196 -0
  49. package/dist/_esm5.processed/core/init/index.d.ts +2 -2
  50. package/dist/_esm5.processed/core/init/index.js +2 -2
  51. package/dist/_esm5.processed/core/init/media_source_content_initializer.d.ts +181 -0
  52. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +576 -0
  53. package/dist/_esm5.processed/core/init/types.d.ts +203 -64
  54. package/dist/_esm5.processed/core/init/types.js +36 -1
  55. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.d.ts +164 -0
  56. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.js +484 -0
  57. package/dist/_esm5.processed/core/init/{create_media_source.d.ts → utils/create_media_source.d.ts} +8 -4
  58. package/dist/_esm5.processed/core/init/utils/create_media_source.js +118 -0
  59. package/dist/_esm5.processed/core/init/{create_stream_playback_observer.d.ts → utils/create_stream_playback_observer.d.ts} +4 -4
  60. package/dist/_esm5.processed/core/init/{create_stream_playback_observer.js → utils/create_stream_playback_observer.js} +2 -5
  61. package/dist/_esm5.processed/core/init/{end_of_stream.d.ts → utils/end_of_stream.d.ts} +5 -5
  62. package/dist/_esm5.processed/core/init/utils/end_of_stream.js +85 -0
  63. package/dist/_esm5.processed/core/init/{get_initial_time.d.ts → utils/get_initial_time.d.ts} +1 -1
  64. package/dist/_esm5.processed/core/init/{get_initial_time.js → utils/get_initial_time.js} +3 -3
  65. package/dist/_esm5.processed/core/init/{emit_loaded_event.d.ts → utils/get_loaded_reference.d.ts} +9 -9
  66. package/dist/_esm5.processed/core/init/{emit_loaded_event.js → utils/get_loaded_reference.js} +23 -17
  67. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.d.ts +63 -0
  68. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +124 -0
  69. package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.d.ts +80 -0
  70. package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.js +111 -0
  71. package/dist/_esm5.processed/core/init/{media_duration_updater.d.ts → utils/media_duration_updater.d.ts} +3 -3
  72. package/dist/_esm5.processed/core/init/{media_duration_updater.js → utils/media_duration_updater.js} +115 -41
  73. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +113 -0
  74. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +483 -0
  75. package/dist/_esm5.processed/core/init/{stream_events_emitter → utils/stream_events_emitter}/are_same_stream_events.d.ts +0 -0
  76. package/dist/_esm5.processed/core/init/{stream_events_emitter → utils/stream_events_emitter}/are_same_stream_events.js +0 -0
  77. package/dist/_esm5.processed/core/{stream/types.js → init/utils/stream_events_emitter/index.d.ts} +3 -1
  78. package/dist/_esm5.processed/core/init/{stream_events_emitter → utils/stream_events_emitter}/index.js +0 -0
  79. package/dist/_esm5.processed/core/init/{stream_events_emitter → utils/stream_events_emitter}/refresh_scheduled_events_list.d.ts +1 -1
  80. package/dist/_esm5.processed/core/init/{stream_events_emitter → utils/stream_events_emitter}/refresh_scheduled_events_list.js +0 -0
  81. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.d.ts +30 -0
  82. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.js +155 -0
  83. package/dist/_esm5.processed/core/init/{stream_events_emitter → utils/stream_events_emitter}/types.d.ts +1 -13
  84. package/dist/_esm5.processed/core/init/{stream_events_emitter → utils/stream_events_emitter}/types.js +0 -0
  85. package/dist/_esm5.processed/core/init/{throw_on_media_error.d.ts → utils/throw_on_media_error.d.ts} +5 -5
  86. package/dist/_esm5.processed/core/init/{throw_on_media_error.js → utils/throw_on_media_error.js} +19 -15
  87. package/dist/_esm5.processed/core/segment_buffers/garbage_collector.d.ts +0 -1
  88. package/dist/_esm5.processed/core/segment_buffers/garbage_collector.js +0 -1
  89. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +0 -5
  90. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +0 -5
  91. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.d.ts +3 -3
  92. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +3 -3
  93. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +1 -1
  94. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  95. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +25 -130
  96. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +188 -117
  97. package/dist/_esm5.processed/core/stream/adaptation/index.d.ts +2 -2
  98. package/dist/_esm5.processed/core/stream/adaptation/index.js +1 -0
  99. package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +172 -0
  100. package/dist/_esm5.processed/core/stream/adaptation/types.js +1 -0
  101. package/dist/_esm5.processed/core/stream/adaptation/{create_representation_estimator.d.ts → utils/create_representation_estimator.d.ts} +6 -6
  102. package/dist/_esm5.processed/core/stream/adaptation/{create_representation_estimator.js → utils/create_representation_estimator.js} +3 -4
  103. package/dist/_esm5.processed/core/stream/index.d.ts +4 -3
  104. package/dist/_esm5.processed/core/stream/index.js +0 -1
  105. package/dist/_esm5.processed/core/stream/orchestrator/index.d.ts +2 -2
  106. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +142 -17
  107. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +303 -229
  108. package/dist/_esm5.processed/core/stream/period/index.d.ts +2 -3
  109. package/dist/_esm5.processed/core/stream/period/index.js +1 -0
  110. package/dist/_esm5.processed/core/stream/period/period_stream.d.ts +27 -62
  111. package/dist/_esm5.processed/core/stream/period/period_stream.js +278 -105
  112. package/dist/_esm5.processed/core/stream/period/types.d.ts +110 -0
  113. package/dist/_esm5.processed/core/stream/period/types.js +1 -0
  114. package/dist/_esm5.processed/core/stream/period/{get_adaptation_switch_strategy.d.ts → utils/get_adaptation_switch_strategy.d.ts} +3 -3
  115. package/dist/_esm5.processed/core/stream/period/{get_adaptation_switch_strategy.js → utils/get_adaptation_switch_strategy.js} +3 -3
  116. package/dist/_esm5.processed/core/stream/representation/index.d.ts +2 -2
  117. package/dist/_esm5.processed/core/stream/representation/index.js +1 -0
  118. package/dist/_esm5.processed/core/stream/representation/representation_stream.d.ts +32 -121
  119. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +210 -136
  120. package/dist/_esm5.processed/core/stream/representation/types.d.ts +267 -0
  121. package/dist/_esm5.processed/core/stream/representation/types.js +1 -0
  122. package/dist/_esm5.processed/core/stream/representation/{append_segment_to_buffer.d.ts → utils/append_segment_to_buffer.d.ts} +5 -5
  123. package/dist/_esm5.processed/core/stream/representation/{append_segment_to_buffer.js → utils/append_segment_to_buffer.js} +8 -3
  124. package/dist/_esm5.processed/core/stream/representation/{check_for_discontinuity.d.ts → utils/check_for_discontinuity.d.ts} +2 -2
  125. package/dist/_esm5.processed/core/stream/representation/{check_for_discontinuity.js → utils/check_for_discontinuity.js} +1 -1
  126. package/dist/_esm5.processed/core/stream/representation/{downloading_queue.d.ts → utils/downloading_queue.d.ts} +85 -80
  127. package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.js +378 -0
  128. package/dist/_esm5.processed/core/stream/representation/{force_garbage_collection.d.ts → utils/force_garbage_collection.d.ts} +2 -2
  129. package/dist/_esm5.processed/core/stream/representation/{force_garbage_collection.js → utils/force_garbage_collection.js} +3 -3
  130. package/dist/_esm5.processed/core/stream/representation/{get_buffer_status.d.ts → utils/get_buffer_status.d.ts} +3 -3
  131. package/dist/_esm5.processed/core/stream/representation/{get_buffer_status.js → utils/get_buffer_status.js} +3 -3
  132. package/dist/_esm5.processed/core/stream/representation/{get_needed_segments.d.ts → utils/get_needed_segments.d.ts} +3 -3
  133. package/dist/_esm5.processed/core/stream/representation/{get_needed_segments.js → utils/get_needed_segments.js} +4 -5
  134. package/dist/_esm5.processed/core/stream/representation/{get_segment_priority.d.ts → utils/get_segment_priority.d.ts} +0 -0
  135. package/dist/_esm5.processed/core/stream/representation/{get_segment_priority.js → utils/get_segment_priority.js} +1 -1
  136. package/dist/_esm5.processed/core/stream/representation/{push_init_segment.d.ts → utils/push_init_segment.d.ts} +9 -12
  137. package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.js +85 -0
  138. package/dist/_esm5.processed/core/stream/representation/{push_media_segment.d.ts → utils/push_media_segment.d.ts} +9 -12
  139. package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.js +109 -0
  140. package/dist/_esm5.processed/default_config.d.ts +10 -0
  141. package/dist/_esm5.processed/default_config.js +12 -1
  142. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +1 -1
  143. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.d.ts +1 -1
  144. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.js +1 -1
  145. package/dist/_esm5.processed/experimental/tools/createMetaplaylist/get_duration_from_manifest.d.ts +2 -3
  146. package/dist/_esm5.processed/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +107 -59
  147. package/dist/_esm5.processed/experimental/tools/createMetaplaylist/index.js +6 -7
  148. package/dist/_esm5.processed/features/initialize_features.js +1 -1
  149. package/dist/_esm5.processed/features/list/directfile.js +1 -1
  150. package/dist/_esm5.processed/features/types.d.ts +2 -3
  151. package/dist/_esm5.processed/manifest/adaptation.d.ts +7 -0
  152. package/dist/_esm5.processed/manifest/adaptation.js +3 -0
  153. package/dist/_esm5.processed/manifest/manifest.d.ts +2 -1
  154. package/dist/_esm5.processed/manifest/manifest.js +4 -3
  155. package/dist/_esm5.processed/manifest/update_period_in_place.d.ts +26 -1
  156. package/dist/_esm5.processed/manifest/update_period_in_place.js +58 -7
  157. package/dist/_esm5.processed/manifest/update_periods.d.ts +19 -2
  158. package/dist/_esm5.processed/manifest/update_periods.js +62 -18
  159. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +3 -0
  160. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +1 -0
  161. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +1 -0
  162. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +7 -1
  163. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +16 -0
  164. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +63 -25
  165. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +3 -0
  166. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +60 -6
  167. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +39 -13
  168. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +7 -3
  169. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentBase.js +5 -0
  170. package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +3 -0
  171. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts +0 -1
  172. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +0 -1
  173. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentBase.js +5 -0
  174. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentTemplate.js +6 -0
  175. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
  176. package/dist/_esm5.processed/parsers/manifest/types.d.ts +13 -2
  177. package/dist/_esm5.processed/parsers/texttracks/ttml/html/create_element.js +7 -0
  178. package/dist/_esm5.processed/public_types.d.ts +2 -0
  179. package/dist/_esm5.processed/transports/dash/manifest_parser.js +2 -2
  180. package/dist/_esm5.processed/transports/dash/segment_loader.js +1 -1
  181. package/dist/_esm5.processed/transports/dash/text_parser.js +3 -3
  182. package/dist/_esm5.processed/transports/local/segment_loader.js +1 -1
  183. package/dist/_esm5.processed/utils/event_emitter.d.ts +3 -13
  184. package/dist/_esm5.processed/utils/event_emitter.js +0 -19
  185. package/dist/_esm5.processed/utils/reference.d.ts +46 -67
  186. package/dist/_esm5.processed/utils/reference.js +63 -93
  187. package/dist/_esm5.processed/utils/request/xhr.d.ts +3 -68
  188. package/dist/_esm5.processed/utils/{rx-retry_with_backoff.d.ts → retry_promise_with_backoff.d.ts} +19 -34
  189. package/dist/_esm5.processed/utils/retry_promise_with_backoff.js +119 -0
  190. package/dist/_esm5.processed/utils/sleep.d.ts +10 -0
  191. package/dist/_esm5.processed/utils/sleep.js +14 -0
  192. package/dist/_esm5.processed/utils/sorted_list.d.ts +1 -0
  193. package/dist/_esm5.processed/utils/sorted_list.js +3 -0
  194. package/dist/mpd-parser.wasm +0 -0
  195. package/dist/rx-player.js +8116 -11600
  196. package/dist/rx-player.min.js +1 -1
  197. package/dist/rx-player.min.js.LICENSE.txt +0 -15
  198. package/manifest.mpd +149 -0
  199. package/package.json +26 -26
  200. package/scripts/build/generate_build.js +1 -8
  201. package/sonar-project.properties +1 -1
  202. package/src/README.md +2 -2
  203. package/src/compat/__tests__/can_reuse_media_keys.test.ts +4 -27
  204. package/src/compat/can_reuse_media_keys.ts +5 -7
  205. package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +14 -15
  206. package/src/compat/event_listeners.ts +84 -148
  207. package/src/compat/index.ts +0 -6
  208. package/src/compat/on_height_width_change.ts +2 -2
  209. package/src/core/README.md +1 -1
  210. package/src/core/adaptive/adaptive_representation_selector.ts +36 -7
  211. package/src/core/api/README.md +0 -33
  212. package/src/core/api/playback_observer.ts +20 -11
  213. package/src/core/api/public_api.ts +826 -815
  214. package/src/core/api/tracks_management/track_choice_manager.ts +97 -57
  215. package/src/core/api/utils.ts +112 -42
  216. package/src/core/decrypt/__tests__/__global__/get_license.test.ts +42 -38
  217. package/src/core/decrypt/__tests__/__global__/init_data.test.ts +15 -20
  218. package/src/core/decrypt/__tests__/__global__/media_key_system_access.test.ts +35 -47
  219. package/src/core/decrypt/__tests__/__global__/utils.ts +116 -17
  220. package/src/core/decrypt/attach_media_keys.ts +3 -2
  221. package/src/core/decrypt/clear_on_stop.ts +1 -1
  222. package/src/core/decrypt/content_decryptor.ts +19 -27
  223. package/src/core/decrypt/create_session.ts +1 -1
  224. package/src/core/decrypt/find_key_system.ts +31 -11
  225. package/src/core/decrypt/get_media_keys.ts +1 -1
  226. package/src/core/decrypt/session_events_listener.ts +259 -277
  227. package/src/core/decrypt/set_server_certificate.ts +1 -1
  228. package/src/core/decrypt/types.ts +0 -5
  229. package/src/core/decrypt/utils/clean_old_loaded_sessions.ts +1 -1
  230. package/src/core/decrypt/utils/loaded_sessions_store.ts +1 -1
  231. package/src/core/fetchers/README.md +3 -0
  232. package/src/core/fetchers/index.ts +6 -6
  233. package/src/core/fetchers/manifest/index.ts +7 -7
  234. package/src/core/fetchers/manifest/manifest_fetcher.ts +646 -295
  235. package/src/core/fetchers/segment/segment_fetcher_creator.ts +0 -24
  236. package/src/core/init/README.md +31 -45
  237. package/src/core/init/directfile_content_initializer.ts +229 -0
  238. package/src/core/init/index.ts +3 -3
  239. package/src/core/init/media_source_content_initializer.ts +819 -0
  240. package/src/core/init/types.ts +220 -132
  241. package/src/core/init/{__tests__ → utils/__tests__}/are_same_stream_events.test.ts +0 -0
  242. package/src/core/init/{__tests__ → utils/__tests__}/refresh_scheduled_events_list.test.ts +0 -0
  243. package/src/core/init/utils/content_time_boundaries_observer.ts +609 -0
  244. package/src/core/init/{create_media_source.ts → utils/create_media_source.ts} +60 -55
  245. package/src/core/init/{create_stream_playback_observer.ts → utils/create_stream_playback_observer.ts} +7 -11
  246. package/src/core/init/utils/end_of_stream.ts +104 -0
  247. package/src/core/init/{get_initial_time.ts → utils/get_initial_time.ts} +4 -4
  248. package/src/core/init/utils/get_loaded_reference.ts +76 -0
  249. package/src/core/init/utils/initial_seek_and_play.ts +179 -0
  250. package/src/core/init/utils/initialize_content_decryption.ts +178 -0
  251. package/src/core/init/{media_duration_updater.ts → utils/media_duration_updater.ts} +166 -84
  252. package/src/core/init/{rebuffering_controller.ts → utils/rebuffering_controller.ts} +247 -226
  253. package/src/core/init/{stream_events_emitter → utils/stream_events_emitter}/are_same_stream_events.ts +0 -0
  254. package/src/core/init/{stream_events_emitter → utils/stream_events_emitter}/index.ts +1 -13
  255. package/src/core/init/{stream_events_emitter → utils/stream_events_emitter}/refresh_scheduled_events_list.ts +1 -1
  256. package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +210 -0
  257. package/src/core/init/{stream_events_emitter → utils/stream_events_emitter}/types.ts +1 -19
  258. package/src/core/init/utils/throw_on_media_error.ts +74 -0
  259. package/src/core/segment_buffers/README.md +5 -4
  260. package/src/core/segment_buffers/garbage_collector.ts +0 -1
  261. package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +2 -8
  262. package/src/core/segment_buffers/implementations/image/image_segment_buffer.ts +3 -3
  263. package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +1 -1
  264. package/src/core/stream/README.md +1 -1
  265. package/src/core/stream/adaptation/adaptation_stream.ts +265 -330
  266. package/src/core/stream/adaptation/index.ts +2 -12
  267. package/src/core/stream/adaptation/types.ts +193 -0
  268. package/src/core/stream/adaptation/{create_representation_estimator.ts → utils/create_representation_estimator.ts} +10 -9
  269. package/src/core/stream/index.ts +9 -1
  270. package/src/core/stream/orchestrator/README.md +1 -4
  271. package/src/core/stream/orchestrator/index.ts +2 -0
  272. package/src/core/stream/orchestrator/stream_orchestrator.ts +423 -326
  273. package/src/core/stream/period/index.ts +2 -12
  274. package/src/core/stream/period/period_stream.ts +301 -238
  275. package/src/core/stream/period/types.ts +132 -0
  276. package/src/core/stream/period/{get_adaptation_switch_strategy.ts → utils/get_adaptation_switch_strategy.ts} +6 -6
  277. package/src/core/stream/representation/README.md +2 -23
  278. package/src/core/stream/representation/index.ts +2 -12
  279. package/src/core/stream/representation/representation_stream.ts +315 -415
  280. package/src/core/stream/representation/types.ts +292 -0
  281. package/src/core/stream/representation/{append_segment_to_buffer.ts → utils/append_segment_to_buffer.ts} +11 -7
  282. package/src/core/stream/representation/{check_for_discontinuity.ts → utils/check_for_discontinuity.ts} +3 -3
  283. package/src/core/stream/representation/utils/downloading_queue.ts +592 -0
  284. package/src/core/stream/representation/{force_garbage_collection.ts → utils/force_garbage_collection.ts} +5 -6
  285. package/src/core/stream/representation/{get_buffer_status.ts → utils/get_buffer_status.ts} +5 -5
  286. package/src/core/stream/representation/{get_needed_segments.ts → utils/get_needed_segments.ts} +6 -7
  287. package/src/core/stream/representation/{get_segment_priority.ts → utils/get_segment_priority.ts} +1 -2
  288. package/src/core/stream/representation/utils/push_init_segment.ts +80 -0
  289. package/src/core/stream/representation/utils/push_media_segment.ts +113 -0
  290. package/src/default_config.ts +13 -1
  291. package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +1 -1
  292. package/src/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.ts +1 -1
  293. package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +58 -66
  294. package/src/experimental/tools/createMetaplaylist/index.ts +29 -38
  295. package/src/features/__tests__/initialize_features.test.ts +1 -1
  296. package/src/features/initialize_features.ts +2 -1
  297. package/src/features/list/__tests__/directfile.test.ts +3 -2
  298. package/src/features/list/directfile.ts +1 -1
  299. package/src/features/types.ts +2 -7
  300. package/src/manifest/__tests__/manifest.test.ts +14 -365
  301. package/src/manifest/__tests__/update_period_in_place.test.ts +522 -57
  302. package/src/manifest/__tests__/update_periods.test.ts +254 -40
  303. package/src/manifest/adaptation.ts +11 -0
  304. package/src/manifest/manifest.ts +6 -4
  305. package/src/manifest/update_period_in_place.ts +84 -14
  306. package/src/manifest/update_periods.ts +93 -33
  307. package/src/parsers/manifest/dash/common/indexes/base.ts +4 -0
  308. package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +8 -1
  309. package/src/parsers/manifest/dash/common/indexes/template.ts +76 -25
  310. package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +61 -3
  311. package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +46 -15
  312. package/src/parsers/manifest/dash/common/parse_representations.ts +7 -3
  313. package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentBase.ts +6 -0
  314. package/src/parsers/manifest/dash/node_parser_types.ts +3 -0
  315. package/src/parsers/manifest/dash/wasm-parser/rs/events.rs +3 -0
  316. package/src/parsers/manifest/dash/wasm-parser/rs/processor/attributes.rs +4 -0
  317. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -1
  318. package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentBase.ts +6 -0
  319. package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentTemplate.ts +7 -0
  320. package/src/parsers/manifest/dash/wasm-parser/ts/types.ts +3 -0
  321. package/src/parsers/manifest/types.ts +13 -2
  322. package/src/parsers/texttracks/ttml/html/create_element.ts +8 -0
  323. package/src/public_types.ts +2 -0
  324. package/src/transports/README.md +15 -54
  325. package/src/transports/dash/manifest_parser.ts +2 -2
  326. package/src/transports/dash/segment_loader.ts +1 -1
  327. package/src/transports/dash/text_parser.ts +3 -3
  328. package/src/transports/local/segment_loader.ts +1 -1
  329. package/src/utils/__tests__/event_emitter.test.ts +1 -76
  330. package/src/utils/event_emitter.ts +6 -30
  331. package/src/utils/reference.ts +112 -169
  332. package/src/utils/request/xhr.ts +3 -68
  333. package/src/utils/retry_promise_with_backoff.ts +95 -0
  334. package/src/utils/sleep.ts +14 -0
  335. package/src/utils/sorted_list.ts +4 -0
  336. package/dist/_esm5.processed/compat/play.d.ts +0 -23
  337. package/dist/_esm5.processed/compat/play.js +0 -32
  338. package/dist/_esm5.processed/compat/set_element_src.d.ts +0 -26
  339. package/dist/_esm5.processed/compat/set_element_src.js +0 -37
  340. package/dist/_esm5.processed/compat/when_loaded_metadata.d.ts +0 -23
  341. package/dist/_esm5.processed/compat/when_loaded_metadata.js +0 -33
  342. package/dist/_esm5.processed/core/init/content_time_boundaries_observer.d.ts +0 -45
  343. package/dist/_esm5.processed/core/init/content_time_boundaries_observer.js +0 -295
  344. package/dist/_esm5.processed/core/init/create_media_source.js +0 -107
  345. package/dist/_esm5.processed/core/init/end_of_stream.js +0 -74
  346. package/dist/_esm5.processed/core/init/events_generators.d.ts +0 -88
  347. package/dist/_esm5.processed/core/init/events_generators.js +0 -87
  348. package/dist/_esm5.processed/core/init/initial_seek_and_play.d.ts +0 -81
  349. package/dist/_esm5.processed/core/init/initial_seek_and_play.js +0 -114
  350. package/dist/_esm5.processed/core/init/initialize_directfile.js +0 -120
  351. package/dist/_esm5.processed/core/init/initialize_media_source.d.ts +0 -122
  352. package/dist/_esm5.processed/core/init/initialize_media_source.js +0 -201
  353. package/dist/_esm5.processed/core/init/link_drm_and_content.d.ts +0 -62
  354. package/dist/_esm5.processed/core/init/link_drm_and_content.js +0 -94
  355. package/dist/_esm5.processed/core/init/load_on_media_source.d.ts +0 -46
  356. package/dist/_esm5.processed/core/init/load_on_media_source.js +0 -122
  357. package/dist/_esm5.processed/core/init/manifest_update_scheduler.d.ts +0 -65
  358. package/dist/_esm5.processed/core/init/manifest_update_scheduler.js +0 -233
  359. package/dist/_esm5.processed/core/init/rebuffering_controller.d.ts +0 -81
  360. package/dist/_esm5.processed/core/init/rebuffering_controller.js +0 -439
  361. package/dist/_esm5.processed/core/init/stream_events_emitter/index.d.ts +0 -19
  362. package/dist/_esm5.processed/core/init/stream_events_emitter/stream_events_emitter.d.ts +0 -27
  363. package/dist/_esm5.processed/core/init/stream_events_emitter/stream_events_emitter.js +0 -126
  364. package/dist/_esm5.processed/core/init/update_playback_rate.d.ts +0 -0
  365. package/dist/_esm5.processed/core/init/update_playback_rate.js +0 -1
  366. package/dist/_esm5.processed/core/stream/events_generators.d.ts +0 -67
  367. package/dist/_esm5.processed/core/stream/events_generators.js +0 -112
  368. package/dist/_esm5.processed/core/stream/orchestrator/active_period_emitter.d.ts +0 -53
  369. package/dist/_esm5.processed/core/stream/orchestrator/active_period_emitter.js +0 -124
  370. package/dist/_esm5.processed/core/stream/orchestrator/are_streams_complete.d.ts +0 -35
  371. package/dist/_esm5.processed/core/stream/orchestrator/are_streams_complete.js +0 -53
  372. package/dist/_esm5.processed/core/stream/period/create_empty_adaptation_stream.d.ts +0 -36
  373. package/dist/_esm5.processed/core/stream/period/create_empty_adaptation_stream.js +0 -46
  374. package/dist/_esm5.processed/core/stream/reload_after_switch.d.ts +0 -47
  375. package/dist/_esm5.processed/core/stream/reload_after_switch.js +0 -56
  376. package/dist/_esm5.processed/core/stream/representation/downloading_queue.js +0 -371
  377. package/dist/_esm5.processed/core/stream/representation/push_init_segment.js +0 -49
  378. package/dist/_esm5.processed/core/stream/representation/push_media_segment.js +0 -76
  379. package/dist/_esm5.processed/core/stream/types.d.ts +0 -437
  380. package/dist/_esm5.processed/utils/cast_to_observable.d.ts +0 -24
  381. package/dist/_esm5.processed/utils/cast_to_observable.js +0 -35
  382. package/dist/_esm5.processed/utils/concat_map_latest.d.ts +0 -23
  383. package/dist/_esm5.processed/utils/concat_map_latest.js +0 -48
  384. package/dist/_esm5.processed/utils/defer_subscriptions.d.ts +0 -79
  385. package/dist/_esm5.processed/utils/defer_subscriptions.js +0 -89
  386. package/dist/_esm5.processed/utils/filter_map.d.ts +0 -28
  387. package/dist/_esm5.processed/utils/filter_map.js +0 -32
  388. package/dist/_esm5.processed/utils/rx-from_cancellable_promise.d.ts +0 -39
  389. package/dist/_esm5.processed/utils/rx-from_cancellable_promise.js +0 -63
  390. package/dist/_esm5.processed/utils/rx-next-tick.d.ts +0 -27
  391. package/dist/_esm5.processed/utils/rx-next-tick.js +0 -41
  392. package/dist/_esm5.processed/utils/rx-retry_with_backoff.js +0 -70
  393. package/dist/_esm5.processed/utils/rx-throttle.d.ts +0 -40
  394. package/dist/_esm5.processed/utils/rx-throttle.js +0 -47
  395. package/dist/_esm5.processed/utils/rx-try_catch.d.ts +0 -23
  396. package/dist/_esm5.processed/utils/rx-try_catch.js +0 -30
  397. package/src/compat/__tests__/play.test.ts +0 -73
  398. package/src/compat/__tests__/set_element_src.test.ts +0 -71
  399. package/src/compat/__tests__/when_loaded_metadata.test.ts +0 -109
  400. package/src/compat/play.ts +0 -37
  401. package/src/compat/set_element_src.ts +0 -47
  402. package/src/compat/when_loaded_metadata.ts +0 -40
  403. package/src/core/init/content_time_boundaries_observer.ts +0 -382
  404. package/src/core/init/emit_loaded_event.ts +0 -71
  405. package/src/core/init/end_of_stream.ts +0 -104
  406. package/src/core/init/events_generators.ts +0 -140
  407. package/src/core/init/initial_seek_and_play.ts +0 -208
  408. package/src/core/init/initialize_directfile.ts +0 -191
  409. package/src/core/init/initialize_media_source.ts +0 -389
  410. package/src/core/init/link_drm_and_content.ts +0 -176
  411. package/src/core/init/load_on_media_source.ts +0 -237
  412. package/src/core/init/manifest_update_scheduler.ts +0 -362
  413. package/src/core/init/stream_events_emitter/stream_events_emitter.ts +0 -182
  414. package/src/core/init/throw_on_media_error.ts +0 -68
  415. package/src/core/init/update_playback_rate.ts +0 -0
  416. package/src/core/stream/events_generators.ts +0 -217
  417. package/src/core/stream/orchestrator/active_period_emitter.ts +0 -146
  418. package/src/core/stream/orchestrator/are_streams_complete.ts +0 -70
  419. package/src/core/stream/period/create_empty_adaptation_stream.ts +0 -70
  420. package/src/core/stream/reload_after_switch.ts +0 -76
  421. package/src/core/stream/representation/downloading_queue.ts +0 -632
  422. package/src/core/stream/representation/push_init_segment.ts +0 -87
  423. package/src/core/stream/representation/push_media_segment.ts +0 -125
  424. package/src/core/stream/types.ts +0 -558
  425. package/src/utils/__tests__/cast_to_observable.test.ts +0 -93
  426. package/src/utils/__tests__/concat_map_latest.test.ts +0 -221
  427. package/src/utils/__tests__/defer_subscriptions.test.ts +0 -50
  428. package/src/utils/__tests__/filter_map.test.ts +0 -87
  429. package/src/utils/__tests__/rx-throttle.test.ts +0 -252
  430. package/src/utils/__tests__/rx-try_catch.test.ts +0 -100
  431. package/src/utils/cast_to_observable.ts +0 -48
  432. package/src/utils/concat_map_latest.ts +0 -61
  433. package/src/utils/defer_subscriptions.ts +0 -96
  434. package/src/utils/filter_map.ts +0 -43
  435. package/src/utils/rx-from_cancellable_promise.ts +0 -71
  436. package/src/utils/rx-next-tick.ts +0 -43
  437. package/src/utils/rx-retry_with_backoff.ts +0 -101
  438. package/src/utils/rx-throttle.ts +0 -84
  439. package/src/utils/rx-try_catch.ts +0 -37
@@ -1,16 +1 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
-
16
1
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
package/manifest.mpd ADDED
@@ -0,0 +1,149 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <MPD profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" availabilityStartTime="2022-10-26T02:33:26Z" minimumUpdatePeriod="PT2.0S" minBufferTime="PT2.0S" publishTime="2022-12-02T14:29:12.527Z" timeShiftBufferDepth="PT5M" suggestedPresentationDelay="PT2.0S" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:mspr="urn:microsoft:playready" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd">
3
+ <Period start="PT0S" id="1">
4
+ <AdaptationSet mimeType="video/mp4" startWithSAP="1" segmentAlignment="true" par="16:9">
5
+ <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc"></ContentProtection>
6
+ <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95"><mspr:pro xmlns:mspr="urn:microsoft:playready">VAMAAAEAAQBKAzwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4ARgAyAEsAcwBzAGgARgA2AGMAawBDAFEAYwBpAE0AQwA0AGUATwBqAEwAQQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgBEAGsARQBYAHQAYwBsAFMAWABrAFUAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBsAGkAYwBlAG4AcwBlAC4AYwB1AGIAbwB2AGkAcwBpAG8AbgAuAGkAdAAvAEwAaQBjAGUAbgBzAGUALwByAGkAZwBoAHQAcwBtAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA8AC8ATABBAF8AVQBSAEwAPgA8AEwAVQBJAF8AVQBSAEwAPgBoAHQAdABwADoALwAvAGMAbwBuAHQAbwBzAG8ALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8APAAvAEwAVQBJAF8AVQBSAEwAPgA8AEMAVQBTAFQATwBNAEEAVABUAFIASQBCAFUAVABFAFMAIAB4AG0AbABuAHMAPQAiACIAPgA8AC8AQwBVAFMAVABPAE0AQQBUAFQAUgBJAEIAVQBUAEUAUwA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4A</mspr:pro><cenc:pssh xmlns:cenc="urn:mpeg:cenc:2013">AAADdHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAA1RUAwAAAQABAEoDPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBGADIASwBzAHMAaABGADYAYwBrAEMAUQBjAGkATQBDADQAZQBPAGoATABBAD0APQA8AC8ASwBJAEQAPgA8AEMASABFAEMASwBTAFUATQA+AEQAawBFAFgAdABjAGwAUwBYAGsAVQA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcABzADoALwAvAGwAaQBjAGUAbgBzAGUALgBjAHUAYgBvAHYAaQBzAGkAbwBuAC4AaQB0AC8ATABpAGMAZQBuAHMAZQAvAHIAaQBnAGgAdABzAG0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwATABVAEkAXwBVAFIATAA+AGgAdAB0AHAAOgAvAC8AYwBvAG4AdABvAHMAbwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwA8AC8ATABVAEkAXwBVAFIATAA+ADwAQwBVAFMAVABPAE0AQQBUAFQAUgBJAEIAVQBUAEUAUwAgAHgAbQBsAG4AcwA9ACIAIgA+ADwALwBDAFUAUwBUAE8ATQBBAFQAVABSAEkAQgBVAFQARQBTAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=</cenc:pssh></ContentProtection>
7
+ <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"><cenc:pssh xmlns:cenc="urn:mpeg:cenc:2013">AAAAYnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEIIARIQsqxiF3oRQHKQciMC4eOjLBoAIh45MDIwMDEzMV8yMDIyMDIwMTAwMDBfTElWRUNFTkMqAkhEMgBI49yVmwY=</cenc:pssh></ContentProtection>
8
+ <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$_Segment-$Time$.m4v" initialization="$RepresentationID$_init.m4i">
9
+ <SegmentTimeline>
10
+ <S t="32394546833710" d="20000000" r="149" />
11
+ </SegmentTimeline>
12
+ </SegmentTemplate>
13
+ <Representation width="384" height="216" frameRate="25" codecs="avc1.4d400d" scanType="progressive" sar="1:1" id="1666751597836item-01item" bandwidth="350000" />
14
+ <Representation width="480" height="270" frameRate="25" codecs="avc1.4d4015" scanType="progressive" sar="1:1" id="1666751597836item-02item" bandwidth="650000" />
15
+ <Representation width="768" height="432" frameRate="25" codecs="avc1.4d401e" scanType="progressive" sar="1:1" id="1666751597836item-03item" bandwidth="1000000" />
16
+ <Representation width="768" height="432" frameRate="25" codecs="avc1.4d401e" scanType="progressive" sar="1:1" id="1666751597836item-04item" bandwidth="1700000" />
17
+ <Representation width="1280" height="720" frameRate="25" codecs="avc1.4d401f" scanType="progressive" sar="1:1" id="1666751597836item-05item" bandwidth="2800000" />
18
+ <Representation width="1280" height="720" frameRate="25" codecs="avc1.4d401f" scanType="progressive" sar="1:1" id="1666751597836item-06item" bandwidth="4000000" />
19
+ <Representation width="1920" height="1080" frameRate="25" codecs="avc1.640028" scanType="progressive" sar="1:1" id="1666751597836item-07item" bandwidth="5500000" />
20
+ <Representation width="1920" height="1080" frameRate="25" codecs="avc1.64002a" scanType="progressive" sar="1:1" id="1666751597836item-08item" bandwidth="7000000" />
21
+ </AdaptationSet>
22
+ <AdaptationSet mimeType="audio/mp4" startWithSAP="1" lang="ita" segmentAlignment="true">
23
+ <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc"></ContentProtection>
24
+ <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95"><mspr:pro xmlns:mspr="urn:microsoft:playready">VAMAAAEAAQBKAzwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4ARgAyAEsAcwBzAGgARgA2AGMAawBDAFEAYwBpAE0AQwA0AGUATwBqAEwAQQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgBEAGsARQBYAHQAYwBsAFMAWABrAFUAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBsAGkAYwBlAG4AcwBlAC4AYwB1AGIAbwB2AGkAcwBpAG8AbgAuAGkAdAAvAEwAaQBjAGUAbgBzAGUALwByAGkAZwBoAHQAcwBtAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA8AC8ATABBAF8AVQBSAEwAPgA8AEwAVQBJAF8AVQBSAEwAPgBoAHQAdABwADoALwAvAGMAbwBuAHQAbwBzAG8ALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8APAAvAEwAVQBJAF8AVQBSAEwAPgA8AEMAVQBTAFQATwBNAEEAVABUAFIASQBCAFUAVABFAFMAIAB4AG0AbABuAHMAPQAiACIAPgA8AC8AQwBVAFMAVABPAE0AQQBUAFQAUgBJAEIAVQBUAEUAUwA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4A</mspr:pro><cenc:pssh xmlns:cenc="urn:mpeg:cenc:2013">AAADdHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAA1RUAwAAAQABAEoDPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBGADIASwBzAHMAaABGADYAYwBrAEMAUQBjAGkATQBDADQAZQBPAGoATABBAD0APQA8AC8ASwBJAEQAPgA8AEMASABFAEMASwBTAFUATQA+AEQAawBFAFgAdABjAGwAUwBYAGsAVQA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcABzADoALwAvAGwAaQBjAGUAbgBzAGUALgBjAHUAYgBvAHYAaQBzAGkAbwBuAC4AaQB0AC8ATABpAGMAZQBuAHMAZQAvAHIAaQBnAGgAdABzAG0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwATABVAEkAXwBVAFIATAA+AGgAdAB0AHAAOgAvAC8AYwBvAG4AdABvAHMAbwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwA8AC8ATABVAEkAXwBVAFIATAA+ADwAQwBVAFMAVABPAE0AQQBUAFQAUgBJAEIAVQBUAEUAUwAgAHgAbQBsAG4AcwA9ACIAIgA+ADwALwBDAFUAUwBUAE8ATQBBAFQAVABSAEkAQgBVAFQARQBTAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=</cenc:pssh></ContentProtection>
25
+ <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"><cenc:pssh xmlns:cenc="urn:mpeg:cenc:2013">AAAAYnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEIIARIQsqxiF3oRQHKQciMC4eOjLBoAIh45MDIwMDEzMV8yMDIyMDIwMTAwMDBfTElWRUNFTkMqAkhEMgBI49yVmwY=</cenc:pssh></ContentProtection>
26
+ <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$_Segment-$Time$.m4a" initialization="$RepresentationID$_init.m4i">
27
+ <SegmentTimeline>
28
+ <S t="32394546887043" d="20053333" />
29
+ <S t="32394566940376" d="20053334" />
30
+ <S t="32394586993710" d="19840000" />
31
+ <S t="32394606833710" d="20053333" r="1" />
32
+ <S t="32394646940376" d="20053334" />
33
+ <S t="32394666993710" d="19840000" />
34
+ <S t="32394686833710" d="20053333" r="1" />
35
+ <S t="32394726940376" d="20053334" />
36
+ <S t="32394746993710" d="19840000" />
37
+ <S t="32394766833710" d="20053333" r="1" />
38
+ <S t="32394806940376" d="20053334" />
39
+ <S t="32394826993710" d="19840000" />
40
+ <S t="32394846833710" d="20053333" r="1" />
41
+ <S t="32394886940376" d="20053334" />
42
+ <S t="32394906993710" d="19840000" />
43
+ <S t="32394926833710" d="20053333" r="1" />
44
+ <S t="32394966940376" d="20053334" />
45
+ <S t="32394986993710" d="19840000" />
46
+ <S t="32395006833710" d="20053333" r="1" />
47
+ <S t="32395046940376" d="20053334" />
48
+ <S t="32395066993710" d="19840000" />
49
+ <S t="32395086833710" d="20053333" r="1" />
50
+ <S t="32395126940376" d="20053334" />
51
+ <S t="32395146993710" d="19840000" />
52
+ <S t="32395166833710" d="20053333" r="1" />
53
+ <S t="32395206940376" d="20053334" />
54
+ <S t="32395226993710" d="19840000" />
55
+ <S t="32395246833710" d="20053333" r="1" />
56
+ <S t="32395286940376" d="20053334" />
57
+ <S t="32395306993710" d="19840000" />
58
+ <S t="32395326833710" d="20053333" r="1" />
59
+ <S t="32395366940376" d="20053334" />
60
+ <S t="32395386993710" d="19840000" />
61
+ <S t="32395406833710" d="20053333" r="1" />
62
+ <S t="32395446940376" d="20053334" />
63
+ <S t="32395466993710" d="19840000" />
64
+ <S t="32395486833710" d="20053333" r="1" />
65
+ <S t="32395526940376" d="20053334" />
66
+ <S t="32395546993710" d="19840000" />
67
+ <S t="32395566833710" d="20053333" r="1" />
68
+ <S t="32395606940376" d="20053334" />
69
+ <S t="32395626993710" d="19840000" />
70
+ <S t="32395646833710" d="20053333" r="1" />
71
+ <S t="32395686940376" d="20053334" />
72
+ <S t="32395706993710" d="19840000" />
73
+ <S t="32395726833710" d="20053333" r="1" />
74
+ <S t="32395766940376" d="20053334" />
75
+ <S t="32395786993710" d="19840000" />
76
+ <S t="32395806833710" d="20053333" r="1" />
77
+ <S t="32395846940376" d="20053334" />
78
+ <S t="32395866993710" d="19840000" />
79
+ <S t="32395886833710" d="20053333" r="1" />
80
+ <S t="32395926940376" d="20053334" />
81
+ <S t="32395946993710" d="19840000" />
82
+ <S t="32395966833710" d="20053333" r="1" />
83
+ <S t="32396006940376" d="20053334" />
84
+ <S t="32396026993710" d="19840000" />
85
+ <S t="32396046833710" d="20053333" r="1" />
86
+ <S t="32396086940376" d="20053334" />
87
+ <S t="32396106993710" d="19840000" />
88
+ <S t="32396126833710" d="20053333" r="1" />
89
+ <S t="32396166940376" d="20053334" />
90
+ <S t="32396186993710" d="19840000" />
91
+ <S t="32396206833710" d="20053333" r="1" />
92
+ <S t="32396246940376" d="20053334" />
93
+ <S t="32396266993710" d="19840000" />
94
+ <S t="32396286833710" d="20053333" r="1" />
95
+ <S t="32396326940376" d="20053334" />
96
+ <S t="32396346993710" d="19840000" />
97
+ <S t="32396366833710" d="20053333" r="1" />
98
+ <S t="32396406940376" d="20053334" />
99
+ <S t="32396426993710" d="19840000" />
100
+ <S t="32396446833710" d="20053333" r="1" />
101
+ <S t="32396486940376" d="20053334" />
102
+ <S t="32396506993710" d="19840000" />
103
+ <S t="32396526833710" d="20053333" r="1" />
104
+ <S t="32396566940376" d="20053334" />
105
+ <S t="32396586993710" d="19840000" />
106
+ <S t="32396606833710" d="20053333" r="1" />
107
+ <S t="32396646940376" d="20053334" />
108
+ <S t="32396666993710" d="19840000" />
109
+ <S t="32396686833710" d="20053333" r="1" />
110
+ <S t="32396726940376" d="20053334" />
111
+ <S t="32396746993710" d="19840000" />
112
+ <S t="32396766833710" d="20053333" r="1" />
113
+ <S t="32396806940376" d="20053334" />
114
+ <S t="32396826993710" d="19840000" />
115
+ <S t="32396846833710" d="20053333" r="1" />
116
+ <S t="32396886940376" d="20053334" />
117
+ <S t="32396906993710" d="19840000" />
118
+ <S t="32396926833710" d="20053333" r="1" />
119
+ <S t="32396966940376" d="20053334" />
120
+ <S t="32396986993710" d="19840000" />
121
+ <S t="32397006833710" d="20053333" r="1" />
122
+ <S t="32397046940376" d="20053334" />
123
+ <S t="32397066993710" d="19840000" />
124
+ <S t="32397086833710" d="20053333" r="1" />
125
+ <S t="32397126940376" d="20053334" />
126
+ <S t="32397146993710" d="19840000" />
127
+ <S t="32397166833710" d="20053333" r="1" />
128
+ <S t="32397206940376" d="20053334" />
129
+ <S t="32397226993710" d="19840000" />
130
+ <S t="32397246833710" d="20053333" r="1" />
131
+ <S t="32397286940376" d="20053334" />
132
+ <S t="32397306993710" d="19840000" />
133
+ <S t="32397326833710" d="20053333" r="1" />
134
+ <S t="32397366940376" d="20053334" />
135
+ <S t="32397386993710" d="19840000" />
136
+ <S t="32397406833710" d="20053333" r="1" />
137
+ <S t="32397446940376" d="20053334" />
138
+ <S t="32397466993710" d="19840000" />
139
+ <S t="32397486833710" d="20053333" r="1" />
140
+ <S t="32397526940376" d="20053334" />
141
+ </SegmentTimeline>
142
+ </SegmentTemplate>
143
+ <Representation audioSamplingRate="48000" codecs="mp4a.40.2" id="1666751597836item-09item" bandwidth="96000" />
144
+ <Representation audioSamplingRate="48000" codecs="mp4a.40.2" id="1666751597836item-10item" bandwidth="128000" />
145
+ <Representation audioSamplingRate="48000" codecs="mp4a.40.2" id="1666751597836item-11item" bandwidth="192000" />
146
+ <Representation audioSamplingRate="48000" codecs="mp4a.40.2" id="1666751597836item-12item" bandwidth="256000" />
147
+ </AdaptationSet>
148
+ </Period>
149
+ </MPD>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rx-player",
3
3
  "author": "Canal+",
4
- "version": "3.29.0",
4
+ "version": "3.30.0-dev.2023011800",
5
5
  "description": "Canal+ HTML5 Video Player",
6
6
  "main": "./dist/rx-player.js",
7
7
  "keywords": [
@@ -77,35 +77,34 @@
77
77
  "url": "git://github.com/canalplus/rx-player.git"
78
78
  },
79
79
  "dependencies": {
80
- "next-tick": "1.1.0",
81
- "rxjs": "7.5.7"
80
+ "next-tick": "1.1.0"
82
81
  },
83
82
  "devDependencies": {
84
- "@babel/core": "7.20.2",
83
+ "@babel/core": "7.20.12",
85
84
  "@babel/plugin-transform-runtime": "7.19.6",
86
85
  "@babel/preset-env": "7.20.2",
87
86
  "@babel/preset-react": "7.18.6",
88
87
  "@types/chai": "4.3.4",
89
- "@types/jest": "29.2.3",
90
- "@types/mocha": "10.0.0",
91
- "@types/node": "18.11.9",
88
+ "@types/jest": "29.2.5",
89
+ "@types/mocha": "10.0.1",
90
+ "@types/node": "18.11.18",
92
91
  "@types/sinon": "10.0.13",
93
- "@typescript-eslint/eslint-plugin": "5.43.0",
94
- "@typescript-eslint/eslint-plugin-tslint": "5.43.0",
95
- "@typescript-eslint/parser": "5.43.0",
92
+ "@typescript-eslint/eslint-plugin": "5.48.2",
93
+ "@typescript-eslint/eslint-plugin-tslint": "5.48.2",
94
+ "@typescript-eslint/parser": "5.48.2",
96
95
  "arraybuffer-loader": "1.0.8",
97
- "babel-loader": "9.1.0",
96
+ "babel-loader": "9.1.2",
98
97
  "chai": "4.3.7",
99
98
  "cheerio": "1.0.0-rc.12",
100
- "core-js": "3.26.1",
101
- "esbuild": "0.15.14",
102
- "eslint": "8.27.0",
103
- "eslint-plugin-import": "2.26.0",
104
- "eslint-plugin-jsdoc": "39.6.2",
105
- "eslint-plugin-react": "7.31.10",
99
+ "core-js": "3.27.1",
100
+ "esbuild": "0.17.2",
101
+ "eslint": "8.32.0",
102
+ "eslint-plugin-import": "2.27.5",
103
+ "eslint-plugin-jsdoc": "39.6.4",
104
+ "eslint-plugin-react": "7.32.1",
106
105
  "esm": "3.2.25",
107
106
  "express": "4.18.2",
108
- "highlight.js": "11.6.0",
107
+ "highlight.js": "11.7.0",
109
108
  "html-entities": "2.3.3",
110
109
  "jest": "29.3.1",
111
110
  "jest-environment-jsdom": "29.3.1",
@@ -115,23 +114,24 @@
115
114
  "karma-mocha": "2.0.1",
116
115
  "karma-webpack": "5.0.0",
117
116
  "markdown-it": "13.0.1",
118
- "mocha": "10.1.0",
117
+ "mocha": "10.2.0",
119
118
  "mocha-loader": "5.1.5",
120
119
  "raw-loader": "4.0.2",
121
120
  "react": "18.2.0",
122
121
  "react-dom": "18.2.0",
123
- "regenerator-runtime": "0.13.10",
124
- "rimraf": "3.0.2",
122
+ "regenerator-runtime": "0.13.11",
123
+ "rimraf": "4.1.1",
124
+ "rxjs": "7.8.0",
125
125
  "semver": "7.3.8",
126
- "sinon": "14.0.2",
126
+ "sinon": "15.0.1",
127
127
  "terser-webpack-plugin": "5.3.6",
128
- "ts-jest": "29.0.3",
129
- "ts-loader": "9.4.1",
128
+ "ts-jest": "29.0.5",
129
+ "ts-loader": "9.4.2",
130
130
  "tslint": "6.1.3",
131
- "typescript": "4.9.3",
131
+ "typescript": "4.9.4",
132
132
  "webpack": "5.75.0",
133
133
  "webpack-bundle-analyzer": "4.7.0",
134
- "webpack-cli": "4.10.0"
134
+ "webpack-cli": "5.0.1"
135
135
  },
136
136
  "scripts-list": {
137
137
  "Build a demo page (e.g. to test a code change)": {
@@ -124,14 +124,7 @@ async function generateImportFilesFromTemplates() {
124
124
  * @returns {Promise}
125
125
  */
126
126
  function removeFile(fileName) {
127
- return new Promise((res, rej) => {
128
- rimraf(fileName, (err) => {
129
- if (err !== null && err !== undefined) {
130
- rej(err);
131
- }
132
- res();
133
- });
134
- });
127
+ return rimraf(fileName);
135
128
  }
136
129
 
137
130
  /**
@@ -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=3.29.0
4
+ sonar.projectVersion=3.30.0-dev.2023011800
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
package/src/README.md CHANGED
@@ -37,8 +37,8 @@ To better understand the player's architecture, you can find below a
37
37
  Facilitate track V | Abstract the streaming ^
38
38
  switching for +---------------+ | protocol |
39
39
  the API | | | |
40
- +----------------+ | | +--------------------------+ |
41
- | Content | | Init | ------> | | |
40
+ +----------------+ | Content | +--------------------------+ |
41
+ | Content | | Initializer | ------> | | |
42
42
  | Decryptor | <---- | (./core/init) | | Manifest Fetcher | |
43
43
  |(./core/decrypt)| | | |(./core/fetchers/manifest)| |
44
44
  | | | | | | |
@@ -8,47 +8,24 @@ describe("Compat - canReuseMediaKeys", () => {
8
8
  jest.resetModules();
9
9
  });
10
10
 
11
- it("should return true on any browser but WebOS 2021 and 2022", () => {
11
+ it("should return true on any browser but WebOS", () => {
12
12
  jest.mock("../browser_detection", () => {
13
13
  return { __esModule: true as const,
14
- isWebOs2021: false,
15
- isWebOs2022: false };
14
+ isWebOs: false };
16
15
  });
17
16
  const canReuseMediaKeys =
18
17
  jest.requireActual("../can_reuse_media_keys.ts");
19
18
  expect(canReuseMediaKeys.default()).toBe(true);
20
19
  });
21
20
 
22
- it("should return false on WebOs 2021", () => {
21
+ it("should return false on WebOs", () => {
23
22
  jest.mock("../browser_detection", () => {
24
23
  return { __esModule: true as const,
25
- isWebOs2021: true,
24
+ isWebOs: true,
26
25
  isWebOs2022: false };
27
26
  });
28
27
  const canReuseMediaKeys =
29
28
  jest.requireActual("../can_reuse_media_keys.ts");
30
29
  expect(canReuseMediaKeys.default()).toBe(false);
31
30
  });
32
-
33
- it("should return false on WebOs 2022", () => {
34
- jest.mock("../browser_detection", () => {
35
- return { __esModule: true as const,
36
- isWebOs2021: false,
37
- isWebOs2022: true };
38
- });
39
- const canReuseMediaKeys =
40
- jest.requireActual("../can_reuse_media_keys.ts");
41
- expect(canReuseMediaKeys.default()).toBe(false);
42
- });
43
-
44
- it("should return false in the improbable case of both WebOs 2021 and 2022", () => {
45
- jest.mock("../browser_detection", () => {
46
- return { __esModule: true as const,
47
- isWebOs2021: true,
48
- isWebOs2022: true };
49
- });
50
- const canReuseMediaKeys =
51
- jest.requireActual("../can_reuse_media_keys.ts");
52
- expect(canReuseMediaKeys.default()).toBe(false);
53
- });
54
31
  });
@@ -1,7 +1,4 @@
1
- import {
2
- isWebOs2021,
3
- isWebOs2022,
4
- } from "./browser_detection";
1
+ import { isWebOs } from "./browser_detection";
5
2
 
6
3
  /**
7
4
  * Returns `true` if a `MediaKeys` instance (the `Encrypted Media Extension`
@@ -9,11 +6,12 @@ import {
9
6
  *
10
7
  * This should usually be the case but we found rare devices where this would
11
8
  * cause problem:
12
- * - (2022-10-26): WebOS (LG TVs) 2021 and 2022 just rebuffered indefinitely
13
- * when loading a content already-loaded on the HTMLMediaElement.
9
+ * - (2022-11-21): WebOS (LG TVs), for some encrypted contents, just
10
+ * rebuffered indefinitely when loading a content already-loaded on the
11
+ * HTMLMediaElement.
14
12
  *
15
13
  * @returns {boolean}
16
14
  */
17
15
  export default function canReuseMediaKeys() : boolean {
18
- return !(isWebOs2021 || isWebOs2022);
16
+ return !isWebOs;
19
17
  }
@@ -14,12 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {
18
- merge as observableMerge,
19
- Subject,
20
- takeUntil,
21
- } from "rxjs";
22
17
  import EventEmitter from "../../../utils/event_emitter";
18
+ import TaskCanceller from "../../../utils/task_canceller";
23
19
  import { ICompatHTMLMediaElement } from "../../browser_compatibility_types";
24
20
  import * as events from "../../event_listeners";
25
21
  import {
@@ -43,16 +39,16 @@ class IE11MediaKeySession
43
39
  public expiration: number;
44
40
  public keyStatuses: ICustomMediaKeyStatusMap;
45
41
  private readonly _mk: MSMediaKeys;
46
- private readonly _closeSession$: Subject<void>;
42
+ private readonly _sessionClosingCanceller: TaskCanceller;
47
43
  private _ss: MSMediaKeySession | undefined;
48
44
  constructor(mk: MSMediaKeys) {
49
45
  super();
50
46
  this.expiration = NaN;
51
47
  this.keyStatuses = new Map();
52
48
  this._mk = mk;
53
- this._closeSession$ = new Subject();
49
+ this._sessionClosingCanceller = new TaskCanceller();
54
50
  this.closed = new Promise((resolve) => {
55
- this._closeSession$.subscribe(resolve);
51
+ this._sessionClosingCanceller.signal.register(() => resolve());
56
52
  });
57
53
  this.update = (license: Uint8Array) => {
58
54
  return new Promise((resolve, reject) => {
@@ -79,11 +75,15 @@ class IE11MediaKeySession
79
75
  initData instanceof ArrayBuffer ? new Uint8Array(initData) :
80
76
  new Uint8Array(initData.buffer);
81
77
  this._ss = this._mk.createSession("video/mp4", initDataU8);
82
- observableMerge(events.onKeyMessage$(this._ss),
83
- events.onKeyAdded$(this._ss),
84
- events.onKeyError$(this._ss)
85
- ).pipe(takeUntil(this._closeSession$))
86
- .subscribe((evt: Event) => this.trigger(evt.type, evt));
78
+ events.onKeyMessage(this._ss, (evt) => {
79
+ this.trigger((evt as Event).type ?? "message", evt as Event);
80
+ }, this._sessionClosingCanceller.signal);
81
+ events.onKeyAdded(this._ss, (evt) => {
82
+ this.trigger((evt as Event).type ?? "keyadded", evt as Event);
83
+ }, this._sessionClosingCanceller.signal);
84
+ events.onKeyError(this._ss, (evt) => {
85
+ this.trigger((evt as Event).type ?? "keyerror", evt as Event);
86
+ }, this._sessionClosingCanceller.signal);
87
87
  resolve();
88
88
  });
89
89
  }
@@ -93,8 +93,7 @@ class IE11MediaKeySession
93
93
  this._ss.close();
94
94
  this._ss = undefined;
95
95
  }
96
- this._closeSession$.next();
97
- this._closeSession$.complete();
96
+ this._sessionClosingCanceller.cancel();
98
97
  resolve();
99
98
  });
100
99
  }