rx-player 4.4.0 → 4.4.1-dev.2025101500

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 (341) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +52 -113
  3. package/VERSION +1 -1
  4. package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  5. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
  6. package/dist/commonjs/core/{main/common → entry}/FreezeResolver.d.ts +3 -3
  7. package/dist/commonjs/core/entry/FreezeResolver.d.ts.map +1 -0
  8. package/dist/commonjs/core/{main/common → entry}/FreezeResolver.js +3 -3
  9. package/dist/{es2017/core/main/worker → commonjs/core/entry}/content_preparer.d.ts +22 -15
  10. package/dist/commonjs/core/entry/content_preparer.d.ts.map +1 -0
  11. package/dist/commonjs/core/{main/worker → entry}/content_preparer.js +62 -64
  12. package/dist/{es2017/core/main/common → commonjs/core/entry}/content_time_boundaries_observer.d.ts +5 -5
  13. package/dist/commonjs/core/entry/content_time_boundaries_observer.d.ts.map +1 -0
  14. package/dist/commonjs/core/{main/common → entry}/content_time_boundaries_observer.js +6 -6
  15. package/dist/commonjs/core/entry/core_entry.d.ts +36 -0
  16. package/dist/commonjs/core/entry/core_entry.d.ts.map +1 -0
  17. package/dist/commonjs/core/{main/worker/worker_main.js → entry/core_entry.js} +192 -153
  18. package/dist/commonjs/core/{main/worker/worker_text_displayer_interface.d.ts → entry/core_text_displayer_interface.d.ts} +11 -11
  19. package/dist/commonjs/core/entry/core_text_displayer_interface.d.ts.map +1 -0
  20. package/dist/commonjs/core/{main/worker/worker_text_displayer_interface.js → entry/core_text_displayer_interface.js} +22 -22
  21. package/dist/commonjs/core/{main/common → entry}/create_content_time_boundaries_observer.d.ts +6 -6
  22. package/dist/commonjs/core/entry/create_content_time_boundaries_observer.d.ts.map +1 -0
  23. package/dist/commonjs/core/{main/common → entry}/create_content_time_boundaries_observer.js +1 -1
  24. package/dist/commonjs/core/{main/common → entry}/get_buffered_data_per_media_buffer.d.ts +4 -4
  25. package/dist/commonjs/core/entry/get_buffered_data_per_media_buffer.d.ts.map +1 -0
  26. package/dist/commonjs/core/{main/common → entry}/get_buffered_data_per_media_buffer.js +1 -1
  27. package/dist/{es2017/core/main/common → commonjs/core/entry}/get_thumbnail_data.d.ts +3 -3
  28. package/dist/commonjs/core/entry/get_thumbnail_data.d.ts.map +1 -0
  29. package/dist/commonjs/core/{main/common → entry}/get_thumbnail_data.js +2 -2
  30. package/dist/commonjs/core/entry/index.d.ts +5 -0
  31. package/dist/commonjs/core/entry/index.d.ts.map +1 -0
  32. package/dist/commonjs/core/entry/index.js +4 -0
  33. package/dist/{es2017/core/main/common → commonjs/core/entry}/synchronize_sinks_on_observation.d.ts +2 -2
  34. package/dist/commonjs/core/entry/synchronize_sinks_on_observation.d.ts.map +1 -0
  35. package/dist/commonjs/core/{main/worker → entry}/track_choice_setter.d.ts +4 -4
  36. package/dist/commonjs/core/entry/track_choice_setter.d.ts.map +1 -0
  37. package/dist/commonjs/core/{main/worker → entry}/track_choice_setter.js +4 -4
  38. package/dist/commonjs/core/entry/utils.d.ts +3 -0
  39. package/dist/commonjs/core/entry/utils.d.ts.map +1 -0
  40. package/dist/commonjs/core/entry/utils.js +11 -0
  41. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
  42. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +17 -0
  43. package/dist/commonjs/core/types.d.ts +519 -1
  44. package/dist/commonjs/core/types.d.ts.map +1 -1
  45. package/dist/commonjs/core/types.js +1 -0
  46. package/dist/commonjs/experimental/features/local.d.ts.map +1 -1
  47. package/dist/commonjs/experimental/features/local.js +7 -1
  48. package/dist/commonjs/experimental/features/metaplaylist.d.ts.map +1 -1
  49. package/dist/commonjs/experimental/features/metaplaylist.js +7 -1
  50. package/dist/commonjs/experimental/features/multi_thread.d.ts.map +1 -1
  51. package/dist/commonjs/experimental/features/multi_thread.js +6 -2
  52. package/dist/commonjs/features/features_object.js +1 -1
  53. package/dist/commonjs/features/list/dash.d.ts.map +1 -1
  54. package/dist/commonjs/features/list/dash.js +7 -1
  55. package/dist/commonjs/features/list/dash_wasm.d.ts.map +1 -1
  56. package/dist/commonjs/features/list/dash_wasm.js +7 -1
  57. package/dist/commonjs/features/list/media_source_main.d.ts.map +1 -1
  58. package/dist/commonjs/features/list/media_source_main.js +7 -1
  59. package/dist/commonjs/features/list/smooth.d.ts.map +1 -1
  60. package/dist/commonjs/features/list/smooth.js +7 -1
  61. package/dist/commonjs/features/types.d.ts +20 -4
  62. package/dist/commonjs/features/types.d.ts.map +1 -1
  63. package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
  64. package/dist/commonjs/main_thread/api/public_api.js +39 -42
  65. package/dist/commonjs/main_thread/core_interface/base.d.ts +13 -0
  66. package/dist/commonjs/main_thread/core_interface/base.d.ts.map +1 -0
  67. package/dist/commonjs/main_thread/core_interface/base.js +32 -0
  68. package/dist/commonjs/main_thread/core_interface/monothread.d.ts +13 -0
  69. package/dist/commonjs/main_thread/core_interface/monothread.d.ts.map +1 -0
  70. package/dist/commonjs/main_thread/core_interface/monothread.js +56 -0
  71. package/dist/commonjs/main_thread/core_interface/multithread.d.ts +25 -0
  72. package/dist/commonjs/main_thread/core_interface/multithread.d.ts.map +1 -0
  73. package/dist/commonjs/main_thread/core_interface/multithread.js +67 -0
  74. package/dist/commonjs/main_thread/core_interface/types.d.ts +6 -0
  75. package/dist/commonjs/main_thread/core_interface/types.d.ts.map +1 -0
  76. package/dist/commonjs/main_thread/core_interface/types.js +2 -0
  77. package/dist/commonjs/main_thread/init/media_source_content_initializer.d.ts +166 -108
  78. package/dist/commonjs/main_thread/init/media_source_content_initializer.d.ts.map +1 -1
  79. package/dist/commonjs/main_thread/init/media_source_content_initializer.js +1492 -919
  80. package/dist/commonjs/main_thread/init/utils/create_core_playback_observer.d.ts.map +1 -1
  81. package/dist/commonjs/main_thread/init/utils/create_core_playback_observer.js +2 -1
  82. package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.d.ts +1 -1
  83. package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
  84. package/dist/commonjs/main_thread/types.d.ts +537 -0
  85. package/dist/commonjs/main_thread/types.d.ts.map +1 -1
  86. package/dist/commonjs/manifest/utils.d.ts.map +1 -1
  87. package/dist/commonjs/manifest/utils.js +18 -4
  88. package/dist/commonjs/mse/worker_media_source_interface.d.ts +2 -2
  89. package/dist/commonjs/mse/worker_media_source_interface.d.ts.map +1 -1
  90. package/dist/commonjs/mse/worker_media_source_interface.js +12 -12
  91. package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts +1 -1
  92. package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
  93. package/dist/commonjs/parsers/manifest/smooth/create_parser.js +31 -27
  94. package/dist/commonjs/parsers/manifest/smooth/parse_C_nodes.d.ts +3 -2
  95. package/dist/commonjs/parsers/manifest/smooth/parse_C_nodes.d.ts.map +1 -1
  96. package/dist/commonjs/parsers/manifest/smooth/parse_C_nodes.js +16 -7
  97. package/dist/commonjs/parsers/manifest/smooth/parse_protection_node.d.ts +3 -2
  98. package/dist/commonjs/parsers/manifest/smooth/parse_protection_node.d.ts.map +1 -1
  99. package/dist/commonjs/parsers/manifest/smooth/parse_protection_node.js +37 -6
  100. package/dist/commonjs/parsers/manifest/smooth/utils/parseBoolean.d.ts +1 -1
  101. package/dist/commonjs/parsers/manifest/smooth/utils/parseBoolean.d.ts.map +1 -1
  102. package/dist/commonjs/parsers/manifest/smooth/utils/reduceChildren.d.ts +3 -2
  103. package/dist/commonjs/parsers/manifest/smooth/utils/reduceChildren.d.ts.map +1 -1
  104. package/dist/commonjs/parsers/manifest/smooth/utils/reduceChildren.js +28 -5
  105. package/dist/{es2017/playback_observer/worker_playback_observer.d.ts → commonjs/playback_observer/core_playback_observer.d.ts} +8 -8
  106. package/dist/commonjs/playback_observer/core_playback_observer.d.ts.map +1 -0
  107. package/dist/commonjs/playback_observer/{worker_playback_observer.js → core_playback_observer.js} +13 -13
  108. package/dist/commonjs/transports/smooth/pipelines.d.ts.map +1 -1
  109. package/dist/commonjs/transports/smooth/pipelines.js +25 -3
  110. package/dist/commonjs/worker_entry_point.js +62 -2
  111. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  112. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  113. package/dist/es2017/core/{main/common → entry}/FreezeResolver.d.ts +3 -3
  114. package/dist/es2017/core/entry/FreezeResolver.d.ts.map +1 -0
  115. package/dist/es2017/core/{main/common → entry}/FreezeResolver.js +3 -3
  116. package/dist/{commonjs/core/main/worker → es2017/core/entry}/content_preparer.d.ts +22 -15
  117. package/dist/es2017/core/entry/content_preparer.d.ts.map +1 -0
  118. package/dist/es2017/core/{main/worker → entry}/content_preparer.js +53 -55
  119. package/dist/{commonjs/core/main/common → es2017/core/entry}/content_time_boundaries_observer.d.ts +5 -5
  120. package/dist/es2017/core/entry/content_time_boundaries_observer.d.ts.map +1 -0
  121. package/dist/es2017/core/{main/common → entry}/content_time_boundaries_observer.js +6 -6
  122. package/dist/es2017/core/entry/core_entry.d.ts +36 -0
  123. package/dist/es2017/core/entry/core_entry.d.ts.map +1 -0
  124. package/dist/es2017/core/{main/worker/worker_main.js → entry/core_entry.js} +153 -114
  125. package/dist/es2017/core/{main/worker/worker_text_displayer_interface.d.ts → entry/core_text_displayer_interface.d.ts} +11 -11
  126. package/dist/es2017/core/entry/core_text_displayer_interface.d.ts.map +1 -0
  127. package/dist/es2017/core/{main/worker/worker_text_displayer_interface.js → entry/core_text_displayer_interface.js} +10 -10
  128. package/dist/es2017/core/{main/common → entry}/create_content_time_boundaries_observer.d.ts +6 -6
  129. package/dist/es2017/core/entry/create_content_time_boundaries_observer.d.ts.map +1 -0
  130. package/dist/es2017/core/{main/common → entry}/create_content_time_boundaries_observer.js +1 -1
  131. package/dist/es2017/core/{main/common → entry}/get_buffered_data_per_media_buffer.d.ts +4 -4
  132. package/dist/es2017/core/entry/get_buffered_data_per_media_buffer.d.ts.map +1 -0
  133. package/dist/es2017/core/{main/common → entry}/get_buffered_data_per_media_buffer.js +1 -1
  134. package/dist/{commonjs/core/main/common → es2017/core/entry}/get_thumbnail_data.d.ts +3 -3
  135. package/dist/es2017/core/entry/get_thumbnail_data.d.ts.map +1 -0
  136. package/dist/es2017/core/{main/common → entry}/get_thumbnail_data.js +2 -2
  137. package/dist/es2017/core/entry/index.d.ts +5 -0
  138. package/dist/es2017/core/entry/index.d.ts.map +1 -0
  139. package/dist/es2017/core/entry/index.js +2 -0
  140. package/dist/{commonjs/core/main/common → es2017/core/entry}/synchronize_sinks_on_observation.d.ts +2 -2
  141. package/dist/es2017/core/entry/synchronize_sinks_on_observation.d.ts.map +1 -0
  142. package/dist/es2017/core/{main/worker → entry}/track_choice_setter.d.ts +4 -4
  143. package/dist/es2017/core/entry/track_choice_setter.d.ts.map +1 -0
  144. package/dist/es2017/core/{main/worker → entry}/track_choice_setter.js +4 -4
  145. package/dist/es2017/core/entry/utils.d.ts +3 -0
  146. package/dist/es2017/core/entry/utils.d.ts.map +1 -0
  147. package/dist/es2017/core/entry/utils.js +8 -0
  148. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
  149. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +18 -1
  150. package/dist/es2017/core/types.d.ts +519 -1
  151. package/dist/es2017/core/types.d.ts.map +1 -1
  152. package/dist/es2017/core/types.js +1 -0
  153. package/dist/es2017/experimental/features/local.d.ts.map +1 -1
  154. package/dist/es2017/experimental/features/local.js +7 -1
  155. package/dist/es2017/experimental/features/metaplaylist.d.ts.map +1 -1
  156. package/dist/es2017/experimental/features/metaplaylist.js +7 -1
  157. package/dist/es2017/experimental/features/multi_thread.d.ts.map +1 -1
  158. package/dist/es2017/experimental/features/multi_thread.js +6 -2
  159. package/dist/es2017/features/features_object.js +1 -1
  160. package/dist/es2017/features/list/dash.d.ts.map +1 -1
  161. package/dist/es2017/features/list/dash.js +7 -1
  162. package/dist/es2017/features/list/dash_wasm.d.ts.map +1 -1
  163. package/dist/es2017/features/list/dash_wasm.js +7 -1
  164. package/dist/es2017/features/list/media_source_main.d.ts.map +1 -1
  165. package/dist/es2017/features/list/media_source_main.js +7 -1
  166. package/dist/es2017/features/list/smooth.d.ts.map +1 -1
  167. package/dist/es2017/features/list/smooth.js +7 -1
  168. package/dist/es2017/features/types.d.ts +20 -4
  169. package/dist/es2017/features/types.d.ts.map +1 -1
  170. package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
  171. package/dist/es2017/main_thread/api/public_api.js +40 -43
  172. package/dist/es2017/main_thread/core_interface/base.d.ts +13 -0
  173. package/dist/es2017/main_thread/core_interface/base.d.ts.map +1 -0
  174. package/dist/es2017/main_thread/core_interface/base.js +28 -0
  175. package/dist/es2017/main_thread/core_interface/monothread.d.ts +13 -0
  176. package/dist/es2017/main_thread/core_interface/monothread.d.ts.map +1 -0
  177. package/dist/es2017/main_thread/core_interface/monothread.js +32 -0
  178. package/dist/es2017/main_thread/core_interface/multithread.d.ts +25 -0
  179. package/dist/es2017/main_thread/core_interface/multithread.d.ts.map +1 -0
  180. package/dist/es2017/main_thread/core_interface/multithread.js +45 -0
  181. package/dist/es2017/main_thread/core_interface/types.d.ts +6 -0
  182. package/dist/es2017/main_thread/core_interface/types.d.ts.map +1 -0
  183. package/dist/es2017/main_thread/core_interface/types.js +1 -0
  184. package/dist/es2017/main_thread/init/media_source_content_initializer.d.ts +166 -108
  185. package/dist/es2017/main_thread/init/media_source_content_initializer.d.ts.map +1 -1
  186. package/dist/es2017/main_thread/init/media_source_content_initializer.js +1405 -760
  187. package/dist/es2017/main_thread/init/utils/create_core_playback_observer.d.ts.map +1 -1
  188. package/dist/es2017/main_thread/init/utils/create_core_playback_observer.js +2 -1
  189. package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.d.ts +1 -1
  190. package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
  191. package/dist/es2017/main_thread/types.d.ts +537 -0
  192. package/dist/es2017/main_thread/types.d.ts.map +1 -1
  193. package/dist/es2017/manifest/utils.d.ts.map +1 -1
  194. package/dist/es2017/manifest/utils.js +16 -4
  195. package/dist/es2017/mse/worker_media_source_interface.d.ts +2 -2
  196. package/dist/es2017/mse/worker_media_source_interface.d.ts.map +1 -1
  197. package/dist/es2017/mse/worker_media_source_interface.js +12 -12
  198. package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts +1 -1
  199. package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
  200. package/dist/es2017/parsers/manifest/smooth/create_parser.js +31 -27
  201. package/dist/es2017/parsers/manifest/smooth/parse_C_nodes.d.ts +3 -2
  202. package/dist/es2017/parsers/manifest/smooth/parse_C_nodes.d.ts.map +1 -1
  203. package/dist/es2017/parsers/manifest/smooth/parse_C_nodes.js +16 -7
  204. package/dist/es2017/parsers/manifest/smooth/parse_protection_node.d.ts +3 -2
  205. package/dist/es2017/parsers/manifest/smooth/parse_protection_node.d.ts.map +1 -1
  206. package/dist/es2017/parsers/manifest/smooth/parse_protection_node.js +15 -6
  207. package/dist/es2017/parsers/manifest/smooth/utils/parseBoolean.d.ts +1 -1
  208. package/dist/es2017/parsers/manifest/smooth/utils/parseBoolean.d.ts.map +1 -1
  209. package/dist/es2017/parsers/manifest/smooth/utils/reduceChildren.d.ts +3 -2
  210. package/dist/es2017/parsers/manifest/smooth/utils/reduceChildren.d.ts.map +1 -1
  211. package/dist/es2017/parsers/manifest/smooth/utils/reduceChildren.js +6 -5
  212. package/dist/{commonjs/playback_observer/worker_playback_observer.d.ts → es2017/playback_observer/core_playback_observer.d.ts} +8 -8
  213. package/dist/es2017/playback_observer/core_playback_observer.d.ts.map +1 -0
  214. package/dist/es2017/playback_observer/{worker_playback_observer.js → core_playback_observer.js} +2 -2
  215. package/dist/es2017/transports/smooth/pipelines.d.ts.map +1 -1
  216. package/dist/es2017/transports/smooth/pipelines.js +25 -3
  217. package/dist/es2017/worker_entry_point.js +62 -2
  218. package/dist/rx-player.js +21882 -19021
  219. package/dist/rx-player.min.js +20 -20
  220. package/dist/worker.js +8 -8
  221. package/package.json +1 -1
  222. package/src/README.md +88 -198
  223. package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
  224. package/src/core/{main/common → entry}/FreezeResolver.ts +7 -7
  225. package/src/core/{main → entry}/README.md +1 -1
  226. package/src/core/{main/worker → entry}/content_preparer.ts +77 -76
  227. package/src/core/{main/common → entry}/content_time_boundaries_observer.ts +10 -10
  228. package/src/core/{main/worker/worker_main.ts → entry/core_entry.ts} +223 -149
  229. package/src/core/{main/worker/worker_text_displayer_interface.ts → entry/core_text_displayer_interface.ts} +26 -26
  230. package/src/core/{main/common → entry}/create_content_time_boundaries_observer.ts +7 -7
  231. package/src/core/{main/common → entry}/get_buffered_data_per_media_buffer.ts +6 -6
  232. package/src/core/{main/common → entry}/get_thumbnail_data.ts +5 -5
  233. package/src/core/entry/index.ts +4 -0
  234. package/src/core/{main/common → entry}/synchronize_sinks_on_observation.ts +2 -2
  235. package/src/core/{main/worker → entry}/track_choice_setter.ts +7 -7
  236. package/src/core/entry/utils.ts +11 -0
  237. package/src/core/stream/orchestrator/stream_orchestrator.ts +26 -1
  238. package/src/core/types.ts +631 -3
  239. package/src/experimental/features/__tests__/local.test.ts +11 -2
  240. package/src/experimental/features/__tests__/metaplaylist.test.ts +11 -2
  241. package/src/experimental/features/__tests__/multi_thread.test.ts +8 -3
  242. package/src/experimental/features/local.ts +7 -1
  243. package/src/experimental/features/metaplaylist.ts +7 -1
  244. package/src/experimental/features/multi_thread.ts +6 -2
  245. package/src/features/features_object.ts +1 -1
  246. package/src/features/list/__tests__/dash.test.ts +12 -3
  247. package/src/features/list/__tests__/smooth.test.ts +11 -2
  248. package/src/features/list/dash.ts +7 -1
  249. package/src/features/list/dash_wasm.ts +7 -1
  250. package/src/features/list/media_source_main.ts +7 -1
  251. package/src/features/list/smooth.ts +7 -1
  252. package/src/features/types.ts +23 -4
  253. package/src/main_thread/README.md +8 -0
  254. package/src/main_thread/api/public_api.ts +46 -48
  255. package/src/main_thread/core_interface/README.md +22 -0
  256. package/src/main_thread/core_interface/base.ts +36 -0
  257. package/src/main_thread/core_interface/monothread.ts +46 -0
  258. package/src/main_thread/core_interface/multithread.ts +49 -0
  259. package/src/main_thread/core_interface/types.ts +5 -0
  260. package/src/main_thread/init/media_source_content_initializer.ts +2034 -1152
  261. package/src/main_thread/init/utils/create_core_playback_observer.ts +2 -1
  262. package/src/main_thread/init/utils/update_manifest_codec_support.ts +1 -1
  263. package/src/main_thread/types.ts +610 -0
  264. package/src/manifest/utils.ts +20 -4
  265. package/src/mse/worker_media_source_interface.ts +35 -35
  266. package/src/parsers/manifest/smooth/create_parser.ts +40 -34
  267. package/src/parsers/manifest/smooth/parse_C_nodes.ts +19 -8
  268. package/src/parsers/manifest/smooth/parse_protection_node.ts +17 -9
  269. package/src/parsers/manifest/smooth/utils/parseBoolean.ts +1 -1
  270. package/src/parsers/manifest/smooth/utils/reduceChildren.ts +10 -7
  271. package/src/playback_observer/{worker_playback_observer.ts → core_playback_observer.ts} +13 -13
  272. package/src/transports/smooth/pipelines.ts +25 -5
  273. package/src/worker_entry_point.ts +71 -2
  274. package/dist/commonjs/core/main/common/FreezeResolver.d.ts.map +0 -1
  275. package/dist/commonjs/core/main/common/content_time_boundaries_observer.d.ts.map +0 -1
  276. package/dist/commonjs/core/main/common/create_content_time_boundaries_observer.d.ts.map +0 -1
  277. package/dist/commonjs/core/main/common/get_buffered_data_per_media_buffer.d.ts.map +0 -1
  278. package/dist/commonjs/core/main/common/get_thumbnail_data.d.ts.map +0 -1
  279. package/dist/commonjs/core/main/common/synchronize_sinks_on_observation.d.ts.map +0 -1
  280. package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +0 -1
  281. package/dist/commonjs/core/main/worker/globals.d.ts +0 -14
  282. package/dist/commonjs/core/main/worker/globals.d.ts.map +0 -1
  283. package/dist/commonjs/core/main/worker/globals.js +0 -26
  284. package/dist/commonjs/core/main/worker/index.d.ts +0 -3
  285. package/dist/commonjs/core/main/worker/index.d.ts.map +0 -1
  286. package/dist/commonjs/core/main/worker/index.js +0 -4
  287. package/dist/commonjs/core/main/worker/send_message.d.ts +0 -4
  288. package/dist/commonjs/core/main/worker/send_message.d.ts.map +0 -1
  289. package/dist/commonjs/core/main/worker/send_message.js +0 -23
  290. package/dist/commonjs/core/main/worker/track_choice_setter.d.ts.map +0 -1
  291. package/dist/commonjs/core/main/worker/worker_main.d.ts +0 -2
  292. package/dist/commonjs/core/main/worker/worker_main.d.ts.map +0 -1
  293. package/dist/commonjs/core/main/worker/worker_text_displayer_interface.d.ts.map +0 -1
  294. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts +0 -308
  295. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +0 -1
  296. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +0 -1713
  297. package/dist/commonjs/main_thread/init/send_message.d.ts +0 -3
  298. package/dist/commonjs/main_thread/init/send_message.d.ts.map +0 -1
  299. package/dist/commonjs/main_thread/init/send_message.js +0 -13
  300. package/dist/commonjs/multithread_types.d.ts +0 -915
  301. package/dist/commonjs/multithread_types.d.ts.map +0 -1
  302. package/dist/commonjs/multithread_types.js +0 -7
  303. package/dist/commonjs/playback_observer/worker_playback_observer.d.ts.map +0 -1
  304. package/dist/es2017/core/main/common/FreezeResolver.d.ts.map +0 -1
  305. package/dist/es2017/core/main/common/content_time_boundaries_observer.d.ts.map +0 -1
  306. package/dist/es2017/core/main/common/create_content_time_boundaries_observer.d.ts.map +0 -1
  307. package/dist/es2017/core/main/common/get_buffered_data_per_media_buffer.d.ts.map +0 -1
  308. package/dist/es2017/core/main/common/get_thumbnail_data.d.ts.map +0 -1
  309. package/dist/es2017/core/main/common/synchronize_sinks_on_observation.d.ts.map +0 -1
  310. package/dist/es2017/core/main/worker/content_preparer.d.ts.map +0 -1
  311. package/dist/es2017/core/main/worker/globals.d.ts +0 -14
  312. package/dist/es2017/core/main/worker/globals.d.ts.map +0 -1
  313. package/dist/es2017/core/main/worker/globals.js +0 -18
  314. package/dist/es2017/core/main/worker/index.d.ts +0 -3
  315. package/dist/es2017/core/main/worker/index.d.ts.map +0 -1
  316. package/dist/es2017/core/main/worker/index.js +0 -2
  317. package/dist/es2017/core/main/worker/send_message.d.ts +0 -4
  318. package/dist/es2017/core/main/worker/send_message.d.ts.map +0 -1
  319. package/dist/es2017/core/main/worker/send_message.js +0 -19
  320. package/dist/es2017/core/main/worker/track_choice_setter.d.ts.map +0 -1
  321. package/dist/es2017/core/main/worker/worker_main.d.ts +0 -2
  322. package/dist/es2017/core/main/worker/worker_main.d.ts.map +0 -1
  323. package/dist/es2017/core/main/worker/worker_text_displayer_interface.d.ts.map +0 -1
  324. package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts +0 -308
  325. package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +0 -1
  326. package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +0 -1559
  327. package/dist/es2017/main_thread/init/send_message.d.ts +0 -3
  328. package/dist/es2017/main_thread/init/send_message.d.ts.map +0 -1
  329. package/dist/es2017/main_thread/init/send_message.js +0 -10
  330. package/dist/es2017/multithread_types.d.ts +0 -915
  331. package/dist/es2017/multithread_types.d.ts.map +0 -1
  332. package/dist/es2017/multithread_types.js +0 -6
  333. package/dist/es2017/playback_observer/worker_playback_observer.d.ts.map +0 -1
  334. package/src/core/main/worker/globals.ts +0 -38
  335. package/src/core/main/worker/index.ts +0 -2
  336. package/src/core/main/worker/send_message.ts +0 -28
  337. package/src/main_thread/init/multi_thread_content_initializer.ts +0 -2330
  338. package/src/main_thread/init/send_message.ts +0 -15
  339. package/src/multithread_types.ts +0 -1095
  340. /package/dist/commonjs/core/{main/common → entry}/synchronize_sinks_on_observation.js +0 -0
  341. /package/dist/es2017/core/{main/common → entry}/synchronize_sinks_on_observation.js +0 -0
@@ -1,6 +1,6 @@
1
+ import type { IAbortBufferCoreMessage, IAddSourceBufferCoreMessage, IAppendBufferCoreMessage, ICreateMediaSourceCoreMessage, IDisposeMediaSourceCoreMessage, IEndOfStreamCoreMessage, IInterruptMediaSourceDurationCoreMessage, IRemoveBufferCoreMessage, IStopEndOfStreamCoreMessage, IUpdateMediaSourceDurationCoreMessage } from "../core/types";
1
2
  import { SourceBufferError } from "../errors";
2
3
  import type { ISerializedSourceBufferError } from "../errors/source_buffer_error";
3
- import type { IAbortBufferWorkerMessage, IAddSourceBufferWorkerMessage, IAppendBufferWorkerMessage, ICreateMediaSourceWorkerMessage, IDisposeMediaSourceWorkerMessage, IEndOfStreamWorkerMessage, IInterruptMediaSourceDurationWorkerMessage, IRemoveBufferWorkerMessage, IStopEndOfStreamWorkerMessage, IUpdateMediaSourceDurationWorkerMessage } from "../multithread_types";
4
4
  import EventEmitter from "../utils/event_emitter";
5
5
  import type { IRange } from "../utils/ranges";
6
6
  import { CancellationError } from "../utils/task_canceller";
@@ -32,7 +32,7 @@ export default class WorkerMediaSourceInterface extends EventEmitter<IMediaSourc
32
32
  stopEndOfStream(): void;
33
33
  dispose(): void;
34
34
  }
35
- export type IWorkerMediaSourceInterfaceMessageSender = (msg: IAppendBufferWorkerMessage | IRemoveBufferWorkerMessage | IAbortBufferWorkerMessage | ICreateMediaSourceWorkerMessage | IAddSourceBufferWorkerMessage | IUpdateMediaSourceDurationWorkerMessage | IInterruptMediaSourceDurationWorkerMessage | IEndOfStreamWorkerMessage | IStopEndOfStreamWorkerMessage | IDisposeMediaSourceWorkerMessage, transferables?: Transferable[]) => void;
35
+ export type IWorkerMediaSourceInterfaceMessageSender = (msg: IAppendBufferCoreMessage | IRemoveBufferCoreMessage | IAbortBufferCoreMessage | ICreateMediaSourceCoreMessage | IAddSourceBufferCoreMessage | IUpdateMediaSourceDurationCoreMessage | IInterruptMediaSourceDurationCoreMessage | IEndOfStreamCoreMessage | IStopEndOfStreamCoreMessage | IDisposeMediaSourceCoreMessage, transferables?: Transferable[]) => void;
36
36
  export declare class WorkerSourceBufferInterface implements ISourceBufferInterface {
37
37
  /** Last codec linked to that `WorkerSourceBufferInterface`. */
38
38
  codec: string;
@@ -1 +1 @@
1
- {"version":3,"file":"worker_media_source_interface.d.ts","sourceRoot":"","sources":["../../../src/mse/worker_media_source_interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,yBAAyB,EACzB,0CAA0C,EAC1C,0BAA0B,EAC1B,6BAA6B,EAC7B,uCAAuC,EACxC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAsB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,EACtB,4CAA4C,EAC5C,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAajB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,0BACnB,SAAQ,YAAY,CAAC,2BAA2B,CAChD,YAAW,qBAAqB;IAEzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,aAAa,EAAE,2BAA2B,EAAE,CAAC;IAC7C,UAAU,EAAE,UAAU,CAAC;IAC9B,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,cAAc,CAA2C;gBAG/D,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,aAAa,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,IAAI;IAW/D,kBAAkB,CACvB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,4BAA4B,GAAG;QAAE,SAAS,EAAE,mBAAmB,CAAA;KAAE,GACvE,IAAI;IAoBA,YAAY,CACjB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,4CAA4C,GACnD,OAAO,CAAC,MAAM,EAAE,CAAC;IA+Cb,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAiCrD,KAAK,IAAI,IAAI;IASb,OAAO,IAAI,IAAI;IAKf,WAAW,IAAI,SAAS;IAI/B,OAAO,CAAC,oBAAoB;IAuB5B,OAAO,CAAC,qCAAqC;CAoD9C;AAED,KAAK,mBAAmB,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAE7D;;;GAGG;AACH,mBAAW,gBAAgB;IACzB,IAAI,IAAA;IACJ,MAAM,IAAA;CACP;AAED,UAAU,cAAc;IACtB,aAAa,EAAE,gBAAgB,CAAC,IAAI,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC,CAAC;IAC3D,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC;AAED,UAAU,gBAAgB;IACxB,aAAa,EAAE,gBAAgB,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,UAAU,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrD,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC"}
1
+ {"version":3,"file":"worker_media_source_interface.d.ts","sourceRoot":"","sources":["../../../src/mse/worker_media_source_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KA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AE,CAAC;IAiCrD,KAAK,IAAI,IAAI;IASb,OAAO,IAAI,IAAI;IAKf,WAAW,IAAI,SAAS;IAI/B,OAAO,CAAC,oBAAoB;IAuB5B,OAAO,CAAC,qCAAqC;CAoD9C;AAED,KAAK,mBAAmB,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAE7D;;;GAGG;AACH,mBAAW,gBAAgB;IACzB,IAAI,IAAA;IACJ,MAAM,IAAA;CACP;AAED,UAAU,cAAc;IACtB,aAAa,EAAE,gBAAgB,CAAC,IAAI,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC,CAAC;IAC3D,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC;AAED,UAAU,gBAAgB;IACxB,aAAa,EAAE,gBAAgB,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,UAAU,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrD,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC"}
@@ -33,7 +33,7 @@ export default class WorkerMediaSourceInterface extends EventEmitter {
33
33
  this._messageSender = messageSender;
34
34
  const mediaSourceId = generateMediaSourceId();
35
35
  this._messageSender({
36
- type: "create-media-source" /* WorkerMessageType.CreateMediaSource */,
36
+ type: "create-media-source" /* CoreMessageType.CreateMediaSource */,
37
37
  contentId,
38
38
  mediaSourceId,
39
39
  });
@@ -56,7 +56,7 @@ export default class WorkerMediaSourceInterface extends EventEmitter {
56
56
  }
57
57
  addSourceBuffer(sbType, codec) {
58
58
  this._messageSender({
59
- type: "add-source-buffer" /* WorkerMessageType.AddSourceBuffer */,
59
+ type: "add-source-buffer" /* CoreMessageType.AddSourceBuffer */,
60
60
  mediaSourceId: this.id,
61
61
  value: {
62
62
  sourceBufferType: sbType,
@@ -69,7 +69,7 @@ export default class WorkerMediaSourceInterface extends EventEmitter {
69
69
  }
70
70
  setDuration(newDuration, isRealEndKnown) {
71
71
  this._messageSender({
72
- type: "update-media-source-duration" /* WorkerMessageType.UpdateMediaSourceDuration */,
72
+ type: "update-media-source-duration" /* CoreMessageType.UpdateMediaSourceDuration */,
73
73
  mediaSourceId: this.id,
74
74
  value: {
75
75
  duration: newDuration,
@@ -79,21 +79,21 @@ export default class WorkerMediaSourceInterface extends EventEmitter {
79
79
  }
80
80
  interruptDurationSetting() {
81
81
  this._messageSender({
82
- type: "stop-media-source-duration" /* WorkerMessageType.InterruptMediaSourceDurationUpdate */,
82
+ type: "stop-media-source-duration" /* CoreMessageType.InterruptMediaSourceDurationUpdate */,
83
83
  mediaSourceId: this.id,
84
84
  value: null,
85
85
  });
86
86
  }
87
87
  maintainEndOfStream() {
88
88
  this._messageSender({
89
- type: "end-of-stream" /* WorkerMessageType.EndOfStream */,
89
+ type: "end-of-stream" /* CoreMessageType.EndOfStream */,
90
90
  mediaSourceId: this.id,
91
91
  value: null,
92
92
  });
93
93
  }
94
94
  stopEndOfStream() {
95
95
  this._messageSender({
96
- type: "stop-end-of-stream" /* WorkerMessageType.InterruptEndOfStream */,
96
+ type: "stop-end-of-stream" /* CoreMessageType.InterruptEndOfStream */,
97
97
  mediaSourceId: this.id,
98
98
  value: null,
99
99
  });
@@ -102,7 +102,7 @@ export default class WorkerMediaSourceInterface extends EventEmitter {
102
102
  this.sourceBuffers.forEach((s) => s.dispose());
103
103
  this._canceller.cancel();
104
104
  this._messageSender({
105
- type: "dispose-media-source" /* WorkerMessageType.DisposeMediaSource */,
105
+ type: "dispose-media-source" /* CoreMessageType.DisposeMediaSource */,
106
106
  mediaSourceId: this.id,
107
107
  value: null,
108
108
  });
@@ -172,7 +172,7 @@ export class WorkerSourceBufferInterface {
172
172
  }
173
173
  const operationId = generateSourceBufferOperationId();
174
174
  this._messageSender({
175
- type: "source-buffer-append" /* WorkerMessageType.SourceBufferAppend */,
175
+ type: "source-buffer-append" /* CoreMessageType.SourceBufferAppend */,
176
176
  mediaSourceId: this._mediaSourceId,
177
177
  sourceBufferType: this.type,
178
178
  operationId,
@@ -203,7 +203,7 @@ export class WorkerSourceBufferInterface {
203
203
  try {
204
204
  const operationId = generateSourceBufferOperationId();
205
205
  this._messageSender({
206
- type: "source-buffer-remove" /* WorkerMessageType.SourceBufferRemove */,
206
+ type: "source-buffer-remove" /* CoreMessageType.SourceBufferRemove */,
207
207
  mediaSourceId: this._mediaSourceId,
208
208
  sourceBufferType: this.type,
209
209
  operationId,
@@ -221,7 +221,7 @@ export class WorkerSourceBufferInterface {
221
221
  }
222
222
  abort() {
223
223
  this._messageSender({
224
- type: "abort-source-buffer" /* WorkerMessageType.AbortSourceBuffer */,
224
+ type: "abort-source-buffer" /* CoreMessageType.AbortSourceBuffer */,
225
225
  mediaSourceId: this._mediaSourceId,
226
226
  sourceBufferType: this.type,
227
227
  value: null,
@@ -270,7 +270,7 @@ export class WorkerSourceBufferInterface {
270
270
  }
271
271
  const nOpId = generateSourceBufferOperationId();
272
272
  this._messageSender({
273
- type: "source-buffer-append" /* WorkerMessageType.SourceBufferAppend */,
273
+ type: "source-buffer-append" /* CoreMessageType.SourceBufferAppend */,
274
274
  mediaSourceId: this._mediaSourceId,
275
275
  sourceBufferType: this.type,
276
276
  operationId: nOpId,
@@ -285,7 +285,7 @@ export class WorkerSourceBufferInterface {
285
285
  const [start, end] = nextOp.params;
286
286
  const nOpId = generateSourceBufferOperationId();
287
287
  this._messageSender({
288
- type: "source-buffer-remove" /* WorkerMessageType.SourceBufferRemove */,
288
+ type: "source-buffer-remove" /* CoreMessageType.SourceBufferRemove */,
289
289
  mediaSourceId: this._mediaSourceId,
290
290
  sourceBufferType: this.type,
291
291
  operationId: nOpId,
@@ -29,6 +29,6 @@ export interface IHSSParserConfiguration {
29
29
  * @param {Object|undefined} parserOptions
30
30
  * @returns {Function}
31
31
  */
32
- declare function createSmoothStreamingParser(parserOptions?: IHSSParserConfiguration): (manifest: Document, url?: string | undefined, manifestReceivedTime?: number | undefined) => IParsedManifest;
32
+ declare function createSmoothStreamingParser(parserOptions?: IHSSParserConfiguration): (manifest: string, url?: string | undefined, manifestReceivedTime?: number | undefined) => IParsedManifest;
33
33
  export default createSmoothStreamingParser;
34
34
  //# sourceMappingURL=create_parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create_parser.d.ts","sourceRoot":"","sources":["../../../../../src/parsers/manifest/smooth/create_parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH,OAAO,KAAK,EAGV,eAAe,EAEhB,MAAM,UAAU,CAAC;AAIlB,OAAO,KAAK,EAA4B,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAkCpF,MAAM,WAAW,uBAAuB;IACtC,0BAA0B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,wBAAwB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,KAAK,UAAU,EAAE,CAAC,GAAG,SAAS,CAAC;IACzE,eAAe,CAAC,EACZ;QACE,eAAe,EAAE,MAAM,CAAC;QACxB,UAAU,EAAE,MAAM,CAAC;KACpB,GACD,SAAS,CAAC;CACf;AAqBD;;;GAGG;AACH,iBAAS,2BAA2B,CAClC,aAAa,GAAE,uBAA4B,GAC1C,CACD,QAAQ,EAAE,QAAQ,EAClB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,EACxB,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,KACtC,eAAe,CAwkBnB;AAyBD,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"create_parser.d.ts","sourceRoot":"","sources":["../../../../../src/parsers/manifest/smooth/create_parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,OAAO,KAAK,EAGV,eAAe,EAEhB,MAAM,UAAU,CAAC;AAIlB,OAAO,KAAK,EAA4B,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAkCpF,MAAM,WAAW,uBAAuB;IACtC,0BAA0B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,wBAAwB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,KAAK,UAAU,EAAE,CAAC,GAAG,SAAS,CAAC;IACzE,eAAe,CAAC,EACZ;QACE,eAAe,EAAE,MAAM,CAAC;QACxB,UAAU,EAAE,MAAM,CAAC;KACpB,GACD,SAAS,CAAC;CACf;AAqBD;;;GAGG;AACH,iBAAS,2BAA2B,CAClC,aAAa,GAAE,uBAA4B,GAC1C,CACD,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,EACxB,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,KACtC,eAAe,CA6kBnB;AAyBD,eAAe,2BAA2B,CAAC"}
@@ -24,6 +24,7 @@ import getMonotonicTimeStamp from "../../../utils/monotonic_timestamp";
24
24
  import objectAssign from "../../../utils/object_assign";
25
25
  import { hexToBytes } from "../../../utils/string_parsing";
26
26
  import { getFilenameIndexInUrl } from "../../../utils/url-utils";
27
+ import { parseXml } from "../../../utils/xml-parser";
27
28
  import { createBox } from "../../containers/isobmff";
28
29
  import checkManifestIDs from "../utils/check_manifest_ids";
29
30
  import { getAudioCodecs, getVideoCodecs } from "./get_codecs";
@@ -62,7 +63,7 @@ function createSmoothStreamingParser(parserOptions = {}) {
62
63
  ? serverSyncInfos.serverTimestamp - serverSyncInfos.clientTime
63
64
  : undefined;
64
65
  /**
65
- * @param {Element} q
66
+ * @param {Object} q
66
67
  * @param {string} streamType
67
68
  * @return {Object}
68
69
  */
@@ -71,9 +72,9 @@ function createSmoothStreamingParser(parserOptions = {}) {
71
72
  if (qName === "CustomAttributes") {
72
73
  acc.push(...reduceChildren(qNode, (cAttrs, cName, cNode) => {
73
74
  if (cName === "Attribute") {
74
- const name = cNode.getAttribute("Name");
75
- const value = cNode.getAttribute("Value");
76
- if (name !== null && value !== null) {
75
+ const name = cNode.attributes.Name;
76
+ const value = cNode.attributes.Value;
77
+ if (!isNullOrUndefined(name) && !isNullOrUndefined(value)) {
77
78
  cAttrs.push(name + "=" + value);
78
79
  }
79
80
  }
@@ -87,7 +88,7 @@ function createSmoothStreamingParser(parserOptions = {}) {
87
88
  * @returns {string|undefined}
88
89
  */
89
90
  function getAttribute(name) {
90
- const attr = q.getAttribute(name);
91
+ const attr = q.attributes[name];
91
92
  return attr === null ? undefined : attr;
92
93
  }
93
94
  switch (streamType) {
@@ -177,23 +178,23 @@ function createSmoothStreamingParser(parserOptions = {}) {
177
178
  */
178
179
  function parseAdaptation(args) {
179
180
  const { root, timescale, baseUrl, protections, timeShiftBufferDepth, manifestReceivedTime, isLive, } = args;
180
- const timescaleAttr = root.getAttribute("Timescale");
181
- let _timescale = timescaleAttr === null ? timescale : +timescaleAttr;
181
+ const timescaleAttr = root.attributes.Timescale;
182
+ let _timescale = !isNonEmptyString(timescaleAttr) ? timescale : +timescaleAttr;
182
183
  if (isNaN(_timescale)) {
183
184
  _timescale = timescale;
184
185
  }
185
- const typeAttribute = root.getAttribute("Type");
186
- if (typeAttribute === null) {
186
+ const typeAttribute = root.attributes.Type;
187
+ if (isNullOrUndefined(typeAttribute)) {
187
188
  throw new Error("StreamIndex without type.");
188
189
  }
189
190
  if (!arrayIncludes(SUPPORTED_ADAPTATIONS_TYPE, typeAttribute)) {
190
191
  log.warn("smooth", "Unrecognized adaptation type:", typeAttribute);
191
192
  }
192
193
  const adaptationType = typeAttribute;
193
- const subType = root.getAttribute("Subtype");
194
- const language = root.getAttribute("Language");
195
- const UrlAttr = root.getAttribute("Url");
196
- const UrlPathWithTokens = UrlAttr === null ? "" : UrlAttr;
194
+ const subType = root.attributes.Subtype;
195
+ const language = root.attributes.Language;
196
+ const UrlAttr = root.attributes.Url;
197
+ const UrlPathWithTokens = UrlAttr !== null && UrlAttr !== void 0 ? UrlAttr : "";
197
198
  assert(UrlPathWithTokens !== "");
198
199
  const { qualityLevels, cNodes } = reduceChildren(root, (res, _name, node) => {
199
200
  switch (_name) {
@@ -308,24 +309,27 @@ function createSmoothStreamingParser(parserOptions = {}) {
308
309
  }
309
310
  return parsedAdaptation;
310
311
  }
311
- function parseFromDocument(doc, url, manifestReceivedTime) {
312
+ function parseFromNode(xml, url, manifestReceivedTime) {
313
+ const parsed = parseXml(xml);
314
+ const root = parsed[parsed.length - 1];
312
315
  let baseUrl = "";
313
316
  if (url !== undefined) {
314
317
  const filenameIdx = getFilenameIndexInUrl(url);
315
318
  baseUrl = url.substring(0, filenameIdx);
316
319
  }
317
- const root = doc.documentElement;
318
- if (isNullOrUndefined(root) || root.nodeName !== "SmoothStreamingMedia") {
320
+ if (isNullOrUndefined(root) ||
321
+ typeof root === "string" ||
322
+ root.tagName !== "SmoothStreamingMedia") {
319
323
  throw new Error("document root should be SmoothStreamingMedia");
320
324
  }
321
- const majorVersionAttr = root.getAttribute("MajorVersion");
322
- const minorVersionAttr = root.getAttribute("MinorVersion");
323
- if (majorVersionAttr === null ||
324
- minorVersionAttr === null ||
325
+ const majorVersionAttr = root.attributes.MajorVersion;
326
+ const minorVersionAttr = root.attributes.MinorVersion;
327
+ if (isNullOrUndefined(majorVersionAttr) ||
328
+ isNullOrUndefined(minorVersionAttr) ||
325
329
  !/^[2]-[0-2]$/.test(majorVersionAttr + "-" + minorVersionAttr)) {
326
330
  throw new Error("Version should be 2.0, 2.1 or 2.2");
327
331
  }
328
- const timescaleAttr = root.getAttribute("Timescale");
332
+ const timescaleAttr = root.attributes.Timescale;
329
333
  let timescale = !isNonEmptyString(timescaleAttr) ? 10000000 : +timescaleAttr;
330
334
  if (isNaN(timescale)) {
331
335
  timescale = 10000000;
@@ -346,11 +350,11 @@ function createSmoothStreamingParser(parserOptions = {}) {
346
350
  protections: [],
347
351
  });
348
352
  const initialAdaptations = {};
349
- const isLive = parseBoolean(root.getAttribute("IsLive"));
353
+ const isLive = parseBoolean(root.attributes.IsLive);
350
354
  let timeShiftBufferDepth;
351
355
  if (isLive) {
352
- const dvrWindowLength = root.getAttribute("DVRWindowLength");
353
- if (dvrWindowLength !== null &&
356
+ const dvrWindowLength = root.attributes.DVRWindowLength;
357
+ if (!isNullOrUndefined(dvrWindowLength) &&
354
358
  !isNaN(+dvrWindowLength) &&
355
359
  +dvrWindowLength !== 0) {
356
360
  timeShiftBufferDepth = +dvrWindowLength / timescale;
@@ -429,8 +433,8 @@ function createSmoothStreamingParser(parserOptions = {}) {
429
433
  unsafeMaximumTime = Math.max(...lastTimeReferences);
430
434
  }
431
435
  }
432
- const manifestDuration = root.getAttribute("Duration");
433
- const duration = manifestDuration !== null && +manifestDuration !== 0
436
+ const manifestDuration = root.attributes.Duration;
437
+ const duration = !isNullOrUndefined(manifestDuration) && +manifestDuration !== 0
434
438
  ? +manifestDuration / timescale
435
439
  : undefined;
436
440
  if (isLive) {
@@ -496,7 +500,7 @@ function createSmoothStreamingParser(parserOptions = {}) {
496
500
  checkManifestIDs(manifest);
497
501
  return manifest;
498
502
  }
499
- return parseFromDocument;
503
+ return parseFromNode;
500
504
  }
501
505
  /**
502
506
  * @param {string} systemId - Hex string representing the CDM, 16 bytes.
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import type { ITNode } from "../../../utils/xml-parser";
16
17
  interface IHSSManifestSegment {
17
18
  start: number;
18
19
  duration: number;
@@ -20,8 +21,8 @@ interface IHSSManifestSegment {
20
21
  }
21
22
  /**
22
23
  * Parse C nodes to build index timeline.
23
- * @param {Element} nodes
24
+ * @param {Object} nodes
24
25
  */
25
- export default function parseCNodes(nodes: Element[]): IHSSManifestSegment[];
26
+ export default function parseCNodes(nodes: Array<ITNode | string>): IHSSManifestSegment[];
26
27
  export {};
27
28
  //# sourceMappingURL=parse_C_nodes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse_C_nodes.d.ts","sourceRoot":"","sources":["../../../../../src/parsers/manifest/smooth/parse_C_nodes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAuC3E"}
1
+ {"version":3,"file":"parse_C_nodes.d.ts","sourceRoot":"","sources":["../../../../../src/parsers/manifest/smooth/parse_C_nodes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAC5B,mBAAmB,EAAE,CA+CvB"}
@@ -16,13 +16,17 @@
16
16
  import isNonEmptyString from "../../../utils/is_non_empty_string";
17
17
  /**
18
18
  * Parse C nodes to build index timeline.
19
- * @param {Element} nodes
19
+ * @param {Object} nodes
20
20
  */
21
21
  export default function parseCNodes(nodes) {
22
22
  return nodes.reduce((timeline, node, i) => {
23
- const dAttr = node.getAttribute("d");
24
- const tAttr = node.getAttribute("t");
25
- const rAttr = node.getAttribute("r");
23
+ var _a, _b, _c, _d;
24
+ if (typeof node === "string") {
25
+ return timeline;
26
+ }
27
+ const dAttr = (_a = node.attributes.d) !== null && _a !== void 0 ? _a : null;
28
+ const tAttr = (_b = node.attributes.t) !== null && _b !== void 0 ? _b : null;
29
+ const rAttr = (_c = node.attributes.r) !== null && _c !== void 0 ? _c : null;
26
30
  const repeatCount = rAttr !== null ? +rAttr - 1 : 0;
27
31
  let start = tAttr !== null ? +tAttr : undefined;
28
32
  let duration = dAttr !== null ? +dAttr : undefined;
@@ -41,9 +45,14 @@ export default function parseCNodes(nodes) {
41
45
  }
42
46
  }
43
47
  if (duration === undefined || isNaN(duration)) {
44
- const nextNode = nodes[i + 1];
45
- if (nextNode !== undefined) {
46
- const nextTAttr = nextNode.getAttribute("t");
48
+ let nextNodeIdx = i;
49
+ let nextNodeElt;
50
+ do {
51
+ nextNodeIdx++;
52
+ nextNodeElt = nodes[nextNodeIdx];
53
+ } while (nextNodeElt !== undefined && typeof nextNodeElt === "string");
54
+ if (nextNodeElt !== undefined) {
55
+ const nextTAttr = (_d = nextNodeElt.attributes.t) !== null && _d !== void 0 ? _d : null;
47
56
  const nextStart = isNonEmptyString(nextTAttr) ? +nextTAttr : null;
48
57
  if (nextStart === null) {
49
58
  throw new Error("Can't build index timeline from Smooth Manifest.");
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import type { ITNode } from "../../../utils/xml-parser";
16
17
  export interface IKeySystem {
17
18
  systemId: string;
18
19
  privateData: Uint8Array<ArrayBuffer>;
@@ -23,8 +24,8 @@ export interface IContentProtectionSmooth {
23
24
  }
24
25
  /**
25
26
  * Parse "Protection" Node, which contains DRM information
26
- * @param {Element} protectionNode
27
+ * @param {Object} protectionNode
27
28
  * @returns {Object}
28
29
  */
29
- export default function parseProtectionNode(protectionNode: Element, keySystemCreator?: (keyId: Uint8Array) => IKeySystem[]): IContentProtectionSmooth;
30
+ export default function parseProtectionNode(protectionNode: ITNode, keySystemCreator?: (keyId: Uint8Array) => IKeySystem[]): IContentProtectionSmooth;
30
31
  //# sourceMappingURL=parse_protection_node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse_protection_node.d.ts","sourceRoot":"","sources":["../../../../../src/parsers/manifest/smooth/parse_protection_node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAC/B,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAeD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,cAAc,EAAE,OAAO,EACvB,gBAAgB,GAAE,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,EAA4B,GAC9E,wBAAwB,CA+B1B"}
1
+ {"version":3,"file":"parse_protection_node.d.ts","sourceRoot":"","sources":["../../../../../src/parsers/manifest/smooth/parse_protection_node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGxD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAC/B,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAeD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,cAAc,EAAE,MAAM,EACtB,gBAAgB,GAAE,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,EAA4B,GAC9E,wBAAwB,CAsC1B"}
@@ -31,20 +31,29 @@ function createWidevineKeySystem(keyIdBytes) {
31
31
  }
32
32
  /**
33
33
  * Parse "Protection" Node, which contains DRM information
34
- * @param {Element} protectionNode
34
+ * @param {Object} protectionNode
35
35
  * @returns {Object}
36
36
  */
37
37
  export default function parseProtectionNode(protectionNode, keySystemCreator = createWidevineKeySystem) {
38
- if (protectionNode.firstElementChild === null ||
39
- protectionNode.firstElementChild.nodeName !== "ProtectionHeader") {
38
+ var _a;
39
+ let header;
40
+ for (const subNode of protectionNode.children) {
41
+ if (typeof subNode === "string") {
42
+ continue;
43
+ }
44
+ if (subNode.tagName === "ProtectionHeader") {
45
+ header = subNode;
46
+ break;
47
+ }
48
+ }
49
+ if (header === undefined) {
40
50
  throw new Error("Protection should have ProtectionHeader child");
41
51
  }
42
- const header = protectionNode.firstElementChild;
43
- const privateData = base64ToBytes(header.textContent === null ? "" : header.textContent);
52
+ const privateData = base64ToBytes(typeof header.children[0] === "string" ? header.children[0] : "");
44
53
  const keyIdHex = getPlayReadyKIDFromPrivateData(privateData);
45
54
  const keyIdBytes = hexToBytes(keyIdHex);
46
55
  // remove possible braces
47
- const systemIdAttr = header.getAttribute("SystemID");
56
+ const systemIdAttr = (_a = header.attributes.SystemID) !== null && _a !== void 0 ? _a : null;
48
57
  const systemId = (systemIdAttr !== null ? systemIdAttr : "")
49
58
  .toLowerCase()
50
59
  .replace(/\{|\}/g, "");
@@ -17,5 +17,5 @@
17
17
  * @param {*} val
18
18
  * @returns {Boolean}
19
19
  */
20
- export default function parseBoolean(val: string | null): boolean;
20
+ export default function parseBoolean(val: string | null | undefined | boolean): boolean;
21
21
  //# sourceMappingURL=parseBoolean.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parseBoolean.d.ts","sourceRoot":"","sources":["../../../../../../src/parsers/manifest/smooth/utils/parseBoolean.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAQhE"}
1
+ {"version":3,"file":"parseBoolean.d.ts","sourceRoot":"","sources":["../../../../../../src/parsers/manifest/smooth/utils/parseBoolean.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAQtF"}
@@ -13,12 +13,13 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import type { ITNode } from "../../../../utils/xml-parser";
16
17
  /**
17
18
  * Reduce implementation for the children of the given element.
18
- * @param {Element} root
19
+ * @param {Object} root
19
20
  * @param {Function} fn
20
21
  * @param {*} init
21
22
  * @returns {*}
22
23
  */
23
- export default function reduceChildren<T>(root: Element, fn: (accu: T, nodeName: string, nodeElt: Element) => T, init: T): T;
24
+ export default function reduceChildren<T>(root: ITNode, fn: (accu: T, nodeName: string, nodeElt: ITNode) => T, init: T): T;
24
25
  //# sourceMappingURL=reduceChildren.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reduceChildren.d.ts","sourceRoot":"","sources":["../../../../../../src/parsers/manifest/smooth/utils/reduceChildren.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EACtC,IAAI,EAAE,OAAO,EACb,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,CAAC,EACtD,IAAI,EAAE,CAAC,GACN,CAAC,CAQH"}
1
+ {"version":3,"file":"reduceChildren.d.ts","sourceRoot":"","sources":["../../../../../../src/parsers/manifest/smooth/utils/reduceChildren.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EACtC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC,EACrD,IAAI,EAAE,CAAC,GACN,CAAC,CASH"}
@@ -15,17 +15,18 @@
15
15
  */
16
16
  /**
17
17
  * Reduce implementation for the children of the given element.
18
- * @param {Element} root
18
+ * @param {Object} root
19
19
  * @param {Function} fn
20
20
  * @param {*} init
21
21
  * @returns {*}
22
22
  */
23
23
  export default function reduceChildren(root, fn, init) {
24
- let node = root.firstElementChild;
25
24
  let accumulator = init;
26
- while (node !== null) {
27
- accumulator = fn(accumulator, node.nodeName, node);
28
- node = node.nextElementSibling;
25
+ for (const elt of root.children) {
26
+ if (typeof elt === "string") {
27
+ continue;
28
+ }
29
+ accumulator = fn(accumulator, elt.tagName, elt);
29
30
  }
30
31
  return accumulator;
31
32
  }
@@ -1,11 +1,11 @@
1
- import type { IUpdatePlaybackRateWorkerMessage } from "../multithread_types";
1
+ import type { IUpdatePlaybackRateCoreMessage } from "../core/types";
2
2
  import type { ITrackType } from "../public_types";
3
3
  import type { IRange } from "../utils/ranges";
4
4
  import type { IReadOnlySharedReference } from "../utils/reference";
5
5
  import type { CancellationSignal } from "../utils/task_canceller";
6
6
  import type { IFreezingStatus, IReadOnlyPlaybackObserver, IRebufferingStatus } from "./types";
7
7
  import type ObservationPosition from "./utils/observation_position";
8
- export interface IWorkerPlaybackObservation {
8
+ export interface ICorePlaybackObservation {
9
9
  /**
10
10
  * Information on whether the media element was paused at the time of the
11
11
  * Observation.
@@ -64,22 +64,22 @@ export interface IPausedPlaybackObservation {
64
64
  */
65
65
  pending: boolean | undefined;
66
66
  }
67
- export default class WorkerPlaybackObserver implements IReadOnlyPlaybackObserver<IWorkerPlaybackObservation> {
67
+ export default class CorePlaybackObserver implements IReadOnlyPlaybackObserver<ICorePlaybackObservation> {
68
68
  private _src;
69
69
  private _cancelSignal;
70
70
  private _messageSender;
71
71
  private _contentId;
72
- constructor(src: IReadOnlySharedReference<IWorkerPlaybackObservation>, contentId: string, sendMessage: (msg: IUpdatePlaybackRateWorkerMessage) => void, cancellationSignal: CancellationSignal);
72
+ constructor(src: IReadOnlySharedReference<ICorePlaybackObservation>, contentId: string, sendMessage: (msg: IUpdatePlaybackRateCoreMessage) => void, cancellationSignal: CancellationSignal);
73
73
  getCurrentTime(): number | undefined;
74
74
  getReadyState(): number | undefined;
75
75
  getIsPaused(): boolean | undefined;
76
- getReference(): IReadOnlySharedReference<IWorkerPlaybackObservation>;
76
+ getReference(): IReadOnlySharedReference<ICorePlaybackObservation>;
77
77
  setPlaybackRate(playbackRate: number): void;
78
78
  getPlaybackRate(): number | undefined;
79
- listen(cb: (observation: IWorkerPlaybackObservation, stopListening: () => void) => void, params: {
79
+ listen(cb: (observation: ICorePlaybackObservation, stopListening: () => void) => void, params: {
80
80
  includeLastObservation?: boolean | undefined;
81
81
  clearSignal: CancellationSignal;
82
82
  }): void;
83
- deriveReadOnlyObserver<TDest>(transform: (observationRef: IReadOnlySharedReference<IWorkerPlaybackObservation>, cancellationSignal: CancellationSignal) => IReadOnlySharedReference<TDest>): IReadOnlyPlaybackObserver<TDest>;
83
+ deriveReadOnlyObserver<TDest>(transform: (observationRef: IReadOnlySharedReference<ICorePlaybackObservation>, cancellationSignal: CancellationSignal) => IReadOnlySharedReference<TDest>): IReadOnlyPlaybackObserver<TDest>;
84
84
  }
85
- //# sourceMappingURL=worker_playback_observer.d.ts.map
85
+ //# sourceMappingURL=core_playback_observer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core_playback_observer.d.ts","sourceRoot":"","sources":["../../../src/playback_observer/core_playback_observer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,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AO,CAAC,IAAI,CAAqD;IACjE,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,cAAc,CAAgD;IACtE,OAAO,CAAC,UAAU,CAAS;gBAGzB,GAAG,EAAE,wBAAwB,CAAC,wBAAwB,CAAC,EACvD,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,CAAC,GAAG,EAAE,8BAA8B,KAAK,IAAI,EAC1D,kBAAkB,EAAE,kBAAkB;IAQjC,cAAc,IAAI,MAAM,GAAG,SAAS;IAIpC,aAAa,IAAI,MAAM,GAAG,SAAS;IAInC,WAAW,IAAI,OAAO,GAAG,SAAS;IAIlC,YAAY,IAAI,wBAAwB,CAAC,wBAAwB,CAAC;IAIlE,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAQ3C,eAAe,IAAI,MAAM,GAAG,SAAS;IAIrC,MAAM,CACX,EAAE,EAAE,CAAC,WAAW,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,IAAI,KAAK,IAAI,EAC9E,MAAM,EAAE;QACN,sBAAsB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC7C,WAAW,EAAE,kBAAkB,CAAC;KACjC,GACA,IAAI;IAWA,sBAAsB,CAAC,KAAK,EACjC,SAAS,EAAE,CACT,cAAc,EAAE,wBAAwB,CAAC,wBAAwB,CAAC,EAClE,kBAAkB,EAAE,kBAAkB,KACnC,wBAAwB,CAAC,KAAK,CAAC,GACnC,yBAAyB,CAAC,KAAK,CAAC;CAGpC"}
@@ -1,5 +1,5 @@
1
1
  import generateReadOnlyObserver from "./utils/generate_read_only_observer";
2
- export default class WorkerPlaybackObserver {
2
+ export default class CorePlaybackObserver {
3
3
  constructor(src, contentId, sendMessage, cancellationSignal) {
4
4
  this._src = src;
5
5
  this._contentId = contentId;
@@ -20,7 +20,7 @@ export default class WorkerPlaybackObserver {
20
20
  }
21
21
  setPlaybackRate(playbackRate) {
22
22
  this._messageSender({
23
- type: "update-playback-rate" /* WorkerMessageType.UpdatePlaybackRate */,
23
+ type: "update-playback-rate" /* CoreMessageType.UpdatePlaybackRate */,
24
24
  contentId: this._contentId,
25
25
  value: playbackRate,
26
26
  });
@@ -1 +1 @@
1
- {"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../../../src/transports/smooth/pipelines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,OAAO,KAAK,EAgBV,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAUlB,MAAM,CAAC,OAAO,WAAW,gBAAgB,EAAE,iBAAiB,GAAG,mBAAmB,CA+XjF"}
1
+ {"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../../../src/transports/smooth/pipelines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,OAAO,KAAK,EAgBV,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAUlB,MAAM,CAAC,OAAO,WAAW,gBAAgB,EAAE,iBAAiB,GAAG,mBAAmB,CA2XjF"}
@@ -17,6 +17,8 @@ import log from "../../log";
17
17
  import Manifest from "../../manifest/classes";
18
18
  import { getMDAT } from "../../parsers/containers/isobmff";
19
19
  import createSmoothManifestParser from "../../parsers/manifest/smooth";
20
+ import globalScope from "../../utils/global_scope";
21
+ import isNullOrUndefined from "../../utils/is_null_or_undefined";
20
22
  import request from "../../utils/request";
21
23
  import { strToUtf8, utf8ToStr } from "../../utils/string_parsing";
22
24
  import addQueryString from "../utils/add_query_string";
@@ -40,9 +42,7 @@ export default function (transportOptions) {
40
42
  var _a;
41
43
  const url = (_a = manifestData.url) !== null && _a !== void 0 ? _a : parserOptions.originalUrl;
42
44
  const { receivedTime: manifestReceivedTime, responseData } = manifestData;
43
- const documentData = typeof responseData === "string"
44
- ? new DOMParser().parseFromString(responseData, "text/xml")
45
- : responseData; // TODO find a way to check if Document?
45
+ const documentData = getManifestAsString(responseData);
46
46
  const parserResult = smoothManifestParser(documentData, url, manifestReceivedTime);
47
47
  const manifest = new Manifest(parserResult, {
48
48
  representationFilter: transportOptions.representationFilter,
@@ -334,3 +334,25 @@ export default function (transportOptions) {
334
334
  },
335
335
  };
336
336
  }
337
+ /**
338
+ * Try to convert a Manifest from an unknown format to a JS string format.
339
+ *
340
+ * Throws if the format cannot be converted.
341
+ * @param {*} manifestSrc
342
+ * @returns {Array.<Object | string>}
343
+ */
344
+ function getManifestAsString(manifestSrc) {
345
+ if (manifestSrc instanceof ArrayBuffer) {
346
+ return utf8ToStr(new Uint8Array(manifestSrc));
347
+ }
348
+ else if (typeof manifestSrc === "string") {
349
+ return manifestSrc;
350
+ }
351
+ else if (!isNullOrUndefined(globalScope.Document) &&
352
+ manifestSrc instanceof globalScope.Document) {
353
+ return manifestSrc.documentElement.outerHTML;
354
+ }
355
+ else {
356
+ throw new Error("Smooth Manifest Parser: Unrecognized Manifest format");
357
+ }
358
+ }