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

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 (407) hide show
  1. package/CHANGELOG.md +11 -227
  2. package/FILES.md +1 -1
  3. package/VERSION +1 -1
  4. package/dist/_esm5.processed/compat/add_text_track.d.ts +1 -3
  5. package/dist/_esm5.processed/compat/add_text_track.js +4 -7
  6. package/dist/_esm5.processed/compat/browser_compatibility_types.d.ts +0 -7
  7. package/dist/_esm5.processed/compat/event_listeners.d.ts +2 -15
  8. package/dist/_esm5.processed/compat/event_listeners.js +2 -37
  9. package/dist/_esm5.processed/compat/index.d.ts +1 -3
  10. package/dist/_esm5.processed/compat/index.js +1 -3
  11. package/dist/_esm5.processed/config.d.ts +9 -21
  12. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +0 -58
  13. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +14 -54
  14. package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.d.ts +2 -8
  15. package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.js +2 -11
  16. package/dist/_esm5.processed/core/api/debug/buffer_graph.js +2 -6
  17. package/dist/_esm5.processed/core/api/debug/modules/general_info.js +13 -32
  18. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +3 -3
  19. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.js +1 -1
  20. package/dist/_esm5.processed/core/api/option_utils.d.ts +12 -35
  21. package/dist/_esm5.processed/core/api/option_utils.js +41 -230
  22. package/dist/_esm5.processed/core/api/public_api.d.ts +91 -266
  23. package/dist/_esm5.processed/core/api/public_api.js +439 -805
  24. package/dist/_esm5.processed/core/{segment_buffers/implementations/image → api/track_management}/index.d.ts +3 -2
  25. package/dist/_esm5.processed/core/{segment_buffers/implementations/image → api/track_management}/index.js +3 -2
  26. package/dist/_esm5.processed/core/api/{tracks_management/media_element_track_choice_manager.d.ts → track_management/media_element_tracks_store.d.ts} +15 -75
  27. package/dist/_esm5.processed/core/api/{tracks_management/media_element_track_choice_manager.js → track_management/media_element_tracks_store.js} +74 -193
  28. package/dist/_esm5.processed/core/api/track_management/track_dispatcher.d.ts +84 -0
  29. package/dist/_esm5.processed/core/api/track_management/track_dispatcher.js +158 -0
  30. package/dist/_esm5.processed/core/api/track_management/tracks_store.d.ts +406 -0
  31. package/dist/_esm5.processed/core/api/track_management/tracks_store.js +932 -0
  32. package/dist/_esm5.processed/core/api/utils.d.ts +1 -0
  33. package/dist/_esm5.processed/core/api/utils.js +28 -11
  34. package/dist/_esm5.processed/core/decrypt/content_decryptor.js +3 -3
  35. package/dist/_esm5.processed/core/decrypt/find_key_system.js +83 -71
  36. package/dist/_esm5.processed/core/decrypt/get_media_keys.js +6 -5
  37. package/dist/_esm5.processed/core/decrypt/session_events_listener.js +10 -72
  38. package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.d.ts +4 -4
  39. package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.js +6 -4
  40. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +1 -3
  41. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +7 -26
  42. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +3 -9
  43. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +16 -9
  44. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -3
  45. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +1 -1
  46. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.d.ts +1 -6
  47. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +4 -41
  48. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +1 -1
  49. package/dist/_esm5.processed/core/init/media_source_content_initializer.d.ts +1 -8
  50. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +5 -19
  51. package/dist/_esm5.processed/core/init/types.d.ts +5 -15
  52. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +2 -36
  53. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +2 -82
  54. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +1 -2
  55. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +2 -3
  56. package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +2 -2
  57. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
  58. package/dist/_esm5.processed/core/segment_buffers/index.js +2 -1
  59. package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +1 -0
  60. package/dist/_esm5.processed/core/segment_buffers/inventory/index.js +1 -0
  61. package/dist/_esm5.processed/core/segment_buffers/inventory/utils.d.ts +33 -0
  62. package/dist/_esm5.processed/core/segment_buffers/inventory/utils.js +49 -0
  63. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.d.ts +0 -1
  64. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +2 -16
  65. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +0 -15
  66. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +183 -93
  67. package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.d.ts +39 -0
  68. package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.js +133 -0
  69. package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +27 -13
  70. package/dist/_esm5.processed/core/stream/index.d.ts +2 -3
  71. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +2 -0
  72. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +5 -7
  73. package/dist/_esm5.processed/core/stream/period/period_stream.js +13 -12
  74. package/dist/_esm5.processed/core/stream/period/types.d.ts +5 -14
  75. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +2 -4
  76. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.js +10 -46
  77. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +29 -23
  78. package/dist/_esm5.processed/core/stream/representation/types.d.ts +11 -1
  79. package/dist/_esm5.processed/default_config.d.ts +35 -98
  80. package/dist/_esm5.processed/default_config.js +36 -113
  81. package/dist/_esm5.processed/errors/custom_loader_error.d.ts +1 -3
  82. package/dist/_esm5.processed/errors/custom_loader_error.js +1 -3
  83. package/dist/_esm5.processed/errors/media_error.js +2 -2
  84. package/dist/_esm5.processed/errors/network_error.d.ts +0 -1
  85. package/dist/_esm5.processed/errors/network_error.js +0 -1
  86. package/dist/_esm5.processed/errors/request_error.d.ts +2 -3
  87. package/dist/_esm5.processed/errors/request_error.js +2 -5
  88. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -3
  89. package/dist/_esm5.processed/features/features_object.js +0 -2
  90. package/dist/_esm5.processed/features/list/directfile.js +2 -5
  91. package/dist/_esm5.processed/features/list/index.d.ts +0 -2
  92. package/dist/_esm5.processed/features/list/index.js +0 -2
  93. package/dist/_esm5.processed/features/types.d.ts +3 -27
  94. package/dist/_esm5.processed/manifest/adaptation.d.ts +9 -11
  95. package/dist/_esm5.processed/manifest/adaptation.js +41 -30
  96. package/dist/_esm5.processed/manifest/index.d.ts +3 -4
  97. package/dist/_esm5.processed/manifest/manifest.d.ts +5 -54
  98. package/dist/_esm5.processed/manifest/manifest.js +5 -110
  99. package/dist/_esm5.processed/manifest/period.d.ts +4 -5
  100. package/dist/_esm5.processed/manifest/representation.d.ts +10 -5
  101. package/dist/_esm5.processed/manifest/representation.js +15 -5
  102. package/dist/_esm5.processed/manifest/representation_index/index.d.ts +2 -2
  103. package/dist/_esm5.processed/manifest/representation_index/static.d.ts +2 -0
  104. package/dist/_esm5.processed/manifest/representation_index/static.js +6 -0
  105. package/dist/_esm5.processed/manifest/representation_index/types.d.ts +42 -21
  106. package/dist/_esm5.processed/manifest/types.d.ts +0 -2
  107. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +17 -31
  108. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +26 -19
  109. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +2 -0
  110. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +7 -1
  111. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +2 -6
  112. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +11 -8
  113. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +2 -0
  114. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +6 -0
  115. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +2 -2
  116. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.js +1 -6
  117. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +3 -5
  118. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +0 -2
  119. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +1 -1
  120. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +2 -2
  121. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +0 -2
  122. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +2 -2
  123. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +10 -6
  124. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +4 -2
  125. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.d.ts +10 -1
  126. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.js +18 -2
  127. package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +4 -4
  128. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +3 -6
  129. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +1 -2
  130. package/dist/_esm5.processed/parsers/manifest/local/representation_index.d.ts +2 -0
  131. package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +6 -0
  132. package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +6 -6
  133. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.d.ts +12 -3
  134. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.js +11 -2
  135. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +0 -1
  136. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +11 -17
  137. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +21 -83
  138. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +53 -125
  139. package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.d.ts +119 -0
  140. package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.js +159 -0
  141. package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.d.ts +3 -6
  142. package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.js +4 -4
  143. package/dist/_esm5.processed/parsers/manifest/types.d.ts +3 -3
  144. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_extent.js +1 -8
  145. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_origin.js +1 -9
  146. package/dist/_esm5.processed/public_types.d.ts +396 -308
  147. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.d.ts +5 -4
  148. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +5 -4
  149. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +4 -4
  150. package/dist/_esm5.processed/transports/dash/manifest_parser.js +2 -3
  151. package/dist/_esm5.processed/transports/dash/pipelines.js +1 -4
  152. package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +2 -2
  153. package/dist/_esm5.processed/transports/dash/segment_loader.js +26 -20
  154. package/dist/_esm5.processed/transports/dash/segment_parser.js +19 -24
  155. package/dist/_esm5.processed/transports/dash/text_loader.js +5 -5
  156. package/dist/_esm5.processed/transports/dash/text_parser.js +28 -33
  157. package/dist/_esm5.processed/transports/local/pipelines.js +1 -10
  158. package/dist/_esm5.processed/transports/local/segment_loader.js +2 -2
  159. package/dist/_esm5.processed/transports/local/segment_parser.d.ts +1 -1
  160. package/dist/_esm5.processed/transports/local/segment_parser.js +10 -10
  161. package/dist/_esm5.processed/transports/local/text_parser.d.ts +2 -2
  162. package/dist/_esm5.processed/transports/local/text_parser.js +23 -23
  163. package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +34 -52
  164. package/dist/_esm5.processed/{utils/list_to_map.d.ts → transports/smooth/is_mp4_embedded_track.d.ts} +5 -5
  165. package/dist/_esm5.processed/{features/list/image_buffer.d.ts → transports/smooth/is_mp4_embedded_track.js} +7 -6
  166. package/dist/_esm5.processed/transports/smooth/pipelines.js +33 -190
  167. package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +1 -1
  168. package/dist/_esm5.processed/transports/smooth/segment_loader.js +28 -22
  169. package/dist/_esm5.processed/transports/smooth/utils.d.ts +1 -26
  170. package/dist/_esm5.processed/transports/smooth/utils.js +1 -55
  171. package/dist/_esm5.processed/transports/types.d.ts +94 -89
  172. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +3 -3
  173. package/dist/_esm5.processed/transports/utils/infer_segment_container.d.ts +3 -3
  174. package/dist/_esm5.processed/transports/utils/infer_segment_container.js +5 -7
  175. package/dist/_esm5.processed/transports/utils/parse_text_track.d.ts +8 -12
  176. package/dist/_esm5.processed/transports/utils/parse_text_track.js +19 -21
  177. package/dist/_esm5.processed/utils/array_includes.d.ts +2 -1
  178. package/dist/_esm5.processed/utils/array_includes.js +30 -28
  179. package/dist/_esm5.processed/utils/request/xhr.js +5 -5
  180. package/dist/commonjs/compat/is_codec_supported.js +22 -1
  181. package/dist/commonjs/config.d.ts +1 -0
  182. package/dist/commonjs/core/api/debug/buffer_graph.js +2 -6
  183. package/dist/commonjs/core/api/debug/modules/general_info.js +17 -10
  184. package/dist/commonjs/core/api/option_utils.d.ts +2 -0
  185. package/dist/commonjs/core/api/option_utils.js +2 -3
  186. package/dist/commonjs/core/api/public_api.d.ts +9 -0
  187. package/dist/commonjs/core/api/public_api.js +34 -9
  188. package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
  189. package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.js +11 -3
  190. package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts +8 -1
  191. package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +8 -4
  192. package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
  193. package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
  194. package/dist/commonjs/core/init/directfile_content_initializer.js +24 -7
  195. package/dist/commonjs/core/init/media_source_content_initializer.d.ts +6 -0
  196. package/dist/commonjs/core/init/media_source_content_initializer.js +4 -6
  197. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  198. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.js +16 -17
  199. package/dist/commonjs/core/init/utils/get_initial_time.d.ts +17 -3
  200. package/dist/commonjs/core/init/utils/get_initial_time.js +9 -7
  201. package/dist/commonjs/core/stream/representation/utils/get_buffer_status.js +3 -3
  202. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +1 -1
  203. package/dist/commonjs/default_config.d.ts +5 -0
  204. package/dist/commonjs/default_config.js +5 -0
  205. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
  206. package/dist/commonjs/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
  207. package/dist/commonjs/manifest/representation_index/static.d.ts +1 -1
  208. package/dist/commonjs/manifest/representation_index/static.js +2 -2
  209. package/dist/commonjs/manifest/representation_index/types.d.ts +4 -4
  210. package/dist/commonjs/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
  211. package/dist/commonjs/parsers/manifest/dash/common/indexes/base.js +4 -3
  212. package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  213. package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  214. package/dist/commonjs/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  215. package/dist/commonjs/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
  216. package/dist/commonjs/parsers/manifest/dash/common/indexes/list.js +2 -2
  217. package/dist/commonjs/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
  218. package/dist/commonjs/parsers/manifest/dash/common/indexes/template.js +42 -29
  219. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  220. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
  221. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +250 -51
  222. package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  223. package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  224. package/dist/commonjs/parsers/manifest/dash/common/parse_adaptation_sets.js +13 -10
  225. package/dist/commonjs/parsers/manifest/dash/common/parse_mpd.js +27 -14
  226. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  227. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +17 -18
  228. package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
  229. package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.js +21 -8
  230. package/dist/commonjs/parsers/manifest/dash/common/parse_representations.js +7 -3
  231. package/dist/commonjs/parsers/manifest/local/representation_index.d.ts +1 -1
  232. package/dist/commonjs/parsers/manifest/local/representation_index.js +3 -3
  233. package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
  234. package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.js +2 -2
  235. package/dist/commonjs/parsers/manifest/smooth/representation_index.d.ts +5 -5
  236. package/dist/commonjs/parsers/manifest/smooth/representation_index.js +25 -9
  237. package/dist/commonjs/parsers/manifest/utils/index_helpers.js +1 -1
  238. package/dist/commonjs/public_types.d.ts +78 -34
  239. package/dist/commonjs/transports/dash/init_segment_loader.js +10 -5
  240. package/dist/commonjs/transports/dash/manifest_parser.js +5 -2
  241. package/dist/commonjs/transports/dash/segment_loader.js +2 -1
  242. package/dist/commonjs/transports/dash/text_loader.js +2 -0
  243. package/dist/commonjs/transports/metaplaylist/manifest_loader.js +2 -1
  244. package/dist/commonjs/transports/metaplaylist/pipelines.js +4 -1
  245. package/dist/commonjs/transports/smooth/pipelines.js +4 -2
  246. package/dist/commonjs/transports/smooth/segment_loader.js +2 -1
  247. package/dist/commonjs/transports/types.d.ts +12 -0
  248. package/dist/commonjs/transports/utils/generate_manifest_loader.js +6 -3
  249. package/dist/commonjs/utils/request/fetch.d.ts +6 -0
  250. package/dist/commonjs/utils/request/fetch.js +29 -8
  251. package/dist/commonjs/utils/request/xhr.d.ts +11 -5
  252. package/dist/commonjs/utils/request/xhr.js +29 -8
  253. package/dist/es2017/compat/is_codec_supported.js +22 -1
  254. package/dist/es2017/config.d.ts +1 -0
  255. package/dist/es2017/core/api/debug/buffer_graph.js +2 -6
  256. package/dist/es2017/core/api/debug/modules/general_info.js +17 -10
  257. package/dist/es2017/core/api/option_utils.d.ts +2 -0
  258. package/dist/es2017/core/api/option_utils.js +2 -3
  259. package/dist/es2017/core/api/public_api.d.ts +9 -0
  260. package/dist/es2017/core/api/public_api.js +33 -8
  261. package/dist/es2017/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
  262. package/dist/es2017/core/fetchers/manifest/manifest_fetcher.js +11 -3
  263. package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts +8 -1
  264. package/dist/es2017/core/fetchers/segment/segment_fetcher.js +8 -4
  265. package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
  266. package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
  267. package/dist/es2017/core/init/directfile_content_initializer.js +24 -7
  268. package/dist/es2017/core/init/media_source_content_initializer.d.ts +6 -0
  269. package/dist/es2017/core/init/media_source_content_initializer.js +4 -6
  270. package/dist/es2017/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  271. package/dist/es2017/core/init/utils/content_time_boundaries_observer.js +16 -15
  272. package/dist/es2017/core/init/utils/get_initial_time.d.ts +17 -3
  273. package/dist/es2017/core/init/utils/get_initial_time.js +9 -7
  274. package/dist/es2017/core/stream/representation/utils/get_buffer_status.js +3 -3
  275. package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -1
  276. package/dist/es2017/default_config.d.ts +5 -0
  277. package/dist/es2017/default_config.js +5 -0
  278. package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
  279. package/dist/es2017/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
  280. package/dist/es2017/manifest/representation_index/static.d.ts +1 -1
  281. package/dist/es2017/manifest/representation_index/static.js +2 -2
  282. package/dist/es2017/manifest/representation_index/types.d.ts +4 -4
  283. package/dist/es2017/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
  284. package/dist/es2017/parsers/manifest/dash/common/indexes/base.js +4 -3
  285. package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  286. package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  287. package/dist/es2017/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  288. package/dist/es2017/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
  289. package/dist/es2017/parsers/manifest/dash/common/indexes/list.js +2 -2
  290. package/dist/es2017/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
  291. package/dist/es2017/parsers/manifest/dash/common/indexes/template.js +40 -27
  292. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  293. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
  294. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +246 -51
  295. package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  296. package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  297. package/dist/es2017/parsers/manifest/dash/common/parse_adaptation_sets.js +11 -8
  298. package/dist/es2017/parsers/manifest/dash/common/parse_mpd.js +27 -13
  299. package/dist/es2017/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  300. package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +13 -16
  301. package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
  302. package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.js +10 -8
  303. package/dist/es2017/parsers/manifest/dash/common/parse_representations.js +7 -3
  304. package/dist/es2017/parsers/manifest/local/representation_index.d.ts +1 -1
  305. package/dist/es2017/parsers/manifest/local/representation_index.js +3 -3
  306. package/dist/es2017/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
  307. package/dist/es2017/parsers/manifest/metaplaylist/representation_index.js +2 -2
  308. package/dist/es2017/parsers/manifest/smooth/representation_index.d.ts +5 -5
  309. package/dist/es2017/parsers/manifest/smooth/representation_index.js +25 -9
  310. package/dist/es2017/parsers/manifest/utils/index_helpers.js +1 -1
  311. package/dist/es2017/public_types.d.ts +78 -34
  312. package/dist/es2017/transports/dash/init_segment_loader.js +5 -0
  313. package/dist/es2017/transports/dash/manifest_parser.js +3 -0
  314. package/dist/es2017/transports/dash/segment_loader.js +1 -0
  315. package/dist/es2017/transports/dash/text_loader.js +2 -0
  316. package/dist/es2017/transports/metaplaylist/manifest_loader.js +1 -0
  317. package/dist/es2017/transports/metaplaylist/pipelines.js +4 -1
  318. package/dist/es2017/transports/smooth/pipelines.js +2 -0
  319. package/dist/es2017/transports/smooth/segment_loader.js +1 -0
  320. package/dist/es2017/transports/types.d.ts +12 -0
  321. package/dist/es2017/transports/utils/generate_manifest_loader.js +3 -0
  322. package/dist/es2017/utils/request/fetch.d.ts +6 -0
  323. package/dist/es2017/utils/request/fetch.js +29 -8
  324. package/dist/es2017/utils/request/xhr.d.ts +11 -5
  325. package/dist/es2017/utils/request/xhr.js +30 -9
  326. package/dist/rx-player.js +723 -376
  327. package/dist/rx-player.min.js +1 -1
  328. package/package.json +3 -4
  329. package/scripts/update-version +2 -0
  330. package/sonar-project.properties +1 -1
  331. package/src/compat/is_codec_supported.ts +23 -1
  332. package/src/core/api/debug/buffer_graph.ts +2 -5
  333. package/src/core/api/debug/modules/general_info.ts +15 -10
  334. package/src/core/api/option_utils.ts +3 -3
  335. package/src/core/api/public_api.ts +35 -7
  336. package/src/core/fetchers/manifest/manifest_fetcher.ts +21 -3
  337. package/src/core/fetchers/segment/segment_fetcher.ts +19 -5
  338. package/src/core/fetchers/segment/segment_fetcher_creator.ts +1 -0
  339. package/src/core/fetchers/utils/schedule_request.ts +1 -1
  340. package/src/core/init/directfile_content_initializer.ts +23 -7
  341. package/src/core/init/media_source_content_initializer.ts +13 -7
  342. package/src/core/init/utils/content_time_boundaries_observer.ts +23 -22
  343. package/src/core/init/utils/get_initial_time.ts +25 -12
  344. package/src/core/stream/representation/utils/get_buffer_status.ts +3 -3
  345. package/src/core/stream/representation/utils/get_needed_segments.ts +2 -2
  346. package/src/default_config.ts +5 -0
  347. package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +3 -1
  348. package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +2 -0
  349. package/src/manifest/representation_index/static.ts +2 -2
  350. package/src/manifest/representation_index/types.ts +4 -4
  351. package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +182 -36
  352. package/src/parsers/manifest/dash/common/indexes/base.ts +12 -4
  353. package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +19 -5
  354. package/src/parsers/manifest/dash/common/indexes/index.ts +16 -4
  355. package/src/parsers/manifest/dash/common/indexes/list.ts +2 -2
  356. package/src/parsers/manifest/dash/common/indexes/template.ts +52 -31
  357. package/src/parsers/manifest/dash/common/indexes/timeline/index.ts +4 -1
  358. package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +366 -60
  359. package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +63 -25
  360. package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +10 -4
  361. package/src/parsers/manifest/dash/common/parse_mpd.ts +28 -15
  362. package/src/parsers/manifest/dash/common/parse_periods.ts +12 -17
  363. package/src/parsers/manifest/dash/common/parse_representation_index.ts +50 -26
  364. package/src/parsers/manifest/dash/common/parse_representations.ts +9 -3
  365. package/src/parsers/manifest/local/representation_index.ts +3 -3
  366. package/src/parsers/manifest/metaplaylist/representation_index.ts +2 -2
  367. package/src/parsers/manifest/smooth/representation_index.ts +23 -9
  368. package/src/parsers/manifest/utils/__tests__/get_first_time_from_adaptations.test.ts +1 -1
  369. package/src/parsers/manifest/utils/__tests__/get_last_time_from_adaptation.test.ts +1 -1
  370. package/src/parsers/manifest/utils/index_helpers.ts +1 -1
  371. package/src/public_types.ts +79 -34
  372. package/src/transports/dash/init_segment_loader.ts +5 -0
  373. package/src/transports/dash/manifest_parser.ts +6 -0
  374. package/src/transports/dash/segment_loader.ts +1 -0
  375. package/src/transports/dash/text_loader.ts +2 -0
  376. package/src/transports/metaplaylist/manifest_loader.ts +1 -0
  377. package/src/transports/metaplaylist/pipelines.ts +4 -1
  378. package/src/transports/smooth/pipelines.ts +2 -0
  379. package/src/transports/smooth/segment_loader.ts +1 -0
  380. package/src/transports/types.ts +12 -0
  381. package/src/transports/utils/generate_manifest_loader.ts +3 -0
  382. package/src/utils/request/fetch.ts +35 -8
  383. package/src/utils/request/xhr.ts +45 -14
  384. package/dist/_esm5.processed/compat/fullscreen.d.ts +0 -32
  385. package/dist/_esm5.processed/compat/fullscreen.js +0 -78
  386. package/dist/_esm5.processed/compat/is_offline.d.ts +0 -39
  387. package/dist/_esm5.processed/compat/is_offline.js +0 -43
  388. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.d.ts +0 -258
  389. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +0 -989
  390. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.d.ts +0 -75
  391. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +0 -133
  392. package/dist/_esm5.processed/features/list/bif_parser.d.ts +0 -23
  393. package/dist/_esm5.processed/features/list/bif_parser.js +0 -27
  394. package/dist/_esm5.processed/features/list/image_buffer.js +0 -25
  395. package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +0 -38
  396. package/dist/_esm5.processed/transports/dash/image_pipelines.js +0 -129
  397. package/dist/_esm5.processed/utils/list_to_map.js +0 -28
  398. package/dist/_esm5.processed/utils/simple_set.d.ts +0 -51
  399. package/dist/_esm5.processed/utils/simple_set.js +0 -57
  400. package/dist/_esm5.processed/utils/uniq.d.ts +0 -36
  401. package/dist/_esm5.processed/utils/uniq.js +0 -43
  402. package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  403. package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.js +0 -54
  404. package/dist/es2017/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  405. package/dist/es2017/parsers/manifest/utils/is_segment_still_available.js +0 -51
  406. package/src/parsers/manifest/utils/is_segment_still_available.ts +0 -58
  407. package/src/typings/object-assign.d.ts +0 -48
@@ -14,9 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { IInbandEvent } from "../core/stream";
17
- import Manifest, { Adaptation, ISegment, ISupplementaryImageTrack, ISupplementaryTextTrack, Period, Representation } from "../manifest";
17
+ import Manifest, { ISegment } from "../manifest";
18
18
  import { ICdnMetadata } from "../parsers/manifest";
19
- import { IBifThumbnail, ILoadedManifestFormat, IManifestLoader, IRepresentationFilter, ISegmentLoader as ICustomSegmentLoader, IServerSyncInfos } from "../public_types";
19
+ import { ITrackType, ILoadedManifestFormat, IManifestLoader, IRepresentationFilter, ISegmentLoader as ICustomSegmentLoader, IServerSyncInfos } from "../public_types";
20
20
  import TaskCanceller, { CancellationSignal } from "../utils/task_canceller";
21
21
  /**
22
22
  * Interface returned by any transport implementation.
@@ -39,8 +39,6 @@ export interface ITransportPipelines {
39
39
  video: ISegmentPipeline<ILoadedAudioVideoSegmentFormat, Uint8Array | ArrayBuffer | null>;
40
40
  /** Functions allowing to load an parse text (e.g. subtitles) segments. */
41
41
  text: ISegmentPipeline<ILoadedTextSegmentFormat, ITextTrackSegmentData | null>;
42
- /** Functions allowing to load an parse image (e.g. thumbnails) segments. */
43
- image: ISegmentPipeline<ILoadedImageSegmentFormat, IImageTrackSegmentData | null>;
44
42
  }
45
43
  /** Functions allowing to load and parse the Manifest. */
46
44
  export interface ITransportManifestPipeline {
@@ -124,36 +122,6 @@ export interface ITransportManifestPipeline {
124
122
  * `CancellationError` instance instead.
125
123
  */
126
124
  parseManifest: (manifestData: IRequestedData<unknown>, parserOptions: IManifestParserOptions, onWarnings: (warnings: Error[]) => void, cancelSignal: CancellationSignal, scheduleRequest: IManifestParserRequestScheduler) => IManifestParserResult | Promise<IManifestParserResult>;
127
- /**
128
- * @deprecated
129
- * "Resolves the Manifest's URL, to obtain its true URL.
130
- * This is a deprecated function which corresponds to an old use case at
131
- * Canal+ where the URL of the Manifest first need to be parsed from a .wsx
132
- * file.
133
- * Thankfully this API should not be used anymore, though to not break
134
- * compatibility, we have to keep it until a v4.x.x release.
135
- *
136
- * @param {string | undefined} url - URL used to obtain the real URL of the
137
- * Manifest.
138
- * @param {CancellationSignal} cancelSignal - Cancellation signal which will
139
- * allow to abort the resolving operation if you do not want the Manifest
140
- * anymore.
141
- * When cancelled, the promise returned by this function will reject with a
142
- * `CancellationError`.
143
- * @returns {Promise.<string|undefined>} - Promise emitting the "real" URL of
144
- * the Manifest, that should be loaded by the `loadManifest` function.
145
- * `undefined` if the URL is either unknown or inexistant.
146
- *
147
- * Rejects in two cases:
148
- *
149
- * 1. The resolving operation has been aborted through the `cancelSignal`
150
- * given in argument.
151
- * In that case, this Promise will reject a `CancellationError`.
152
- *
153
- * 2. The resolving operation failed, most likely due to a request error.
154
- * In that case, this Promise will reject the corresponding Error.
155
- */
156
- resolveManifestUrl?: (url: string | undefined, cancelSignal: CancellationSignal) => Promise<string | undefined>;
157
125
  }
158
126
  /**
159
127
  * Options given to the `loadManifest` method of an
@@ -179,7 +147,7 @@ export interface ISegmentPipeline<TLoadedFormat, TParsedSegmentDataFormat> {
179
147
  * segment should be downloaded.
180
148
  * `null` if we do not have such CDN (in which case the segment should be loaded
181
149
  * through other means, such as information taken from the segment's content).
182
- * @param {Object} content - Content linked to the wanted segment.
150
+ * @param {Object} context - Context linked to the wanted segment.
183
151
  * @param {CancellationSignal} cancelSignal - Cancellation signal which will
184
152
  * allow to cancel the loading operation if the segment is not needed anymore.
185
153
  *
@@ -190,7 +158,7 @@ export interface ISegmentPipeline<TLoadedFormat, TParsedSegmentDataFormat> {
190
158
  * @returns {Promise.<Object>} - Promise resolving when it has finished loading
191
159
  * the segment.
192
160
  */
193
- export type ISegmentLoader<TLoadedFormat> = (wantedCdn: ICdnMetadata | null, content: ISegmentContext, options: ISegmentLoaderOptions, cancelSignal: CancellationSignal, callbacks: ISegmentLoaderCallbacks<TLoadedFormat>) => Promise<ISegmentLoaderResultSegmentCreated<TLoadedFormat> | ISegmentLoaderResultSegmentLoaded<TLoadedFormat> | ISegmentLoaderResultChunkedComplete>;
161
+ export type ISegmentLoader<TLoadedFormat> = (wantedCdn: ICdnMetadata | null, context: ISegmentContext, options: ISegmentLoaderOptions, cancelSignal: CancellationSignal, callbacks: ISegmentLoaderCallbacks<TLoadedFormat>) => Promise<ISegmentLoaderResultSegmentCreated<TLoadedFormat> | ISegmentLoaderResultSegmentLoaded<TLoadedFormat> | ISegmentLoaderResultChunkedComplete>;
194
162
  /** Options given to an `ISegmentLoader` to configure its behavior. */
195
163
  export interface ISegmentLoaderOptions {
196
164
  /**
@@ -220,7 +188,7 @@ loadedSegment: {
220
188
  isChunked: boolean;
221
189
  },
222
190
  /** Context about the wanted segment. */
223
- content: ISegmentContext,
191
+ context: ISegmentContext,
224
192
  /**
225
193
  * "Timescale" obtained from parsing the wanted representation's initialization
226
194
  * segment.
@@ -369,14 +337,6 @@ export interface ITextTrackSegmentData {
369
337
  /** end time until which the segment apply, in seconds. */
370
338
  end?: number | undefined;
371
339
  }
372
- /** Format under which image data is decodable by the RxPlayer. */
373
- export interface IImageTrackSegmentData {
374
- data: IBifThumbnail[];
375
- end: number;
376
- start: number;
377
- timescale: number;
378
- type: string;
379
- }
380
340
  export type IManifestParserRequest1 = ((
381
341
  /**
382
342
  * Cancellation signal which will allow to cancel the request if the
@@ -405,23 +365,33 @@ export interface ITransportTextSegmentPipeline {
405
365
  loadSegment: ISegmentLoader<ILoadedTextSegmentFormat>;
406
366
  parseSegment: ISegmentParser<ILoadedTextSegmentFormat, ITextTrackSegmentData | null>;
407
367
  }
408
- export interface ITransportImageSegmentPipeline {
409
- loadSegment: ISegmentLoader<ILoadedImageSegmentFormat>;
410
- parseSegment: ISegmentParser<ILoadedImageSegmentFormat, IImageTrackSegmentData | null>;
411
- }
412
- export type ITransportSegmentPipeline = ITransportAudioVideoSegmentPipeline | ITransportTextSegmentPipeline | ITransportImageSegmentPipeline;
368
+ export type ITransportSegmentPipeline = ITransportAudioVideoSegmentPipeline | ITransportTextSegmentPipeline;
413
369
  export type ITransportPipeline = ITransportManifestPipeline | ITransportSegmentPipeline;
414
370
  export interface ISegmentContext {
415
- /** Manifest object related to this segment. */
416
- manifest: Manifest;
417
- /** Period object related to this segment. */
418
- period: Period;
419
- /** Adaptation object related to this segment. */
420
- adaptation: Adaptation;
421
- /** Representation Object related to this segment. */
422
- representation: Representation;
423
- /** Segment we want to load. */
371
+ /** Metadata about the wanted segment. */
424
372
  segment: ISegment;
373
+ /** Type of the corresponding track. */
374
+ type: ITrackType;
375
+ /** Language of the corresponding track. */
376
+ language?: string | undefined;
377
+ /** If `true`, the corresponding `Manifest` if for a live content. */
378
+ isLive: boolean;
379
+ /** Start position in seconds of the Period in which that segment plays. */
380
+ periodStart: number;
381
+ /** End position in seconds of the Period in which that segment plays. */
382
+ periodEnd: number | undefined;
383
+ /** Mimetype of the corresponding Representation. */
384
+ mimeType?: string | undefined;
385
+ /** Codec(s) of the corresponding Representation. */
386
+ codecs?: string | undefined;
387
+ /**
388
+ * Last published time for the Manifest file in which this segment has been
389
+ * defined.
390
+ *
391
+ * This can be useful in cases where a loaded segment contains metadata that
392
+ * could indicate a newer version of the Manifest.
393
+ */
394
+ manifestPublishTime?: number | undefined;
425
395
  }
426
396
  export interface ISegmentLoaderCallbacks<T> {
427
397
  /**
@@ -527,8 +497,6 @@ export interface IChunkCompleteInformation {
527
497
  export type ILoadedAudioVideoSegmentFormat = Uint8Array | ArrayBuffer | null;
528
498
  /** Format of a loaded text segment before parsing. */
529
499
  export type ILoadedTextSegmentFormat = Uint8Array | ArrayBuffer | string | null;
530
- /** Format of a loaded image segment before parsing. */
531
- export type ILoadedImageSegmentFormat = Uint8Array | ArrayBuffer | null;
532
500
  /**
533
501
  * Result returned by a segment parser when it parsed a chunk from an init
534
502
  * segment (which does not contain media data).
@@ -546,17 +514,10 @@ export interface ISegmentParserParsedInitChunk<DataType> {
546
514
  */
547
515
  initTimescale?: number | undefined;
548
516
  /**
549
- * If set to `true`, some protection information has been found in this
550
- * initialization segment and lead the corresponding `Representation`
551
- * object to be updated with that new information.
552
- *
553
- * In that case, you can re-check any encryption-related information with the
554
- * `Representation` linked to that segment.
555
- *
556
- * In the great majority of cases, this is set to `true` when new content
557
- * protection initialization data to have been encountered.
517
+ * Information on encryption that has been found in this segment.
518
+ * Empty array if no such information was found.
558
519
  */
559
- protectionDataUpdate: boolean;
520
+ protectionData: IProtectionDataInfo[];
560
521
  /**
561
522
  * Size in bytes of `initializationData`.
562
523
  * `undefined` if unknown.
@@ -568,6 +529,15 @@ export interface ISegmentParserParsedInitChunk<DataType> {
568
529
  * data, `initializationDataSize` may refer to that binary data only).
569
530
  */
570
531
  initializationDataSize: number | undefined;
532
+ /**
533
+ * When this property is set, a list of segments linked to this
534
+ * `Representation` has been obtained when parsing this initialization
535
+ * segment.
536
+ *
537
+ * This might then be used to communicate it to the corresponding
538
+ * `RepresentationIndex`.
539
+ */
540
+ segmentList?: ISegmentInformation[] | undefined;
571
541
  }
572
542
  /**
573
543
  * Result returned by a segment parser when it parsed a chunk from a media
@@ -602,15 +572,15 @@ export interface ISegmentParserParsedMediaChunk<DataType> {
602
572
  *
603
573
  * For example:
604
574
  * If `chunkData` announces (when parsed by the demuxer or decoder) that the
605
- * segment begins at 32 seconds, and `chunkOffset` equals to `4`, then the
606
- * segment should really begin at 36 seconds (32 + 4).
575
+ * chunk begins at 32 seconds, and `chunkOffset` equals to `4`, then the
576
+ * chunk should really begin at 36 seconds (32 + 4).
607
577
  *
608
578
  * Note that `chunkInfos` needs not to be offseted as it should already
609
579
  * contain the correct time information.
610
580
  */
611
581
  chunkOffset: number;
612
582
  /**
613
- * start and end windows for the segment (part of the chunk respectively
583
+ * start and end windows for the chunk (part of the chunk respectively
614
584
  * before and after that time will be ignored).
615
585
  * `undefined` when their is no such limitation.
616
586
  */
@@ -619,27 +589,65 @@ export interface ISegmentParserParsedMediaChunk<DataType> {
619
589
  number | undefined
620
590
  ];
621
591
  /**
622
- * If set and not empty, then "events" have been encountered in this parsed
623
- * chunks.
592
+ * If set and not empty, then this property contains "events" have been
593
+ * encountered in this parsed chunk.
624
594
  */
625
595
  inbandEvents?: IInbandEvent[] | undefined;
626
596
  /**
627
597
  * If set to `true`, then parsing this chunk revealed that the current
628
598
  * Manifest instance needs to be refreshed.
629
599
  */
630
- needsManifestRefresh?: boolean;
600
+ needsManifestRefresh?: boolean | undefined;
631
601
  /**
632
- * If set to `true`, some protection information has been found in this
633
- * media segment and lead the corresponding `Representation` object to be
634
- * updated with that new information.
635
- *
636
- * In that case, you can re-check any encryption-related information with the
637
- * `Representation` linked to that segment.
602
+ * Information on encryption that has been found in this chunk.
603
+ * Empty array if no such information was found.
604
+ */
605
+ protectionData: IProtectionDataInfo[];
606
+ /**
607
+ * Some segments might contain information about segments coming after them.
608
+ * Those are called "predicted segments".
638
609
  *
639
- * In the great majority of cases, this is set to `true` when new content
640
- * protection initialization data to have been encountered.
610
+ * If set, this array will contain the list of segment predicted to come just
611
+ * after this segment.
612
+ */
613
+ predictedSegments?: ISegmentInformation[] | undefined;
614
+ }
615
+ /** Format of protection data found in a segment/chunk. */
616
+ export interface IProtectionDataInfo {
617
+ /**
618
+ * Format of the protection data.
619
+ * "cenc" is the standart format for ISOBMFF-embedded protection information -
620
+ * like in a PSSH box.
641
621
  */
642
- protectionDataUpdate: boolean;
622
+ initDataType: "cenc";
623
+ /** Optional key id found in the segment. */
624
+ keyId: Uint8Array | undefined;
625
+ /**
626
+ * The protection data.
627
+ */
628
+ initData: Array<{
629
+ /** Hex string identifying the key system concerned by this protection data. */
630
+ systemId: string;
631
+ /** The protection data itself. */
632
+ data: Uint8Array;
633
+ }>;
634
+ }
635
+ /**
636
+ * Some `RepresentationIndex` await the initialization segment to be parsed before
637
+ * knowing the list of media segments linked to it.
638
+ *
639
+ * This type describes the information obtained on a single segment when the
640
+ * initialization segment has been parsed.
641
+ */
642
+ export interface ISegmentInformation {
643
+ /** This segment start time, timescaled. */
644
+ time: number;
645
+ /** This segment difference between its end and start time, timescaled. */
646
+ duration: number;
647
+ /** Dividing `time` or `duration` with this value allows to obtain seconds. */
648
+ timescale: number;
649
+ /** Optional byte-range at which the segment should be loaded. */
650
+ range?: [number, number];
643
651
  }
644
652
  /** Describe data loaded through a request. */
645
653
  export interface IRequestedData<T> {
@@ -672,7 +680,6 @@ export interface IRequestedData<T> {
672
680
  size: number | undefined;
673
681
  }
674
682
  export interface ITransportOptions {
675
- aggressiveMode?: boolean | undefined;
676
683
  checkMediaSegmentIntegrity?: boolean | undefined;
677
684
  lowLatencyMode: boolean;
678
685
  manifestLoader?: IManifestLoader | undefined;
@@ -681,7 +688,5 @@ export interface ITransportOptions {
681
688
  representationFilter?: IRepresentationFilter | undefined;
682
689
  segmentLoader?: ICustomSegmentLoader | undefined;
683
690
  serverSyncInfos?: IServerSyncInfos | undefined;
684
- supplementaryImageTracks?: ISupplementaryImageTrack[] | undefined;
685
- supplementaryTextTracks?: ISupplementaryTextTrack[] | undefined;
686
691
  __priv_patchLastSegmentInSidx?: boolean | undefined;
687
692
  }
@@ -44,7 +44,7 @@ export default function callCustomManifestLoader(customManifestLoader, fallbackM
44
44
  * @param {*} err - The corresponding error encountered
45
45
  */
46
46
  var reject = function (err) {
47
- var _a, _b, _c;
47
+ var _a, _b;
48
48
  if (hasFinished || cancelSignal.isCancelled()) {
49
49
  return;
50
50
  }
@@ -54,7 +54,7 @@ export default function callCustomManifestLoader(customManifestLoader, fallbackM
54
54
  var castedErr = err;
55
55
  var message = (_a = castedErr === null || castedErr === void 0 ? void 0 : castedErr.message) !== null && _a !== void 0 ? _a : "Unknown error when fetching the Manifest through a " +
56
56
  "custom manifestLoader.";
57
- var emittedErr = new CustomLoaderError(message, (_b = castedErr === null || castedErr === void 0 ? void 0 : castedErr.canRetry) !== null && _b !== void 0 ? _b : false, (_c = castedErr === null || castedErr === void 0 ? void 0 : castedErr.isOfflineError) !== null && _c !== void 0 ? _c : false, castedErr === null || castedErr === void 0 ? void 0 : castedErr.xhr);
57
+ var emittedErr = new CustomLoaderError(message, (_b = castedErr === null || castedErr === void 0 ? void 0 : castedErr.canRetry) !== null && _b !== void 0 ? _b : false, castedErr === null || castedErr === void 0 ? void 0 : castedErr.xhr);
58
58
  rej(emittedErr);
59
59
  };
60
60
  /**
@@ -70,7 +70,7 @@ export default function callCustomManifestLoader(customManifestLoader, fallbackM
70
70
  fallbackManifestLoader(url, loaderOptions, cancelSignal).then(res, rej);
71
71
  };
72
72
  var callbacks = { reject: reject, resolve: resolve, fallback: fallback };
73
- var abort = customManifestLoader(url, callbacks, { timeout: loaderOptions.timeout });
73
+ var abort = customManifestLoader({ url: url, timeout: loaderOptions.timeout }, callbacks);
74
74
  cancelSignal.register(abortCustomLoader);
75
75
  /**
76
76
  * The logic to run when the custom loader is cancelled while pending.
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { IAdaptationType, Representation } from "../../manifest";
16
+ import { ITrackType } from "../../public_types";
17
17
  /**
18
18
  * Guess the type of container a segment is in based on Manifest information.
19
19
  *
@@ -23,7 +23,7 @@ import { IAdaptationType, Representation } from "../../manifest";
23
23
  * - `undefined` if we cannot say with confidence in which container the
24
24
  * segment will be in.
25
25
  * @param {string} adaptationType
26
- * @param {Object} representation
26
+ * @param {string} mimeType
27
27
  * @returns {string | undefined}
28
28
  */
29
- export default function inferSegmentContainer(adaptationType: IAdaptationType, representation: Representation): "webm" | "mp4" | undefined;
29
+ export default function inferSegmentContainer(adaptationType: ITrackType, mimeType: string | undefined): "webm" | "mp4" | undefined;
@@ -22,23 +22,21 @@
22
22
  * - `undefined` if we cannot say with confidence in which container the
23
23
  * segment will be in.
24
24
  * @param {string} adaptationType
25
- * @param {Object} representation
25
+ * @param {string} mimeType
26
26
  * @returns {string | undefined}
27
27
  */
28
- export default function inferSegmentContainer(adaptationType, representation) {
28
+ export default function inferSegmentContainer(adaptationType, mimeType) {
29
29
  if (adaptationType === "audio" || adaptationType === "video") {
30
- if (representation.mimeType === "video/mp4" ||
31
- representation.mimeType === "audio/mp4") {
30
+ if (mimeType === "video/mp4" || mimeType === "audio/mp4") {
32
31
  return "mp4";
33
32
  }
34
- if (representation.mimeType === "video/webm" ||
35
- representation.mimeType === "audio/webm") {
33
+ if (mimeType === "video/webm" || mimeType === "audio/webm") {
36
34
  return "webm";
37
35
  }
38
36
  return undefined;
39
37
  }
40
38
  else if (adaptationType === "text") {
41
- return representation.mimeType === "application/mp4" ?
39
+ return mimeType === "application/mp4" ?
42
40
  "mp4" :
43
41
  undefined;
44
42
  }
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Adaptation, ISegment, Representation } from "../../manifest";
17
- import { IChunkTimeInfo, ITextTrackSegmentData } from "../types";
16
+ import { ISegment } from "../../manifest";
17
+ import { IChunkTimeInfo, ISegmentContext, ITextTrackSegmentData } from "../types";
18
18
  /**
19
19
  * Return plain text text track from the given ISOBMFF.
20
20
  * @param {Uint8Array} chunkBytes
@@ -27,13 +27,13 @@ export declare function extractTextTrackFromISOBMFF(chunkBytes: Uint8Array): str
27
27
  * @param {Object} representation
28
28
  * @returns {string}
29
29
  */
30
- export declare function getISOBMFFTextTrackFormat(representation: Representation): "ttml" | "vtt";
30
+ export declare function getISOBMFFTextTrackFormat(codecs: string | undefined): "ttml" | "vtt";
31
31
  /**
32
32
  * Returns the a string expliciting the format of a text track in plain text.
33
33
  * @param {Object} representation
34
34
  * @returns {string}
35
35
  */
36
- export declare function getPlainTextTrackFormat(representation: Representation): "ttml" | "sami" | "vtt" | "srt";
36
+ export declare function getPlainTextTrackFormat(codecs: string | undefined, mimeType: string | undefined): "ttml" | "sami" | "vtt" | "srt";
37
37
  /**
38
38
  * @param {Object} content
39
39
  * @param {ArrayBuffer|UInt8Array|null} chunkData
@@ -41,10 +41,10 @@ export declare function getPlainTextTrackFormat(representation: Representation):
41
41
  * @param {boolean} isChunked
42
42
  * @returns {Object|null}
43
43
  */
44
- export declare function getISOBMFFEmbeddedTextTrackData({ segment, adaptation, representation }: {
44
+ export declare function getISOBMFFEmbeddedTextTrackData({ segment, language, codecs }: {
45
45
  segment: ISegment;
46
- adaptation: Adaptation;
47
- representation: Representation;
46
+ codecs?: string | undefined;
47
+ language?: string | undefined;
48
48
  }, chunkBytes: Uint8Array, chunkInfos: IChunkTimeInfo | null, isChunked: boolean): ITextTrackSegmentData | null;
49
49
  /**
50
50
  * @param {Object} content
@@ -53,8 +53,4 @@ export declare function getISOBMFFEmbeddedTextTrackData({ segment, adaptation, r
53
53
  * @param {boolean} isChunked
54
54
  * @returns {Object|null}
55
55
  */
56
- export declare function getPlainTextTrackData({ segment, adaptation, representation }: {
57
- segment: ISegment;
58
- adaptation: Adaptation;
59
- representation: Representation;
60
- }, textTrackData: string, isChunked: boolean): ITextTrackSegmentData | null;
56
+ export declare function getPlainTextTrackData(context: ISegmentContext, textTrackData: string, isChunked: boolean): ITextTrackSegmentData | null;
@@ -32,12 +32,11 @@ export function extractTextTrackFromISOBMFF(chunkBytes) {
32
32
  * @param {Object} representation
33
33
  * @returns {string}
34
34
  */
35
- export function getISOBMFFTextTrackFormat(representation) {
36
- var codec = representation.codec;
37
- if (codec === undefined) {
35
+ export function getISOBMFFTextTrackFormat(codecs) {
36
+ if (codecs === undefined) {
38
37
  throw new Error("Cannot parse subtitles: unknown format");
39
38
  }
40
- switch (codec.toLowerCase()) {
39
+ switch (codecs.toLowerCase()) {
41
40
  case "stpp": // stpp === TTML in MP4
42
41
  case "stpp.ttml.im1t":
43
42
  return "ttml";
@@ -45,16 +44,15 @@ export function getISOBMFFTextTrackFormat(representation) {
45
44
  return "vtt";
46
45
  }
47
46
  throw new Error("The codec used for the subtitles " +
48
- "\"".concat(codec, "\" is not managed yet."));
47
+ "\"".concat(codecs, "\" is not managed yet."));
49
48
  }
50
49
  /**
51
50
  * Returns the a string expliciting the format of a text track in plain text.
52
51
  * @param {Object} representation
53
52
  * @returns {string}
54
53
  */
55
- export function getPlainTextTrackFormat(representation) {
56
- var _a = representation.mimeType, mimeType = _a === void 0 ? "" : _a;
57
- switch (representation.mimeType) {
54
+ export function getPlainTextTrackFormat(codecs, mimeType) {
55
+ switch (mimeType) {
58
56
  case "application/ttml+xml":
59
57
  return "ttml";
60
58
  case "application/x-sami":
@@ -63,12 +61,13 @@ export function getPlainTextTrackFormat(representation) {
63
61
  case "text/vtt":
64
62
  return "vtt";
65
63
  }
66
- var _b = representation.codec, codec = _b === void 0 ? "" : _b;
67
- var codeLC = codec.toLowerCase();
68
- if (codeLC === "srt") {
69
- return "srt";
64
+ if (codecs !== undefined) {
65
+ var codeLC = codecs.toLowerCase();
66
+ if (codeLC === "srt") {
67
+ return "srt";
68
+ }
70
69
  }
71
- throw new Error("could not find a text-track parser for the type ".concat(mimeType));
70
+ throw new Error("could not find a text-track parser for the type ".concat(mimeType !== null && mimeType !== void 0 ? mimeType : ""));
72
71
  }
73
72
  /**
74
73
  * @param {Object} content
@@ -78,7 +77,7 @@ export function getPlainTextTrackFormat(representation) {
78
77
  * @returns {Object|null}
79
78
  */
80
79
  export function getISOBMFFEmbeddedTextTrackData(_a, chunkBytes, chunkInfos, isChunked) {
81
- var segment = _a.segment, adaptation = _a.adaptation, representation = _a.representation;
80
+ var segment = _a.segment, language = _a.language, codecs = _a.codecs;
82
81
  if (segment.isInit) {
83
82
  return null;
84
83
  }
@@ -102,10 +101,9 @@ export function getISOBMFFEmbeddedTextTrackData(_a, chunkBytes, chunkInfos, isCh
102
101
  endTime = startTime + segment.duration;
103
102
  }
104
103
  }
105
- var type = getISOBMFFTextTrackFormat(representation);
104
+ var type = getISOBMFFTextTrackFormat(codecs);
106
105
  var textData = extractTextTrackFromISOBMFF(chunkBytes);
107
- return { data: textData, type: type, language: adaptation.language,
108
- start: startTime,
106
+ return { data: textData, type: type, language: language, start: startTime,
109
107
  end: endTime };
110
108
  }
111
109
  /**
@@ -115,8 +113,8 @@ export function getISOBMFFEmbeddedTextTrackData(_a, chunkBytes, chunkInfos, isCh
115
113
  * @param {boolean} isChunked
116
114
  * @returns {Object|null}
117
115
  */
118
- export function getPlainTextTrackData(_a, textTrackData, isChunked) {
119
- var segment = _a.segment, adaptation = _a.adaptation, representation = _a.representation;
116
+ export function getPlainTextTrackData(context, textTrackData, isChunked) {
117
+ var segment = context.segment;
120
118
  if (segment.isInit) {
121
119
  return null;
122
120
  }
@@ -131,6 +129,6 @@ export function getPlainTextTrackData(_a, textTrackData, isChunked) {
131
129
  end = segment.time + segment.duration;
132
130
  }
133
131
  }
134
- var type = getPlainTextTrackFormat(representation);
135
- return { data: textTrackData, type: type, language: adaptation.language, start: start, end: end };
132
+ var type = getPlainTextTrackFormat(context.codecs, context.mimeType);
133
+ return { data: textTrackData, type: type, language: context.language, start: start, end: end };
136
134
  }
@@ -50,4 +50,5 @@
50
50
  * @param {number} [fromIndex]
51
51
  * @returns {boolean}
52
52
  */
53
- export default function arrayIncludes<T>(arr: T[], searchElement: T, fromIndex?: number): boolean;
53
+ declare const _default: <T>(arr: T[], searchElement: T, fromIndex?: number) => boolean;
54
+ export default _default;
@@ -50,34 +50,36 @@
50
50
  * @param {number} [fromIndex]
51
51
  * @returns {boolean}
52
52
  */
53
- export default function arrayIncludes(arr, searchElement, fromIndex) {
54
- /* eslint-disable @typescript-eslint/unbound-method */
55
- // eslint-disable-next-line no-restricted-properties
56
- if (typeof Array.prototype.includes === "function") {
57
- /* eslint-enable @typescript-eslint/unbound-method */
58
- // eslint-disable-next-line no-restricted-properties
53
+ /* eslint-disable @typescript-eslint/unbound-method */
54
+ /* eslint-disable no-restricted-properties */
55
+ export default typeof Array.prototype.includes === "function" ?
56
+ function realArrayIncludes(arr, searchElement, fromIndex) {
59
57
  return arr.includes(searchElement, fromIndex);
60
- }
61
- var len = arr.length >>> 0;
62
- if (len === 0) {
58
+ } :
59
+ function compatArrayIncludes(arr, searchElement, fromIndex) {
60
+ if (typeof Array.prototype.includes === "function") {
61
+ return arr.includes(searchElement, fromIndex);
62
+ }
63
+ var len = arr.length >>> 0;
64
+ if (len === 0) {
65
+ return false;
66
+ }
67
+ var n = fromIndex | 0;
68
+ var k = n >= 0 ?
69
+ Math.min(n, len - 1) :
70
+ Math.max(len + n, 0);
71
+ var areTheSame = function (x, y) {
72
+ return x === y ||
73
+ // Viva las JavaScriptas!
74
+ (typeof x === "number" &&
75
+ typeof y === "number" &&
76
+ isNaN(x) && isNaN(y));
77
+ };
78
+ while (k < len) {
79
+ if (areTheSame(arr[k], searchElement)) {
80
+ return true;
81
+ }
82
+ k++;
83
+ }
63
84
  return false;
64
- }
65
- var n = fromIndex | 0;
66
- var k = n >= 0 ?
67
- Math.min(n, len - 1) :
68
- Math.max(len + n, 0);
69
- var areTheSame = function (x, y) {
70
- return x === y ||
71
- // Viva las JavaScriptas!
72
- (typeof x === "number" &&
73
- typeof y === "number" &&
74
- isNaN(x) && isNaN(y));
75
85
  };
76
- while (k < len) {
77
- if (areTheSame(arr[k], searchElement)) {
78
- return true;
79
- }
80
- k++;
81
- }
82
- return false;
83
- }
@@ -41,7 +41,7 @@ export default function request(options) {
41
41
  // is more precise, it might also be more efficient.
42
42
  timeoutId = window.setTimeout(function () {
43
43
  clearCancellingProcess();
44
- reject(new RequestError(url, xhr.status, "TIMEOUT", xhr));
44
+ reject(new RequestError(url, xhr.status, "TIMEOUT"));
45
45
  }, timeout + 3000);
46
46
  }
47
47
  xhr.responseType = responseType;
@@ -74,11 +74,11 @@ export default function request(options) {
74
74
  }
75
75
  xhr.onerror = function onXHRError() {
76
76
  clearCancellingProcess();
77
- reject(new RequestError(url, xhr.status, "ERROR_EVENT", xhr));
77
+ reject(new RequestError(url, xhr.status, "ERROR_EVENT"));
78
78
  };
79
79
  xhr.ontimeout = function onXHRTimeout() {
80
80
  clearCancellingProcess();
81
- reject(new RequestError(url, xhr.status, "TIMEOUT", xhr));
81
+ reject(new RequestError(url, xhr.status, "TIMEOUT"));
82
82
  };
83
83
  if (onProgress !== undefined) {
84
84
  xhr.onprogress = function onXHRProgress(event) {
@@ -112,7 +112,7 @@ export default function request(options) {
112
112
  responseData = xhr.response;
113
113
  }
114
114
  if (isNullOrUndefined(responseData)) {
115
- reject(new RequestError(url, xhr.status, "PARSE_ERROR", xhr));
115
+ reject(new RequestError(url, xhr.status, "PARSE_ERROR"));
116
116
  return;
117
117
  }
118
118
  resolve({ status: status_1, url: _url,
@@ -120,7 +120,7 @@ export default function request(options) {
120
120
  size: totalSize, responseData: responseData });
121
121
  }
122
122
  else {
123
- reject(new RequestError(url, xhr.status, "ERROR_HTTP_CODE", xhr));
123
+ reject(new RequestError(url, xhr.status, "ERROR_HTTP_CODE"));
124
124
  }
125
125
  }
126
126
  };