rx-player 4.0.0-dev.2023110700 → 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 (479) hide show
  1. package/CHANGELOG.md +18 -226
  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 +14 -35
  21. package/dist/_esm5.processed/core/api/option_utils.js +47 -230
  22. package/dist/_esm5.processed/core/api/public_api.d.ts +92 -266
  23. package/dist/_esm5.processed/core/api/public_api.js +451 -807
  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/html/text_track_cues_store.js +54 -6
  55. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/utils.d.ts +2 -1
  56. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/utils.js +19 -2
  57. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +1 -2
  58. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +2 -3
  59. package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +2 -2
  60. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
  61. package/dist/_esm5.processed/core/segment_buffers/index.js +2 -1
  62. package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +1 -0
  63. package/dist/_esm5.processed/core/segment_buffers/inventory/index.js +1 -0
  64. package/dist/_esm5.processed/core/segment_buffers/inventory/utils.d.ts +33 -0
  65. package/dist/_esm5.processed/core/segment_buffers/inventory/utils.js +49 -0
  66. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.d.ts +0 -1
  67. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +2 -16
  68. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +0 -15
  69. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +183 -93
  70. package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.d.ts +39 -0
  71. package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.js +133 -0
  72. package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +27 -13
  73. package/dist/_esm5.processed/core/stream/index.d.ts +2 -3
  74. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +2 -0
  75. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +5 -7
  76. package/dist/_esm5.processed/core/stream/period/period_stream.js +13 -12
  77. package/dist/_esm5.processed/core/stream/period/types.d.ts +5 -14
  78. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +2 -4
  79. package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.js +10 -46
  80. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +29 -23
  81. package/dist/_esm5.processed/core/stream/representation/types.d.ts +11 -1
  82. package/dist/_esm5.processed/default_config.d.ts +35 -98
  83. package/dist/_esm5.processed/default_config.js +36 -113
  84. package/dist/_esm5.processed/errors/custom_loader_error.d.ts +1 -3
  85. package/dist/_esm5.processed/errors/custom_loader_error.js +1 -3
  86. package/dist/_esm5.processed/errors/media_error.js +2 -2
  87. package/dist/_esm5.processed/errors/network_error.d.ts +0 -1
  88. package/dist/_esm5.processed/errors/network_error.js +0 -1
  89. package/dist/_esm5.processed/errors/request_error.d.ts +2 -3
  90. package/dist/_esm5.processed/errors/request_error.js +2 -5
  91. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -3
  92. package/dist/_esm5.processed/features/features_object.js +0 -2
  93. package/dist/_esm5.processed/features/list/directfile.js +2 -5
  94. package/dist/_esm5.processed/features/list/index.d.ts +0 -2
  95. package/dist/_esm5.processed/features/list/index.js +0 -2
  96. package/dist/_esm5.processed/features/types.d.ts +3 -27
  97. package/dist/_esm5.processed/manifest/adaptation.d.ts +9 -11
  98. package/dist/_esm5.processed/manifest/adaptation.js +41 -30
  99. package/dist/_esm5.processed/manifest/index.d.ts +3 -4
  100. package/dist/_esm5.processed/manifest/manifest.d.ts +5 -54
  101. package/dist/_esm5.processed/manifest/manifest.js +5 -110
  102. package/dist/_esm5.processed/manifest/period.d.ts +4 -5
  103. package/dist/_esm5.processed/manifest/representation.d.ts +10 -5
  104. package/dist/_esm5.processed/manifest/representation.js +33 -10
  105. package/dist/_esm5.processed/manifest/representation_index/index.d.ts +2 -2
  106. package/dist/_esm5.processed/manifest/representation_index/static.d.ts +2 -0
  107. package/dist/_esm5.processed/manifest/representation_index/static.js +6 -0
  108. package/dist/_esm5.processed/manifest/representation_index/types.d.ts +42 -21
  109. package/dist/_esm5.processed/manifest/types.d.ts +0 -2
  110. package/dist/_esm5.processed/parsers/manifest/dash/common/convert_supplemental_codecs.d.ts +17 -0
  111. package/dist/_esm5.processed/parsers/manifest/dash/common/convert_supplemental_codecs.js +26 -0
  112. package/dist/_esm5.processed/parsers/manifest/dash/common/flatten_overlapping_periods.js +5 -0
  113. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +17 -31
  114. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +26 -19
  115. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +2 -0
  116. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +7 -1
  117. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +2 -6
  118. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +11 -8
  119. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +2 -0
  120. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +6 -0
  121. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +2 -2
  122. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.js +1 -6
  123. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +3 -5
  124. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +0 -2
  125. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +1 -1
  126. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +2 -2
  127. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +0 -2
  128. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +2 -2
  129. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +29 -17
  130. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +13 -6
  131. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +7 -2
  132. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.d.ts +10 -1
  133. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.js +18 -2
  134. package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +6 -4
  135. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +7 -6
  136. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +5 -2
  137. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
  138. package/dist/_esm5.processed/parsers/manifest/local/representation_index.d.ts +2 -0
  139. package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +6 -0
  140. package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +6 -6
  141. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.d.ts +12 -3
  142. package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.js +11 -2
  143. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +0 -1
  144. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +11 -17
  145. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +21 -83
  146. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +53 -125
  147. package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.d.ts +119 -0
  148. package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.js +159 -0
  149. package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.d.ts +3 -6
  150. package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.js +4 -4
  151. package/dist/_esm5.processed/parsers/manifest/types.d.ts +4 -3
  152. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_extent.js +1 -8
  153. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_origin.js +1 -9
  154. package/dist/_esm5.processed/public_types.d.ts +396 -308
  155. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.d.ts +5 -4
  156. package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +5 -4
  157. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +4 -4
  158. package/dist/_esm5.processed/transports/dash/manifest_parser.js +2 -3
  159. package/dist/_esm5.processed/transports/dash/pipelines.js +1 -4
  160. package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +2 -2
  161. package/dist/_esm5.processed/transports/dash/segment_loader.js +26 -20
  162. package/dist/_esm5.processed/transports/dash/segment_parser.js +19 -24
  163. package/dist/_esm5.processed/transports/dash/text_loader.js +5 -5
  164. package/dist/_esm5.processed/transports/dash/text_parser.js +28 -33
  165. package/dist/_esm5.processed/transports/local/pipelines.js +1 -10
  166. package/dist/_esm5.processed/transports/local/segment_loader.js +2 -2
  167. package/dist/_esm5.processed/transports/local/segment_parser.d.ts +1 -1
  168. package/dist/_esm5.processed/transports/local/segment_parser.js +10 -10
  169. package/dist/_esm5.processed/transports/local/text_parser.d.ts +2 -2
  170. package/dist/_esm5.processed/transports/local/text_parser.js +23 -23
  171. package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +34 -52
  172. package/dist/_esm5.processed/{utils/list_to_map.d.ts → transports/smooth/is_mp4_embedded_track.d.ts} +5 -5
  173. package/dist/_esm5.processed/{features/list/image_buffer.d.ts → transports/smooth/is_mp4_embedded_track.js} +7 -6
  174. package/dist/_esm5.processed/transports/smooth/pipelines.js +33 -190
  175. package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +1 -1
  176. package/dist/_esm5.processed/transports/smooth/segment_loader.js +28 -22
  177. package/dist/_esm5.processed/transports/smooth/utils.d.ts +1 -26
  178. package/dist/_esm5.processed/transports/smooth/utils.js +1 -55
  179. package/dist/_esm5.processed/transports/types.d.ts +94 -89
  180. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +3 -3
  181. package/dist/_esm5.processed/transports/utils/infer_segment_container.d.ts +3 -3
  182. package/dist/_esm5.processed/transports/utils/infer_segment_container.js +5 -7
  183. package/dist/_esm5.processed/transports/utils/parse_text_track.d.ts +8 -12
  184. package/dist/_esm5.processed/transports/utils/parse_text_track.js +19 -21
  185. package/dist/_esm5.processed/utils/array_includes.d.ts +2 -1
  186. package/dist/_esm5.processed/utils/array_includes.js +30 -28
  187. package/dist/_esm5.processed/utils/request/xhr.js +5 -5
  188. package/dist/commonjs/compat/is_codec_supported.js +22 -1
  189. package/dist/commonjs/compat/patch_webkit_source_buffer.js +2 -2
  190. package/dist/commonjs/config.d.ts +1 -0
  191. package/dist/commonjs/core/api/debug/buffer_graph.js +2 -6
  192. package/dist/commonjs/core/api/debug/modules/general_info.js +17 -10
  193. package/dist/commonjs/core/api/option_utils.d.ts +4 -0
  194. package/dist/commonjs/core/api/option_utils.js +8 -3
  195. package/dist/commonjs/core/api/public_api.d.ts +11 -1
  196. package/dist/commonjs/core/api/public_api.js +46 -11
  197. package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
  198. package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.js +11 -3
  199. package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts +8 -1
  200. package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +8 -4
  201. package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
  202. package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
  203. package/dist/commonjs/core/init/directfile_content_initializer.js +24 -7
  204. package/dist/commonjs/core/init/media_source_content_initializer.d.ts +6 -0
  205. package/dist/commonjs/core/init/media_source_content_initializer.js +4 -6
  206. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  207. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.js +16 -17
  208. package/dist/commonjs/core/init/utils/get_initial_time.d.ts +17 -3
  209. package/dist/commonjs/core/init/utils/get_initial_time.js +9 -7
  210. package/dist/commonjs/core/segment_buffers/implementations/text/html/text_track_cues_store.js +54 -6
  211. package/dist/commonjs/core/segment_buffers/implementations/text/html/utils.d.ts +2 -1
  212. package/dist/commonjs/core/segment_buffers/implementations/text/html/utils.js +19 -2
  213. package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +2 -2
  214. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
  215. package/dist/commonjs/core/stream/period/period_stream.js +2 -2
  216. package/dist/commonjs/core/stream/representation/utils/get_buffer_status.js +3 -3
  217. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +1 -1
  218. package/dist/commonjs/default_config.d.ts +5 -0
  219. package/dist/commonjs/default_config.js +5 -0
  220. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
  221. package/dist/commonjs/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
  222. package/dist/commonjs/manifest/representation.js +18 -5
  223. package/dist/commonjs/manifest/representation_index/static.d.ts +1 -1
  224. package/dist/commonjs/manifest/representation_index/static.js +2 -2
  225. package/dist/commonjs/manifest/representation_index/types.d.ts +4 -4
  226. package/dist/commonjs/parsers/manifest/dash/common/convert_supplemental_codecs.d.ts +17 -0
  227. package/dist/commonjs/parsers/manifest/dash/common/convert_supplemental_codecs.js +30 -0
  228. package/dist/commonjs/parsers/manifest/dash/common/flatten_overlapping_periods.js +5 -0
  229. package/dist/commonjs/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
  230. package/dist/commonjs/parsers/manifest/dash/common/indexes/base.js +4 -3
  231. package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  232. package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  233. package/dist/commonjs/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  234. package/dist/commonjs/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
  235. package/dist/commonjs/parsers/manifest/dash/common/indexes/list.js +2 -2
  236. package/dist/commonjs/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
  237. package/dist/commonjs/parsers/manifest/dash/common/indexes/template.js +42 -29
  238. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  239. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
  240. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +250 -51
  241. package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  242. package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  243. package/dist/commonjs/parsers/manifest/dash/common/parse_adaptation_sets.js +13 -10
  244. package/dist/commonjs/parsers/manifest/dash/common/parse_mpd.js +27 -14
  245. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  246. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +17 -18
  247. package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
  248. package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.js +21 -8
  249. package/dist/commonjs/parsers/manifest/dash/common/parse_representations.js +36 -20
  250. package/dist/commonjs/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +3 -0
  251. package/dist/commonjs/parsers/manifest/dash/js-parser/node_parsers/Representation.js +3 -0
  252. package/dist/commonjs/parsers/manifest/dash/node_parser_types.d.ts +2 -0
  253. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +4 -0
  254. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +4 -0
  255. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
  256. package/dist/commonjs/parsers/manifest/local/representation_index.d.ts +1 -1
  257. package/dist/commonjs/parsers/manifest/local/representation_index.js +3 -3
  258. package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
  259. package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.js +2 -2
  260. package/dist/commonjs/parsers/manifest/smooth/representation_index.d.ts +5 -5
  261. package/dist/commonjs/parsers/manifest/smooth/representation_index.js +25 -9
  262. package/dist/commonjs/parsers/manifest/types.d.ts +1 -0
  263. package/dist/commonjs/parsers/manifest/utils/index_helpers.js +1 -1
  264. package/dist/commonjs/public_types.d.ts +78 -34
  265. package/dist/commonjs/transports/dash/init_segment_loader.js +10 -5
  266. package/dist/commonjs/transports/dash/manifest_parser.js +5 -2
  267. package/dist/commonjs/transports/dash/segment_loader.js +2 -1
  268. package/dist/commonjs/transports/dash/text_loader.js +2 -0
  269. package/dist/commonjs/transports/metaplaylist/manifest_loader.js +2 -1
  270. package/dist/commonjs/transports/metaplaylist/pipelines.js +4 -1
  271. package/dist/commonjs/transports/smooth/pipelines.js +4 -2
  272. package/dist/commonjs/transports/smooth/segment_loader.js +2 -1
  273. package/dist/commonjs/transports/types.d.ts +12 -0
  274. package/dist/commonjs/transports/utils/generate_manifest_loader.js +6 -3
  275. package/dist/commonjs/utils/queue_microtask.d.ts +2 -0
  276. package/dist/commonjs/utils/queue_microtask.js +7 -0
  277. package/dist/commonjs/utils/request/fetch.d.ts +6 -0
  278. package/dist/commonjs/utils/request/fetch.js +29 -8
  279. package/dist/commonjs/utils/request/xhr.d.ts +11 -5
  280. package/dist/commonjs/utils/request/xhr.js +29 -8
  281. package/dist/es2017/compat/is_codec_supported.js +22 -1
  282. package/dist/es2017/compat/patch_webkit_source_buffer.js +2 -2
  283. package/dist/es2017/config.d.ts +1 -0
  284. package/dist/es2017/core/api/debug/buffer_graph.js +2 -6
  285. package/dist/es2017/core/api/debug/modules/general_info.js +17 -10
  286. package/dist/es2017/core/api/option_utils.d.ts +4 -0
  287. package/dist/es2017/core/api/option_utils.js +8 -3
  288. package/dist/es2017/core/api/public_api.d.ts +11 -1
  289. package/dist/es2017/core/api/public_api.js +44 -9
  290. package/dist/es2017/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
  291. package/dist/es2017/core/fetchers/manifest/manifest_fetcher.js +11 -3
  292. package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts +8 -1
  293. package/dist/es2017/core/fetchers/segment/segment_fetcher.js +8 -4
  294. package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
  295. package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
  296. package/dist/es2017/core/init/directfile_content_initializer.js +24 -7
  297. package/dist/es2017/core/init/media_source_content_initializer.d.ts +6 -0
  298. package/dist/es2017/core/init/media_source_content_initializer.js +4 -6
  299. package/dist/es2017/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  300. package/dist/es2017/core/init/utils/content_time_boundaries_observer.js +16 -15
  301. package/dist/es2017/core/init/utils/get_initial_time.d.ts +17 -3
  302. package/dist/es2017/core/init/utils/get_initial_time.js +9 -7
  303. package/dist/es2017/core/segment_buffers/implementations/text/html/text_track_cues_store.js +54 -6
  304. package/dist/es2017/core/segment_buffers/implementations/text/html/utils.d.ts +2 -1
  305. package/dist/es2017/core/segment_buffers/implementations/text/html/utils.js +18 -2
  306. package/dist/es2017/core/stream/adaptation/adaptation_stream.js +2 -2
  307. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
  308. package/dist/es2017/core/stream/period/period_stream.js +2 -2
  309. package/dist/es2017/core/stream/representation/utils/get_buffer_status.js +3 -3
  310. package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -1
  311. package/dist/es2017/default_config.d.ts +5 -0
  312. package/dist/es2017/default_config.js +5 -0
  313. package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
  314. package/dist/es2017/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
  315. package/dist/es2017/manifest/representation.js +18 -5
  316. package/dist/es2017/manifest/representation_index/static.d.ts +1 -1
  317. package/dist/es2017/manifest/representation_index/static.js +2 -2
  318. package/dist/es2017/manifest/representation_index/types.d.ts +4 -4
  319. package/dist/es2017/parsers/manifest/dash/common/convert_supplemental_codecs.d.ts +17 -0
  320. package/dist/es2017/parsers/manifest/dash/common/convert_supplemental_codecs.js +26 -0
  321. package/dist/es2017/parsers/manifest/dash/common/flatten_overlapping_periods.js +5 -0
  322. package/dist/es2017/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
  323. package/dist/es2017/parsers/manifest/dash/common/indexes/base.js +4 -3
  324. package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  325. package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  326. package/dist/es2017/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  327. package/dist/es2017/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
  328. package/dist/es2017/parsers/manifest/dash/common/indexes/list.js +2 -2
  329. package/dist/es2017/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
  330. package/dist/es2017/parsers/manifest/dash/common/indexes/template.js +40 -27
  331. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  332. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
  333. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +246 -51
  334. package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  335. package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  336. package/dist/es2017/parsers/manifest/dash/common/parse_adaptation_sets.js +11 -8
  337. package/dist/es2017/parsers/manifest/dash/common/parse_mpd.js +27 -13
  338. package/dist/es2017/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  339. package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +13 -16
  340. package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
  341. package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.js +10 -8
  342. package/dist/es2017/parsers/manifest/dash/common/parse_representations.js +36 -20
  343. package/dist/es2017/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +3 -0
  344. package/dist/es2017/parsers/manifest/dash/js-parser/node_parsers/Representation.js +3 -0
  345. package/dist/es2017/parsers/manifest/dash/node_parser_types.d.ts +2 -0
  346. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +4 -0
  347. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +4 -0
  348. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
  349. package/dist/es2017/parsers/manifest/local/representation_index.d.ts +1 -1
  350. package/dist/es2017/parsers/manifest/local/representation_index.js +3 -3
  351. package/dist/es2017/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
  352. package/dist/es2017/parsers/manifest/metaplaylist/representation_index.js +2 -2
  353. package/dist/es2017/parsers/manifest/smooth/representation_index.d.ts +5 -5
  354. package/dist/es2017/parsers/manifest/smooth/representation_index.js +25 -9
  355. package/dist/es2017/parsers/manifest/types.d.ts +1 -0
  356. package/dist/es2017/parsers/manifest/utils/index_helpers.js +1 -1
  357. package/dist/es2017/public_types.d.ts +78 -34
  358. package/dist/es2017/transports/dash/init_segment_loader.js +5 -0
  359. package/dist/es2017/transports/dash/manifest_parser.js +3 -0
  360. package/dist/es2017/transports/dash/segment_loader.js +1 -0
  361. package/dist/es2017/transports/dash/text_loader.js +2 -0
  362. package/dist/es2017/transports/metaplaylist/manifest_loader.js +1 -0
  363. package/dist/es2017/transports/metaplaylist/pipelines.js +4 -1
  364. package/dist/es2017/transports/smooth/pipelines.js +2 -0
  365. package/dist/es2017/transports/smooth/segment_loader.js +1 -0
  366. package/dist/es2017/transports/types.d.ts +12 -0
  367. package/dist/es2017/transports/utils/generate_manifest_loader.js +3 -0
  368. package/dist/es2017/utils/queue_microtask.d.ts +2 -0
  369. package/dist/es2017/utils/queue_microtask.js +5 -0
  370. package/dist/es2017/utils/request/fetch.d.ts +6 -0
  371. package/dist/es2017/utils/request/fetch.js +29 -8
  372. package/dist/es2017/utils/request/xhr.d.ts +11 -5
  373. package/dist/es2017/utils/request/xhr.js +30 -9
  374. package/dist/mpd-parser.wasm +0 -0
  375. package/dist/rx-player.js +900 -492
  376. package/dist/rx-player.min.js +1 -1
  377. package/package.json +3 -7
  378. package/scripts/update-version +2 -0
  379. package/sonar-project.properties +1 -1
  380. package/src/compat/is_codec_supported.ts +23 -1
  381. package/src/compat/patch_webkit_source_buffer.ts +2 -2
  382. package/src/core/api/debug/buffer_graph.ts +2 -5
  383. package/src/core/api/debug/modules/general_info.ts +15 -10
  384. package/src/core/api/option_utils.ts +11 -3
  385. package/src/core/api/public_api.ts +48 -8
  386. package/src/core/fetchers/manifest/manifest_fetcher.ts +21 -3
  387. package/src/core/fetchers/segment/segment_fetcher.ts +19 -5
  388. package/src/core/fetchers/segment/segment_fetcher_creator.ts +1 -0
  389. package/src/core/fetchers/utils/schedule_request.ts +1 -1
  390. package/src/core/init/directfile_content_initializer.ts +23 -7
  391. package/src/core/init/media_source_content_initializer.ts +13 -7
  392. package/src/core/init/utils/content_time_boundaries_observer.ts +23 -22
  393. package/src/core/init/utils/get_initial_time.ts +25 -12
  394. package/src/core/segment_buffers/implementations/text/html/__tests__/utils.test.ts +15 -0
  395. package/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +57 -6
  396. package/src/core/segment_buffers/implementations/text/html/utils.ts +19 -2
  397. package/src/core/stream/adaptation/adaptation_stream.ts +2 -2
  398. package/src/core/stream/orchestrator/stream_orchestrator.ts +3 -3
  399. package/src/core/stream/period/period_stream.ts +2 -2
  400. package/src/core/stream/representation/utils/get_buffer_status.ts +3 -3
  401. package/src/core/stream/representation/utils/get_needed_segments.ts +2 -2
  402. package/src/default_config.ts +5 -0
  403. package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +3 -1
  404. package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +2 -0
  405. package/src/manifest/representation.ts +19 -6
  406. package/src/manifest/representation_index/static.ts +2 -2
  407. package/src/manifest/representation_index/types.ts +4 -4
  408. package/src/parsers/manifest/dash/common/__tests__/convert_supplemental_codecs.test.ts +37 -0
  409. package/src/parsers/manifest/dash/common/__tests__/flatten_overlapping_period.test.ts +20 -0
  410. package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +182 -36
  411. package/src/parsers/manifest/dash/common/convert_supplemental_codecs.ts +32 -0
  412. package/src/parsers/manifest/dash/common/flatten_overlapping_periods.ts +5 -0
  413. package/src/parsers/manifest/dash/common/indexes/base.ts +12 -4
  414. package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +19 -5
  415. package/src/parsers/manifest/dash/common/indexes/index.ts +16 -4
  416. package/src/parsers/manifest/dash/common/indexes/list.ts +2 -2
  417. package/src/parsers/manifest/dash/common/indexes/template.ts +52 -31
  418. package/src/parsers/manifest/dash/common/indexes/timeline/index.ts +4 -1
  419. package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +366 -60
  420. package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +63 -25
  421. package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +10 -4
  422. package/src/parsers/manifest/dash/common/parse_mpd.ts +28 -15
  423. package/src/parsers/manifest/dash/common/parse_periods.ts +12 -17
  424. package/src/parsers/manifest/dash/common/parse_representation_index.ts +50 -26
  425. package/src/parsers/manifest/dash/common/parse_representations.ts +39 -20
  426. package/src/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.ts +4 -0
  427. package/src/parsers/manifest/dash/js-parser/node_parsers/Representation.ts +4 -0
  428. package/src/parsers/manifest/dash/node_parser_types.ts +2 -0
  429. package/src/parsers/manifest/dash/wasm-parser/rs/events.rs +2 -0
  430. package/src/parsers/manifest/dash/wasm-parser/rs/processor/attributes.rs +2 -0
  431. package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +4 -0
  432. package/src/parsers/manifest/dash/wasm-parser/ts/generators/Representation.ts +4 -0
  433. package/src/parsers/manifest/dash/wasm-parser/ts/types.ts +2 -0
  434. package/src/parsers/manifest/local/representation_index.ts +3 -3
  435. package/src/parsers/manifest/metaplaylist/representation_index.ts +2 -2
  436. package/src/parsers/manifest/smooth/representation_index.ts +23 -9
  437. package/src/parsers/manifest/types.ts +2 -0
  438. package/src/parsers/manifest/utils/__tests__/get_first_time_from_adaptations.test.ts +1 -1
  439. package/src/parsers/manifest/utils/__tests__/get_last_time_from_adaptation.test.ts +1 -1
  440. package/src/parsers/manifest/utils/index_helpers.ts +1 -1
  441. package/src/public_types.ts +79 -34
  442. package/src/transports/dash/init_segment_loader.ts +5 -0
  443. package/src/transports/dash/manifest_parser.ts +6 -0
  444. package/src/transports/dash/segment_loader.ts +1 -0
  445. package/src/transports/dash/text_loader.ts +2 -0
  446. package/src/transports/metaplaylist/manifest_loader.ts +1 -0
  447. package/src/transports/metaplaylist/pipelines.ts +4 -1
  448. package/src/transports/smooth/pipelines.ts +2 -0
  449. package/src/transports/smooth/segment_loader.ts +1 -0
  450. package/src/transports/types.ts +12 -0
  451. package/src/transports/utils/generate_manifest_loader.ts +3 -0
  452. package/src/utils/queue_microtask.ts +7 -0
  453. package/src/utils/request/fetch.ts +35 -8
  454. package/src/utils/request/xhr.ts +45 -14
  455. package/dist/_esm5.processed/compat/fullscreen.d.ts +0 -32
  456. package/dist/_esm5.processed/compat/fullscreen.js +0 -78
  457. package/dist/_esm5.processed/compat/is_offline.d.ts +0 -39
  458. package/dist/_esm5.processed/compat/is_offline.js +0 -43
  459. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.d.ts +0 -258
  460. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +0 -989
  461. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.d.ts +0 -75
  462. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +0 -133
  463. package/dist/_esm5.processed/features/list/bif_parser.d.ts +0 -23
  464. package/dist/_esm5.processed/features/list/bif_parser.js +0 -27
  465. package/dist/_esm5.processed/features/list/image_buffer.js +0 -25
  466. package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +0 -38
  467. package/dist/_esm5.processed/transports/dash/image_pipelines.js +0 -129
  468. package/dist/_esm5.processed/utils/list_to_map.js +0 -28
  469. package/dist/_esm5.processed/utils/simple_set.d.ts +0 -51
  470. package/dist/_esm5.processed/utils/simple_set.js +0 -57
  471. package/dist/_esm5.processed/utils/uniq.d.ts +0 -36
  472. package/dist/_esm5.processed/utils/uniq.js +0 -43
  473. package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  474. package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.js +0 -54
  475. package/dist/es2017/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  476. package/dist/es2017/parsers/manifest/utils/is_segment_still_available.js +0 -51
  477. package/src/parsers/manifest/utils/is_segment_still_available.ts +0 -58
  478. package/src/typings/next-tick.d.ts +0 -23
  479. package/src/typings/object-assign.d.ts +0 -48
@@ -13,9 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { IPreferredEmeApiType, ICustomMediaKeySession } from "./compat/eme";
16
+ import { IPreferredEmeApiType } from "./compat/eme";
17
17
  import { IPersistentSessionInfoV0, IPersistentSessionInfoV1, IPersistentSessionInfoV2, IPersistentSessionInfoV3, IPersistentSessionInfoV4 } from "./core/decrypt";
18
- import { IBufferType } from "./core/segment_buffers";
19
18
  import { IMediaErrorTrackContext, EncryptedMediaError, MediaError, NetworkError, OtherError } from "./errors";
20
19
  import Manifest from "./manifest";
21
20
  import { ILocalManifest } from "./parsers/manifest/local";
@@ -33,115 +32,81 @@ export interface IConstructorOptions {
33
32
  wantedBufferAhead?: number;
34
33
  maxVideoBufferSize?: number;
35
34
  limitVideoWidth?: boolean;
36
- throttleWhenHidden?: boolean;
37
35
  throttleVideoBitrateWhenHidden?: boolean;
38
- preferredAudioTracks?: IAudioTrackPreference[];
39
- preferredTextTracks?: ITextTrackPreference[];
40
- preferredVideoTracks?: IVideoTrackPreference[];
41
36
  videoElement?: HTMLMediaElement;
42
- initialVideoBitrate?: number;
43
- initialAudioBitrate?: number;
44
- minAudioBitrate?: number;
45
- minVideoBitrate?: number;
46
- maxAudioBitrate?: number;
47
- maxVideoBitrate?: number;
48
- stopAtEnd?: boolean;
37
+ baseBandwidth?: number;
49
38
  }
50
39
  /** Every options that can be given to the RxPlayer's `loadVideo` method. */
51
40
  export interface ILoadVideoOptions {
41
+ /**
42
+ * Streaming protocol used (e.g. "dash" or "smooth").
43
+ *
44
+ * It is a mandatory property.
45
+ */
52
46
  transport: string;
47
+ /** Main URL to the content (Manifest or video file for directfile contents. */
53
48
  url?: string;
49
+ /** If `true` the Content will automatically play once loaded. */
54
50
  autoPlay?: boolean;
51
+ /**
52
+ * Decryption-related options.
53
+ * Can be left to undefined if no decryption is wanted.
54
+ */
55
55
  keySystems?: IKeySystemOption[];
56
- transportOptions?: ITransportOptions | undefined;
56
+ /**
57
+ * If set to `true`, and if the content is compatible, it will be played in a
58
+ * special mode where the latency is greatly reduced.
59
+ *
60
+ * Should only be set for known to be compatible contents.
61
+ */
57
62
  lowLatencyMode?: boolean;
58
- networkConfig?: INetworkConfigOption;
63
+ requestConfig?: IRequestConfig;
64
+ /** Indicate the position the RxPlayer should start at on the loaded content. */
59
65
  startAt?: IStartAtOption;
66
+ /**
67
+ * The "mode" in which the text tracks will be displayed.
68
+ *
69
+ * The default `"native"` mode will use HTMLMediaElement's `track`elements and
70
+ * poor stylization capabilities.
71
+ *
72
+ * The `"html"` mode use the `textTrackElement` option to display subtitles
73
+ * with rich stylization capabilities inside that `HTMLElement`.
74
+ */
60
75
  textTrackMode?: "native" | "html";
61
- hideNativeSubtitle?: boolean;
76
+ /**
77
+ * The HTMLElement in which text track will be pushed in a `"html"`
78
+ * `textTrackMode`.
79
+ *
80
+ * Mandatory if `textTrackMode` is set to `"html"`.
81
+ *
82
+ * Has no effect when `textTrackMode` is not set or set to `"native"`.
83
+ */
62
84
  textTrackElement?: HTMLElement;
63
- manualBitrateSwitchingMode?: "seamless" | "direct";
85
+ /**
86
+ * `true` by default.
87
+ *
88
+ * If set to `false`, the RxPlayer won't use the "fast-switching" optimization
89
+ * that allows to see raise in qualities quicker.
90
+ *
91
+ * You might want to set to `false` when the current device does not support
92
+ * segment replacement well.
93
+ */
64
94
  enableFastSwitching?: boolean;
65
- audioTrackSwitchingMode?: IAudioTrackSwitchingMode;
95
+ /** Default behavior when switching to a different audio track. */
96
+ defaultAudioTrackSwitchingMode?: IAudioTrackSwitchingMode;
97
+ /**
98
+ * Behavior when a audio or video codec just switched to another
99
+ * non-compatible one.
100
+ *
101
+ * This value might depend on the device's capabilities.
102
+ */
66
103
  onCodecSwitch?: "continue" | "reload";
67
- supplementaryTextTracks?: ISupplementaryTextTrackOption[];
68
- supplementaryImageTracks?: ISupplementaryImageTrackOption[];
69
- defaultAudioTrack?: IDefaultAudioTrackOption | null | undefined;
70
- defaultTextTrack?: IDefaultTextTrackOption | null | undefined;
71
- }
72
- /**
73
- * Value for the `defaultAudioTrack` option of the `loadVideo` method.
74
- * @deprecated
75
- */
76
- export interface IDefaultAudioTrackOption {
77
- /** The language wanted for the audio track. */
78
- language: string;
79
- /** The language normalized into ISO639-3 */
80
- normalized: string;
81
- /** If `true`, this is an audio description for the visually impaired. */
82
- audioDescription: boolean;
83
- }
84
- /**
85
- * Value for the `defaultTextTrack` option of the `loadVideo` method.
86
- * @deprecated
87
- */
88
- export interface IDefaultTextTrackOption {
89
- /** The language wanted for the text track. */
90
- language: string;
91
- /** The language normalized into ISO639-3 */
92
- normalized: string;
93
- /** If `true`, this is closed captions for the hard of hearing. */
94
- closedCaption: boolean;
95
- }
96
- /**
97
- * External text track we have to add to the Manifest once downloaded.
98
- * @deprecated
99
- */
100
- export interface ISupplementaryTextTrackOption {
101
- /** URL the external text track can be found at. */
102
- url: string;
103
- /** Language the text track is in. */
104
- language: string;
105
- /** If `true` the text track contains closed captions. */
106
- closedCaption: boolean;
107
- /** Mime-type used to know the container and/or format of the text track. */
108
- mimeType: string;
109
- /** Codec used to know the format of the text track. */
110
- codecs?: string;
111
- }
112
- /**
113
- * External image (".bif") track we have to add to the Manifest once downloaded.
114
- * @deprecated
115
- */
116
- export interface ISupplementaryImageTrackOption {
117
- /** URL the external image track can be found at. */
118
- url: string;
119
- /** Mime-type used to know the format of the image track. */
120
- mimeType: string;
121
- }
122
- /**
123
- * Strategy to adopt when manually switching of audio adaptation.
124
- * Can be either:
125
- * - "seamless": transitions are smooth but could be not immediate.
126
- * - "direct": strategy will be "smart", if the mimetype and the codec,
127
- * change, we will perform a hard reload of the media source, however, if it
128
- * doesn't change, we will just perform a small flush by removing buffered range
129
- * and performing, a small seek on the media element.
130
- * Transitions are faster, but, we could see appear a BUFFERING state.
131
- * - "reload": completely reload the content. This allows a direct switch
132
- * compatible with most device but may necessitate a RELOADING phase.
133
- */
134
- export type IAudioTrackSwitchingMode = "seamless" | "direct" | "reload";
135
- /** Value of the `transportOptions` option of the `loadVideo` method. */
136
- export interface ITransportOptions {
137
- /** Whether we can perform request for segments in advance. */
138
- aggressiveMode?: boolean;
139
104
  /**
140
105
  * Whether we should check that an obtain segment is truncated and retry the
141
106
  * request if that's the case.
142
107
  */
143
108
  checkMediaSegmentIntegrity?: boolean;
144
- /** Manifest object that will be used initially. */
109
+ /** Manifest object that may be used initially. */
145
110
  initialManifest?: IInitialManifest;
146
111
  /** Custom implementation for performing Manifest requests. */
147
112
  manifestLoader?: IManifestLoader;
@@ -171,80 +136,14 @@ export interface IServerSyncInfos {
171
136
  /** Format of a loaded Manifest before parsing. */
172
137
  export type IInitialManifest = Document | string | ArrayBuffer | IMetaPlaylist | ILocalManifest | Manifest;
173
138
  /** Type for the `representationFilter` API. */
174
- export type IRepresentationFilter = (representation: IRepresentation, adaptationInfos: IRepresentationInfos) => boolean;
175
- /** Manifest, as documented in the API documentation. */
176
- export interface IManifest {
177
- periods: IPeriod[];
178
- /**
179
- * @deprecated
180
- */
181
- adaptations: {
182
- audio?: IAdaptation[];
183
- video?: IAdaptation[];
184
- text?: IAdaptation[];
185
- image?: IAdaptation[];
186
- };
187
- isLive: boolean;
188
- transport: string;
189
- }
190
- /** Period, as documented in the API documentation. */
191
- export interface IPeriod {
192
- id: string;
193
- start: number;
194
- end?: number | undefined;
195
- adaptations: {
196
- audio?: IAdaptation[];
197
- video?: IAdaptation[];
198
- text?: IAdaptation[];
199
- image?: IAdaptation[];
200
- };
201
- }
202
- export type IAdaptationType = "video" | "audio" | "text" | "image";
203
- /** Adaptation (represents a track), as documented in the API documentation. */
204
- export interface IAdaptation {
205
- /** String identifying the Adaptation, unique per Period. */
206
- id: string;
207
- type: IAdaptationType;
208
- language?: string | undefined;
209
- normalizedLanguage?: string | undefined;
210
- isAudioDescription?: boolean | undefined;
211
- isClosedCaption?: boolean | undefined;
212
- isSignInterpreted?: boolean | undefined;
213
- isTrickModeTrack?: boolean | undefined;
214
- representations: IRepresentation[];
215
- getAvailableBitrates(): number[];
216
- }
217
- interface IRepresentationIndex {
218
- getSegments(up: number, duration: number): IExposedSegment[];
219
- }
220
- /** Segment, as documented in the API documentation. */
221
- export interface IExposedSegment {
222
- id: string;
223
- timescale: number;
224
- duration?: number | undefined;
225
- time: number;
226
- isInit?: boolean | undefined;
227
- range?: number[] | null | undefined;
228
- indexRange?: number[] | null | undefined;
229
- number?: number | undefined;
230
- }
231
- /** Representation (represents a quality), as documented in the API documentation. */
232
- export interface IRepresentation {
139
+ export type IRepresentationFilter = (representation: IRepresentationFilterRepresentation, context: IRepresentationContext) => boolean;
140
+ /** Representation object given to the `representationFilter` API. */
141
+ export interface IRepresentationFilterRepresentation {
233
142
  /** String identifying the Representation, unique per Adaptation. */
234
143
  id: string;
235
- bitrate: number;
236
- /** Codec used by the segment in that Representation. */
144
+ bitrate?: number | undefined;
145
+ /** Codec used by the media segments of that Representation. */
237
146
  codec?: string | undefined;
238
- /**
239
- * Whether we are able to decrypt this Representation / unable to decrypt it or
240
- * if we don't know yet:
241
- * - if `true`, it means that we know we were able to decrypt this
242
- * Representation in the current content.
243
- * - if `false`, it means that we know we were unable to decrypt this
244
- * Representation
245
- * - if `undefined` there is no certainty on this matter
246
- */
247
- decipherable?: boolean | undefined;
248
147
  /**
249
148
  * This property makes the most sense for video Representations.
250
149
  * It defines the height of the video, in pixels.
@@ -255,15 +154,20 @@ export interface IRepresentation {
255
154
  * It defines the height of the video, in pixels.
256
155
  */
257
156
  width?: number | undefined;
157
+ /** The frame rate for this Representation, in frame per seconds. */
158
+ frameRate?: number | undefined;
159
+ /** If the track is HDR, gives the HDR characteristics of the content */
160
+ hdrInfo?: IHDRInformation | undefined;
258
161
  /**
259
- * The represesentation frame rate for this Representation. It defines either
260
- * the number of frames per second as an integer (24), or as a ratio
261
- * (24000 / 1000).
162
+ * Encryption information linked to this content.
163
+ * If set to an Object, the Representation is known to be encrypted.
164
+ * If unset or set to `undefined` the Representation is either unencrypted or
165
+ * we don't know if it is.
262
166
  */
263
- frameRate?: string | undefined;
264
- /** If the track is HDR, gives the HDR characteristics of the content */
265
- hdrInfo?: IHDRInformation;
266
- index: IRepresentationIndex;
167
+ contentProtections?: {
168
+ /** Known key ids linked to that Representation. */
169
+ keyIds?: Uint8Array[] | undefined;
170
+ } | undefined;
267
171
  }
268
172
  export interface IHDRInformation {
269
173
  /**
@@ -315,52 +219,44 @@ export type IStartAtOption = {
315
219
  */
316
220
  fromFirstPosition: number;
317
221
  };
318
- /** Value for the `networkConfig` option of the `loadVideo` method. */
319
- export interface INetworkConfigOption {
320
- /**
321
- * The amount of time maximum we should retry a Manifest or Manifest-related
322
- * request before failing on Error.
323
- * Set to `Infinity` for an infinite number of requests.
324
- */
325
- manifestRetry?: number | undefined;
326
- /**
327
- * Amount of time, in milliseconds, after which a manifest request should be
328
- * aborted and optionally retried, depending on the current configuration.
329
- *
330
- * Setting it to `-1` allows to disable any timeout.
331
- * `undefined` means that a default, large, timeout will be used instead.
332
- */
333
- manifestRequestTimeout?: number | undefined;
334
- /**
335
- * The amount of time maximum we should retry a request in general when the
336
- * user is offline.
337
- * Set to `Infinity` for an infinite number of requests.
338
- */
339
- offlineRetry?: number | undefined;
340
- /**
341
- * The amount of time maximum we should retry a segment or segment-related
342
- * request before failing on Error.
343
- * Set to `Infinity` for an infinite number of requests.
344
- */
345
- segmentRetry?: number | undefined;
346
- /**
347
- * Amount of time, in milliseconds, after which a segment request should be
348
- * aborted and optionally retried, depending on the current configuration.
349
- *
350
- * Setting it to `-1` allows to disable any timeout.
351
- * `undefined` means that a default, large, timeout will be used instead.
352
- */
353
- segmentRequestTimeout?: number | undefined;
222
+ /** Value for the `requestConfig` option of the `loadVideo` method. */
223
+ export interface IRequestConfig {
224
+ manifest?: {
225
+ /**
226
+ * The amount of time maximum we should retry a Manifest or Manifest-related
227
+ * request before failing on Error.
228
+ * Set to `Infinity` for an infinite number of requests.
229
+ */
230
+ maxRetry?: number | undefined;
231
+ /**
232
+ * Amount of time, in milliseconds, after which a manifest request should be
233
+ * aborted and optionally retried, depending on the current configuration.
234
+ *
235
+ * Setting it to `-1` allows to disable any timeout.
236
+ * `undefined` means that a default, large, timeout will be used instead.
237
+ */
238
+ timeout?: number | undefined;
239
+ } | undefined;
240
+ segment?: {
241
+ /**
242
+ * The amount of time maximum we should retry a segment or segment-related
243
+ * request before failing on Error.
244
+ * Set to `Infinity` for an infinite number of requests.
245
+ */
246
+ maxRetry?: number | undefined;
247
+ /**
248
+ * Amount of time, in milliseconds, after which a segment request should be
249
+ * aborted and optionally retried, depending on the current configuration.
250
+ *
251
+ * Setting it to `-1` allows to disable any timeout.
252
+ * `undefined` means that a default, large, timeout will be used instead.
253
+ */
254
+ timeout?: number | undefined;
255
+ } | undefined;
354
256
  }
355
- export type ISegmentLoader = (infos: {
356
- url: string;
357
- timeout: number | undefined;
358
- manifest: IManifest;
359
- period: IPeriod;
360
- adaptation: IAdaptation;
361
- representation: IRepresentation;
362
- segment: IExposedSegment;
363
- }, callbacks: {
257
+ export type ISegmentLoader = (
258
+ /** Information on the segment to request */
259
+ context: ISegmentLoaderContext, callbacks: {
364
260
  resolve: (rArgs: {
365
261
  data: ArrayBuffer | Uint8Array;
366
262
  sendingTime?: number | undefined;
@@ -376,8 +272,53 @@ export type ISegmentLoader = (infos: {
376
272
  totalSize?: number | undefined;
377
273
  }) => void;
378
274
  }) => (() => void) | void;
275
+ /** Context given to a segment loader. */
276
+ export interface ISegmentLoaderContext {
277
+ /** URL where the segment should be loaded. */
278
+ url: string | undefined;
279
+ /**
280
+ * Indicative request timeout as configured on the RxPlayer.
281
+ */
282
+ timeout: number | undefined;
283
+ /**
284
+ * If true, this segment is an initialization segment with no decodable data.
285
+ *
286
+ * Those types of segment contain no decodable data and are only there for
287
+ * initialization purposes, such as giving initial infos to the decoder on
288
+ * subsequent media segments that will be pushed.
289
+ *
290
+ * Note that if `isInit` is false, it only means that the segment contains
291
+ * decodable media, it can also contain important initialization information.
292
+ *
293
+ * Also, a segment which would contain both all initialization data and the
294
+ * decodable data would have `isInit` set to `false` as it is not purely an
295
+ * initialization segment.
296
+ *
297
+ * Segments which are not purely an initialization segment are called "media
298
+ * segments" in the RxPlayer.
299
+ */
300
+ isInit: boolean | undefined;
301
+ /**
302
+ * If set, only the corresponding byte-ranges, which are subsets in bytes of
303
+ * the loaded data, should be loaded.
304
+ * If multiple non-contiguous byte-ranges are given, the result should be
305
+ * the concatenation of those byte-ranges, in the same order.
306
+ *
307
+ * For example `[[0, 100], [150, 180]]` means that the bytes of both 0 to 100
308
+ * (included) and from 150 to 180 (included) should be requested.
309
+ * The communicated result should then be a concatenation of both in the same
310
+ * order.
311
+ */
312
+ byteRanges?: Array<[number, number]> | undefined;
313
+ /** Type of the corresponding track. */
314
+ type: ITrackType;
315
+ }
316
+ /** Every possible value for the Adaptation's `type` property. */
317
+ export type ITrackType = "video" | "audio" | "text";
379
318
  export type ILoadedManifestFormat = IInitialManifest;
380
- export type IManifestLoader = (url: string | undefined, callbacks: {
319
+ export type IManifestLoader = (
320
+ /** Information on the wanted Manifest. */
321
+ info: IManifestLoaderInfo, callbacks: {
381
322
  resolve: (args: {
382
323
  data: ILoadedManifestFormat;
383
324
  url?: string | undefined;
@@ -388,9 +329,11 @@ export type IManifestLoader = (url: string | undefined, callbacks: {
388
329
  }) => void;
389
330
  reject: (err?: Error) => void;
390
331
  fallback: () => void;
391
- }, options: {
392
- timeout: number | undefined;
393
332
  }) => (() => void) | void;
333
+ export interface IManifestLoaderInfo {
334
+ url: string | undefined;
335
+ timeout: number | undefined;
336
+ }
394
337
  /** Options related to a single key system. */
395
338
  export interface IKeySystemOption {
396
339
  /**
@@ -414,23 +357,18 @@ export interface IKeySystemOption {
414
357
  * set.
415
358
  */
416
359
  serverCertificate?: BufferSource | null;
417
- /**
418
- * If `true`, we will try to persist the licenses obtained as well as try to
419
- * load already-persisted licenses.
420
- */
421
- persistentLicense?: boolean;
422
360
  /** Storage mechanism used to store and retrieve information on stored licenses. */
423
- licenseStorage?: IPersistentSessionStorage;
361
+ persistentLicenseConfig?: IPersistentLicenseConfig;
424
362
  /**
425
- * If true, we will require that the CDM is able to persist state.
426
- * See EME specification related to the `persistentState` configuration.
363
+ * Wanted value for the `persistentState` property of this
364
+ * `MediaKeySystemConfiguration` according to the EME API.
427
365
  */
428
- persistentStateRequired?: boolean;
366
+ persistentState?: MediaKeysRequirement | undefined;
429
367
  /**
430
- * If true, we will require that the CDM should use distinctive identyfiers.
431
- * See EME specification related to the `distinctiveIdentifier` configuration.
368
+ * Wanted value for the `distinctiveIdentifier` property of this
369
+ * `MediaKeySystemConfiguration` according to the EME API.
432
370
  */
433
- distinctiveIdentifierRequired?: boolean;
371
+ distinctiveIdentifier?: MediaKeysRequirement | undefined;
434
372
  /**
435
373
  * If true, all open MediaKeySession (used to decrypt the content) will be
436
374
  * closed when the current playback stops.
@@ -442,12 +380,8 @@ export interface IKeySystemOption {
442
380
  * MediaKeys.
443
381
  */
444
382
  maxSessionCacheSize?: number;
445
- /** Callback called when one of the key's status change. */
446
- onKeyStatusesChange?: (evt: Event, session: MediaKeySession | ICustomMediaKeySession) => Promise<BufferSource | null> | BufferSource | null;
447
- /** Allows to define custom robustnesses value for the video data. */
448
- videoRobustnesses?: Array<string | undefined>;
449
- /** Allows to define custom robustnesses value for the audio data. */
450
- audioRobustnesses?: Array<string | undefined>;
383
+ videoCapabilitiesConfig?: IVideoCapabilitiesConfiguration;
384
+ audioCapabilitiesConfig?: IAudioCapabilitiesConfiguration;
451
385
  /**
452
386
  * If explicitely set to `false`, we won't throw on error when a used license
453
387
  * is expired.
@@ -518,6 +452,48 @@ export interface IKeySystemOption {
518
452
  */
519
453
  onKeyExpiration?: "error" | "continue" | "fallback" | "close-session";
520
454
  }
455
+ /** Values that can be given to the `videoCapabilitiesConfig` `keySystems`'s property. */
456
+ export type IVideoCapabilitiesConfiguration = IRobustnessMediaKeySystemCapabilities | IContentTypeMediaKeySystemCapabilities | IFullMediaKeySystemCapabilities;
457
+ /** Values that can be given to the `audioCapabilitiesConfig` `keySystems`'s property. */
458
+ export type IAudioCapabilitiesConfiguration = IRobustnessMediaKeySystemCapabilities | IContentTypeMediaKeySystemCapabilities | IFullMediaKeySystemCapabilities;
459
+ /**
460
+ * Value that can be given to either the `audioCapabilitiesConfig` or to the
461
+ * `videoCapabilitiesConfig` `keySystems`'s property when the application only
462
+ * wants to specify the "robustness" part of the `MediaKeySystemMediaCapability`
463
+ * sent through the corresponding `MediaKeySystemConfiguration` used to decrypt
464
+ * the content.
465
+ *
466
+ * In this case, the RxPlayer will define potentially default values for
467
+ * other capability-related properties (such as the "contentType").
468
+ */
469
+ export interface IRobustnessMediaKeySystemCapabilities {
470
+ type: "robustness";
471
+ value: Array<string | undefined>;
472
+ }
473
+ /**
474
+ * Value that can be given to either the `audioCapabilitiesConfig` or to the
475
+ * `videoCapabilitiesConfig` `keySystems`'s property when the application only
476
+ * wants to specify the "contentType" part of the
477
+ * `MediaKeySystemMediaCapability` sent through the corresponding
478
+ * `MediaKeySystemConfiguration` used to decrypt the content.
479
+ *
480
+ * In this case, the RxPlayer will define potentially default values for
481
+ * other capability-related properties (such as the "robustness").
482
+ */
483
+ export interface IContentTypeMediaKeySystemCapabilities {
484
+ type: "contentType";
485
+ value: string[];
486
+ }
487
+ /**
488
+ * Value that can be given to either the `audioCapabilitiesConfig` or to the
489
+ * `videoCapabilitiesConfig` `keySystems`'s property when the application wants
490
+ * to specify the full `MediaKeySystemMediaCapability` object sent through the
491
+ * corresponding `MediaKeySystemConfiguration` used to decrypt the content.
492
+ */
493
+ export interface IFullMediaKeySystemCapabilities {
494
+ type: "full";
495
+ value: MediaKeySystemMediaCapability[];
496
+ }
521
497
  /**
522
498
  * Data stored in a persistent MediaKeySession storage.
523
499
  * Has to be versioned to be able to play MediaKeySessions persisted in an old
@@ -525,7 +501,7 @@ export interface IKeySystemOption {
525
501
  */
526
502
  export type IPersistentSessionInfo = IPersistentSessionInfoV4 | IPersistentSessionInfoV3 | IPersistentSessionInfoV2 | IPersistentSessionInfoV1 | IPersistentSessionInfoV0;
527
503
  /** Persistent MediaKeySession storage interface. */
528
- export interface IPersistentSessionStorage {
504
+ export interface IPersistentLicenseConfig {
529
505
  /** Load persistent MediaKeySessions previously saved through the `save` callback. */
530
506
  load(): IPersistentSessionInfo[] | undefined | null;
531
507
  /**
@@ -546,44 +522,6 @@ export interface IPersistentSessionStorage {
546
522
  */
547
523
  disableRetroCompatibility?: boolean;
548
524
  }
549
- /** Single preference for an audio track Adaptation. */
550
- export type IAudioTrackPreference = null | {
551
- language?: string;
552
- audioDescription?: boolean;
553
- codec?: {
554
- all: boolean;
555
- test: RegExp;
556
- };
557
- };
558
- /** Single preference for a text track Adaptation. */
559
- export type ITextTrackPreference = null | {
560
- language: string;
561
- forced?: boolean | undefined;
562
- closedCaption: boolean;
563
- };
564
- /** Single preference for a video track Adaptation. */
565
- export type IVideoTrackPreference = null | IVideoTrackPreferenceObject;
566
- /** Preference for a video track Adaptation for when it is not set to `null`. */
567
- interface IVideoTrackPreferenceObject {
568
- codec?: {
569
- all: boolean;
570
- test: RegExp;
571
- };
572
- signInterpreted?: boolean;
573
- }
574
- /** Payload emitted with a `bitrateEstimationChange` event. */
575
- export interface IBitrateEstimate {
576
- /** The type of buffer this estimate was done for (e.g. "audio). */
577
- type: IBufferType;
578
- /** The calculated bitrate, in bits per seconds. */
579
- bitrate: number | undefined;
580
- }
581
- export interface IDecipherabilityUpdateContent {
582
- manifest: IManifest;
583
- period: IPeriod;
584
- adaptation: IAdaptation;
585
- representation: IRepresentation;
586
- }
587
525
  /** Payload emitted with a `positionUpdate` event. */
588
526
  export interface IPositionUpdate {
589
527
  /** current position the player is in, in seconds. */
@@ -595,7 +533,7 @@ export interface IPositionUpdate {
595
533
  /** Amount of buffer available for now in front of the current position, in seconds. */
596
534
  bufferGap: number;
597
535
  /** Current maximum seekable position. */
598
- maximumBufferTime?: number | undefined;
536
+ maximumPosition?: number | undefined;
599
537
  wallClockTime?: number | undefined;
600
538
  /**
601
539
  * Only for live contents. Difference between the "live edge" and the current
@@ -603,7 +541,12 @@ export interface IPositionUpdate {
603
541
  */
604
542
  liveGap?: number | undefined;
605
543
  }
606
- export type IPlayerState = "STOPPED" | "LOADED" | "LOADING" | "PLAYING" | "PAUSED" | "ENDED" | "BUFFERING" | "SEEKING" | "RELOADING";
544
+ export type IPlayerState = "STOPPED" | "LOADED" | "LOADING" | "PLAYING" | "PAUSED" | "ENDED" | "BUFFERING" | "FREEZING" | "SEEKING" | "RELOADING";
545
+ export interface IPeriodChangeEvent {
546
+ start: number;
547
+ id: string;
548
+ end?: number | undefined;
549
+ }
607
550
  export type IStreamEvent = {
608
551
  data: IStreamEventData;
609
552
  start: number;
@@ -626,7 +569,7 @@ export type IPlayerError = EncryptedMediaError | MediaError | OtherError | Netwo
626
569
  * Information describing a single Representation from an Adaptation, to be used
627
570
  * in the `representationFilter` API.
628
571
  */
629
- export interface IRepresentationInfos {
572
+ export interface IRepresentationContext {
630
573
  bufferType: string;
631
574
  language?: string | undefined;
632
575
  isAudioDescription?: boolean | undefined;
@@ -635,51 +578,45 @@ export interface IRepresentationInfos {
635
578
  isSignInterpreted?: boolean | undefined;
636
579
  normalizedLanguage?: string | undefined;
637
580
  }
638
- export interface IBifThumbnail {
639
- index: number;
640
- duration: number;
641
- ts: number;
642
- data: Uint8Array;
643
- }
644
- export interface IBifObject {
645
- fileFormat: string;
646
- version: string;
647
- imageCount: number;
648
- timescale: number;
649
- format: string;
650
- width: number;
651
- height: number;
652
- aspectRatio: string;
653
- isVod: boolean;
654
- thumbs: IBifThumbnail[];
655
- }
656
581
  /**
657
582
  * Definition of a single audio Representation as represented by the
658
583
  * RxPlayer.
659
584
  */
660
585
  export interface IAudioRepresentation {
661
586
  id: string | number;
662
- isSpatialAudio?: boolean | undefined;
663
- bitrate: number;
587
+ bitrate?: number | undefined;
664
588
  codec?: string | undefined;
589
+ isSpatialAudio?: boolean | undefined;
590
+ isCodecSupported?: boolean | undefined;
591
+ seemsDecipherable?: boolean | undefined;
665
592
  }
666
593
  /** Audio track returned by the RxPlayer. */
667
594
  export interface IAudioTrack {
595
+ /** The language the audio track is in, as it is named in the Manifest. */
668
596
  language: string;
597
+ /**
598
+ * An attempt to translate `language` into a valid ISO639-3 language code.
599
+ * Kept equal to `language` if the attempt failed.
600
+ */
669
601
  normalized: string;
670
602
  audioDescription: boolean;
671
- dub?: boolean;
672
- id: number | string;
603
+ dub?: boolean | undefined;
604
+ id: string;
673
605
  label?: string | undefined;
674
606
  representations: IAudioRepresentation[];
675
607
  }
676
608
  /** Text track returned by the RxPlayer. */
677
609
  export interface ITextTrack {
610
+ /** The language the text track is in, as it is named in the Manifest. */
678
611
  language: string;
612
+ /**
613
+ * An attempt to translate `language` into a valid ISO639-3 language code.
614
+ * Kept equal to `language` if the attempt failed.
615
+ */
679
616
  normalized: string;
680
- closedCaption: boolean;
681
617
  forced: boolean | undefined;
682
- label: string | undefined;
618
+ closedCaption: boolean;
619
+ label?: string | undefined;
683
620
  id: number | string;
684
621
  }
685
622
  /**
@@ -687,20 +624,22 @@ export interface ITextTrack {
687
624
  * RxPlayer.
688
625
  */
689
626
  export interface IVideoRepresentation {
690
- id: string | number;
691
- bitrate: number;
627
+ id: string;
628
+ bitrate?: number | undefined;
692
629
  width?: number | undefined;
693
630
  height?: number | undefined;
694
631
  codec?: string | undefined;
695
- frameRate?: string | undefined;
632
+ frameRate?: number | undefined;
696
633
  hdrInfo?: IHDRInformation | undefined;
634
+ isCodecSupported?: boolean | undefined;
635
+ seemsDecipherable?: boolean | undefined;
697
636
  }
698
637
  /** Video track returned by the RxPlayer. */
699
638
  export interface IVideoTrack {
700
- id: number | string;
701
- signInterpreted?: boolean;
702
- isTrickModeTrack?: boolean;
703
- trickModeTracks?: IVideoTrack[];
639
+ id: string;
640
+ signInterpreted?: boolean | undefined;
641
+ isTrickModeTrack?: boolean | undefined;
642
+ trickModeTracks?: IVideoTrack[] | undefined;
704
643
  label?: string | undefined;
705
644
  representations: IVideoRepresentation[];
706
645
  }
@@ -711,6 +650,18 @@ export interface IKeySystemConfigurationOutput {
711
650
  /** `MediaKeySystemConfiguration` actually used by the key system. */
712
651
  configuration: MediaKeySystemConfiguration;
713
652
  }
653
+ /** Period from a list of Periods as returned by the RxPlayer. */
654
+ export interface IPeriod {
655
+ /** Start time in seconds at which the Period starts. */
656
+ start: number;
657
+ /**
658
+ * End time in seconds at which the Period ends.
659
+ * `undefined` if that end is unknown for now.
660
+ */
661
+ end: number | undefined;
662
+ /** Identifier for this Period allowing to perform track modification for it. */
663
+ id: string;
664
+ }
714
665
  /** Audio track from a list of audio tracks returned by the RxPlayer. */
715
666
  export interface IAvailableAudioTrack extends IAudioTrack {
716
667
  active: boolean;
@@ -733,3 +684,140 @@ export interface IEncryptedMediaErrorKeyStatusObject {
733
684
  /** Problematic MediaKeyStatus encountered. */
734
685
  keyStatus: MediaKeyStatus;
735
686
  }
687
+ /**
688
+ * Behavior wanted when replacing an audio track / Adaptation by another:
689
+ *
690
+ * - direct: Switch audio track immediately by removing all the previous
691
+ * track's data.
692
+ *
693
+ * This might interrupt playback while data for any of the new
694
+ * track wanted is loaded.
695
+ *
696
+ * - seamless: Switch audio track without interrupting playback by still
697
+ * keeping data from the previous track around the current
698
+ * position.
699
+ *
700
+ * This could have the disadvantage of still playing the previous
701
+ * track during a short time (not more than a few seconds in
702
+ * most cases).
703
+ *
704
+ * - reload: Reload content to provide an immediate interruption of the
705
+ * previous audio track before switching to the new one.
706
+ *
707
+ * Some targets might not handle "direct" mode properly. The "reload"
708
+ * mode is kind of a more compatible attempt of immediately switching the
709
+ * audio track.
710
+ */
711
+ export type IAudioTrackSwitchingMode = "direct" | "seamless" | "reload";
712
+ /**
713
+ * Behavior wanted when replacing a video track / Adaptation by another:
714
+ *
715
+ * - direct: Switch video track immediately by removing all the previous
716
+ * track's data.
717
+ *
718
+ * This might interrupt playback while data for any of the new
719
+ * track wanted is loaded.
720
+ * Moreover, the previous video frame at the time of the switch will
721
+ * probably still be on display while this is happening. If this is
722
+ * not something you want, you might prefer the "reload" mode.
723
+ *
724
+ * - seamless: Switch video track without interrupting playback by still
725
+ * keeping data from the previous track around the current
726
+ * position.
727
+ * This could have the disadvantage of still playing the previous
728
+ * track during a short time (not more than a few seconds in
729
+ * most cases).
730
+ *
731
+ * - reload: Reload content to provide an immediate interruption of the
732
+ * previous video track before switching to the new one.
733
+ *
734
+ * This can be seen like the "direct" mode with two differences:
735
+ *
736
+ * - The "direct" mode might rebuffer for a time with the previous
737
+ * frame displaying. With "reload" a black screen will probably be shown
738
+ * instead.
739
+ *
740
+ * - some targets might not handle "direct" mode properly. The "reload"
741
+ * mode is kind of a more compatible attempt of immediately switching the
742
+ * Adaptation.
743
+ */
744
+ export type IVideoTrackSwitchingMode = "direct" | "seamless" | "reload";
745
+ export type IVideoRepresentationsSwitchingMode = IRepresentationsSwitchingMode;
746
+ export type IAudioRepresentationsSwitchingMode = IRepresentationsSwitchingMode;
747
+ /**
748
+ * Behavior wanted when replacing active Representations by others:
749
+ *
750
+ * - direct: Switch Representation immediately by removing all the previous
751
+ * Representations's data.
752
+ * This might interrupt playback while data for any of the new
753
+ * Representations wanted is loaded.
754
+ *
755
+ * If talking about video Representations, the previous video frame at the
756
+ * time of the switch will probably still be on display while this is
757
+ * happening.
758
+ * If this is not something you want, you might prefer the "reload" mode.
759
+ *
760
+ * - seamless: Switch Representation without interrupting playback by still
761
+ * keeping data from the previous Representations around the current
762
+ * position.
763
+ * This could have the disadvantage of still playing the previous
764
+ * Representations during a short time (not more than a few seconds in
765
+ * most cases).
766
+ *
767
+ * - reload: Reload `MediaSource` to provide an immediate interruption of the
768
+ * previous interruption before switching to the new Representation.
769
+ *
770
+ * This can be seen like the "direct" mode with two differences:
771
+ *
772
+ * - in case of video contents, the "direct" mode might rebuffer for a
773
+ * time with the previous frame displaying. With "reload" a black screen
774
+ * will probably be shown instead.
775
+ *
776
+ * - some targets might not handle "direct" mode properly. The "reload"
777
+ * mode is kind of a more compatible attempt of immediately switching the
778
+ * Representation.
779
+ *
780
+ * - lazy: Keep data from the previous Representation in the buffer.
781
+ * It still might eventually be replaced by Representation of a better
782
+ * quality when depending on future playback condition.
783
+ */
784
+ type IRepresentationsSwitchingMode = "direct" | "seamless" | "reload" | "lazy";
785
+ export interface IBrokenRepresentationsLockContext {
786
+ period: IPeriod;
787
+ trackType: ITrackType;
788
+ }
789
+ export interface ITrackUpdateEventPayload {
790
+ period: IPeriod;
791
+ trackType: ITrackType;
792
+ reason: "missing" | // Missing from Manifest update
793
+ "manual" | // Manually and explicitely updated
794
+ "trickmode-enabled" | // Video trickmode tracks being enabled
795
+ "trickmode-disabled" | // Video trickmode tracks being disabled
796
+ string;
797
+ }
798
+ export interface ILockedVideoRepresentationsSettings {
799
+ representations: string[];
800
+ periodId?: string | undefined;
801
+ switchingMode?: IVideoRepresentationsSwitchingMode | undefined;
802
+ }
803
+ export interface ILockedAudioRepresentationsSettings {
804
+ representations: string[];
805
+ periodId?: string | undefined;
806
+ switchingMode?: IAudioRepresentationsSwitchingMode | undefined;
807
+ }
808
+ export interface IAudioTrackSetting {
809
+ trackId: string;
810
+ periodId?: string | undefined;
811
+ switchingMode?: IAudioTrackSwitchingMode | undefined;
812
+ lockedRepresentations?: string[] | undefined;
813
+ }
814
+ export interface IVideoTrackSetting {
815
+ trackId: string;
816
+ periodId?: string | undefined;
817
+ switchingMode?: IVideoTrackSwitchingMode | undefined;
818
+ lockedRepresentations?: string[] | undefined;
819
+ }
820
+ export interface ITextTrackSetting {
821
+ trackId: string;
822
+ periodId?: string | undefined;
823
+ }