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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/CHANGELOG.md +20 -60
  2. package/FILES.md +1 -1
  3. package/README.md +2 -33
  4. package/VERSION +1 -1
  5. package/dist/_esm5.processed/core/api/debug/buffer_graph.js +2 -6
  6. package/dist/_esm5.processed/core/api/debug/modules/general_info.js +20 -10
  7. package/dist/_esm5.processed/core/api/option_utils.d.ts +0 -2
  8. package/dist/_esm5.processed/core/api/option_utils.js +0 -6
  9. package/dist/_esm5.processed/core/api/public_api.d.ts +1 -2
  10. package/dist/_esm5.processed/core/api/public_api.js +9 -17
  11. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +1 -1
  12. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +3 -14
  13. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +2 -36
  14. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +2 -82
  15. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  16. package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +1 -1
  17. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  18. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
  19. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
  20. package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +2 -2
  21. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
  22. package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +19 -10
  23. package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.js +1 -1
  24. package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.js +1 -1
  25. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_extent.js +1 -8
  26. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  27. package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_origin.js +1 -9
  28. package/dist/_esm5.processed/public_types.d.ts +2 -0
  29. package/dist/commonjs/compat/is_codec_supported.js +22 -1
  30. package/dist/commonjs/config.d.ts +2 -1
  31. package/dist/commonjs/core/adaptive/adaptive_representation_selector.d.ts +2 -19
  32. package/dist/commonjs/core/adaptive/adaptive_representation_selector.js +2 -2
  33. package/dist/commonjs/core/adaptive/network_analyzer.js +3 -3
  34. package/dist/commonjs/core/api/debug/buffer_graph.js +2 -6
  35. package/dist/commonjs/core/api/debug/modules/general_info.js +17 -10
  36. package/dist/commonjs/core/api/index.d.ts +1 -1
  37. package/dist/commonjs/core/api/option_utils.d.ts +2 -0
  38. package/dist/commonjs/core/api/option_utils.js +2 -3
  39. package/dist/commonjs/core/api/playback_observer.d.ts +128 -8
  40. package/dist/commonjs/core/api/playback_observer.js +217 -64
  41. package/dist/commonjs/core/api/public_api.d.ts +9 -0
  42. package/dist/commonjs/core/api/public_api.js +41 -16
  43. package/dist/commonjs/core/api/utils.js +1 -1
  44. package/dist/commonjs/core/decrypt/get_media_keys.js +2 -6
  45. package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
  46. package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.js +11 -3
  47. package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts +8 -1
  48. package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +8 -4
  49. package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
  50. package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
  51. package/dist/commonjs/core/init/directfile_content_initializer.js +29 -8
  52. package/dist/commonjs/core/init/media_source_content_initializer.d.ts +6 -0
  53. package/dist/commonjs/core/init/media_source_content_initializer.js +32 -20
  54. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  55. package/dist/commonjs/core/init/utils/content_time_boundaries_observer.js +17 -19
  56. package/dist/commonjs/core/init/utils/create_stream_playback_observer.d.ts +1 -5
  57. package/dist/commonjs/core/init/utils/create_stream_playback_observer.js +16 -14
  58. package/dist/commonjs/core/init/utils/get_initial_time.d.ts +17 -3
  59. package/dist/commonjs/core/init/utils/get_initial_time.js +9 -7
  60. package/dist/commonjs/core/init/utils/initial_seek_and_play.d.ts +9 -11
  61. package/dist/commonjs/core/init/utils/initial_seek_and_play.js +121 -91
  62. package/dist/commonjs/core/init/utils/rebuffering_controller.js +27 -70
  63. package/dist/commonjs/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -2
  64. package/dist/commonjs/core/segment_buffers/garbage_collector.js +1 -2
  65. package/dist/commonjs/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  66. package/dist/commonjs/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  67. package/dist/commonjs/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
  68. package/dist/commonjs/core/segment_buffers/index.d.ts +2 -2
  69. package/dist/commonjs/core/segment_buffers/inventory/index.d.ts +2 -2
  70. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
  71. package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.js +19 -10
  72. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.d.ts +2 -2
  73. package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.js +16 -9
  74. package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +14 -18
  75. package/dist/commonjs/core/stream/period/period_stream.js +5 -8
  76. package/dist/commonjs/core/stream/period/types.d.ts +2 -3
  77. package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
  78. package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.js +17 -13
  79. package/dist/commonjs/core/stream/representation/representation_stream.js +3 -4
  80. package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
  81. package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.js +11 -12
  82. package/dist/commonjs/core/stream/representation/utils/get_buffer_status.js +4 -4
  83. package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +1 -1
  84. package/dist/commonjs/default_config.d.ts +12 -16
  85. package/dist/commonjs/default_config.js +21 -16
  86. package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
  87. package/dist/commonjs/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
  88. package/dist/commonjs/manifest/adaptation.js +2 -1
  89. package/dist/commonjs/manifest/representation_index/static.d.ts +1 -1
  90. package/dist/commonjs/manifest/representation_index/static.js +2 -2
  91. package/dist/commonjs/manifest/representation_index/types.d.ts +4 -4
  92. package/dist/commonjs/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
  93. package/dist/commonjs/parsers/manifest/dash/common/indexes/base.js +4 -3
  94. package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  95. package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  96. package/dist/commonjs/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  97. package/dist/commonjs/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
  98. package/dist/commonjs/parsers/manifest/dash/common/indexes/list.js +2 -2
  99. package/dist/commonjs/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
  100. package/dist/commonjs/parsers/manifest/dash/common/indexes/template.js +42 -29
  101. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  102. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
  103. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +250 -51
  104. package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  105. package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  106. package/dist/commonjs/parsers/manifest/dash/common/parse_adaptation_sets.js +13 -10
  107. package/dist/commonjs/parsers/manifest/dash/common/parse_mpd.js +27 -14
  108. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  109. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +17 -18
  110. package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
  111. package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.js +21 -8
  112. package/dist/commonjs/parsers/manifest/dash/common/parse_representations.js +7 -3
  113. package/dist/commonjs/parsers/manifest/local/representation_index.d.ts +1 -1
  114. package/dist/commonjs/parsers/manifest/local/representation_index.js +3 -3
  115. package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
  116. package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.js +2 -2
  117. package/dist/commonjs/parsers/manifest/smooth/representation_index.d.ts +5 -5
  118. package/dist/commonjs/parsers/manifest/smooth/representation_index.js +25 -9
  119. package/dist/commonjs/parsers/manifest/utils/index_helpers.js +1 -1
  120. package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  121. package/dist/commonjs/public_types.d.ts +107 -36
  122. package/dist/commonjs/transports/dash/init_segment_loader.js +10 -5
  123. package/dist/commonjs/transports/dash/manifest_parser.js +5 -2
  124. package/dist/commonjs/transports/dash/segment_loader.js +2 -1
  125. package/dist/commonjs/transports/dash/text_loader.js +2 -0
  126. package/dist/commonjs/transports/metaplaylist/manifest_loader.js +2 -1
  127. package/dist/commonjs/transports/metaplaylist/pipelines.js +4 -1
  128. package/dist/commonjs/transports/smooth/pipelines.js +4 -2
  129. package/dist/commonjs/transports/smooth/segment_loader.js +2 -1
  130. package/dist/commonjs/transports/types.d.ts +12 -0
  131. package/dist/commonjs/transports/utils/generate_manifest_loader.js +6 -3
  132. package/dist/commonjs/utils/request/fetch.d.ts +6 -0
  133. package/dist/commonjs/utils/request/fetch.js +29 -8
  134. package/dist/commonjs/utils/request/xhr.d.ts +11 -5
  135. package/dist/commonjs/utils/request/xhr.js +29 -8
  136. package/dist/es2017/compat/is_codec_supported.js +22 -1
  137. package/dist/es2017/config.d.ts +2 -1
  138. package/dist/es2017/core/adaptive/adaptive_representation_selector.d.ts +2 -19
  139. package/dist/es2017/core/adaptive/adaptive_representation_selector.js +2 -2
  140. package/dist/es2017/core/adaptive/network_analyzer.js +3 -3
  141. package/dist/es2017/core/api/debug/buffer_graph.js +2 -6
  142. package/dist/es2017/core/api/debug/modules/general_info.js +17 -10
  143. package/dist/es2017/core/api/index.d.ts +1 -1
  144. package/dist/es2017/core/api/option_utils.d.ts +2 -0
  145. package/dist/es2017/core/api/option_utils.js +2 -3
  146. package/dist/es2017/core/api/playback_observer.d.ts +128 -8
  147. package/dist/es2017/core/api/playback_observer.js +217 -66
  148. package/dist/es2017/core/api/public_api.d.ts +9 -0
  149. package/dist/es2017/core/api/public_api.js +40 -15
  150. package/dist/es2017/core/api/utils.js +1 -1
  151. package/dist/es2017/core/decrypt/get_media_keys.js +2 -6
  152. package/dist/es2017/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
  153. package/dist/es2017/core/fetchers/manifest/manifest_fetcher.js +11 -3
  154. package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts +8 -1
  155. package/dist/es2017/core/fetchers/segment/segment_fetcher.js +8 -4
  156. package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
  157. package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
  158. package/dist/es2017/core/init/directfile_content_initializer.js +31 -8
  159. package/dist/es2017/core/init/media_source_content_initializer.d.ts +6 -0
  160. package/dist/es2017/core/init/media_source_content_initializer.js +34 -22
  161. package/dist/es2017/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
  162. package/dist/es2017/core/init/utils/content_time_boundaries_observer.js +17 -17
  163. package/dist/es2017/core/init/utils/create_stream_playback_observer.d.ts +1 -5
  164. package/dist/es2017/core/init/utils/create_stream_playback_observer.js +16 -14
  165. package/dist/es2017/core/init/utils/get_initial_time.d.ts +17 -3
  166. package/dist/es2017/core/init/utils/get_initial_time.js +9 -7
  167. package/dist/es2017/core/init/utils/initial_seek_and_play.d.ts +9 -11
  168. package/dist/es2017/core/init/utils/initial_seek_and_play.js +120 -91
  169. package/dist/es2017/core/init/utils/rebuffering_controller.js +27 -70
  170. package/dist/es2017/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -2
  171. package/dist/es2017/core/segment_buffers/garbage_collector.js +1 -2
  172. package/dist/es2017/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
  173. package/dist/es2017/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
  174. package/dist/es2017/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
  175. package/dist/es2017/core/segment_buffers/index.d.ts +2 -2
  176. package/dist/es2017/core/segment_buffers/inventory/index.d.ts +2 -2
  177. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
  178. package/dist/es2017/core/segment_buffers/inventory/segment_inventory.js +19 -10
  179. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.d.ts +2 -2
  180. package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.js +16 -9
  181. package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +16 -18
  182. package/dist/es2017/core/stream/period/period_stream.js +4 -7
  183. package/dist/es2017/core/stream/period/types.d.ts +2 -3
  184. package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
  185. package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.js +17 -13
  186. package/dist/es2017/core/stream/representation/representation_stream.js +3 -4
  187. package/dist/es2017/core/stream/representation/types.d.ts +2 -2
  188. package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.js +1 -2
  189. package/dist/es2017/core/stream/representation/utils/get_buffer_status.js +4 -4
  190. package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -1
  191. package/dist/es2017/default_config.d.ts +12 -16
  192. package/dist/es2017/default_config.js +21 -16
  193. package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
  194. package/dist/es2017/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
  195. package/dist/es2017/manifest/adaptation.js +2 -1
  196. package/dist/es2017/manifest/representation_index/static.d.ts +1 -1
  197. package/dist/es2017/manifest/representation_index/static.js +2 -2
  198. package/dist/es2017/manifest/representation_index/types.d.ts +4 -4
  199. package/dist/es2017/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
  200. package/dist/es2017/parsers/manifest/dash/common/indexes/base.js +4 -3
  201. package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
  202. package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
  203. package/dist/es2017/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
  204. package/dist/es2017/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
  205. package/dist/es2017/parsers/manifest/dash/common/indexes/list.js +2 -2
  206. package/dist/es2017/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
  207. package/dist/es2017/parsers/manifest/dash/common/indexes/template.js +40 -27
  208. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
  209. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
  210. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +246 -51
  211. package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
  212. package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
  213. package/dist/es2017/parsers/manifest/dash/common/parse_adaptation_sets.js +11 -8
  214. package/dist/es2017/parsers/manifest/dash/common/parse_mpd.js +27 -13
  215. package/dist/es2017/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
  216. package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +13 -16
  217. package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
  218. package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.js +10 -8
  219. package/dist/es2017/parsers/manifest/dash/common/parse_representations.js +7 -3
  220. package/dist/es2017/parsers/manifest/local/representation_index.d.ts +1 -1
  221. package/dist/es2017/parsers/manifest/local/representation_index.js +3 -3
  222. package/dist/es2017/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
  223. package/dist/es2017/parsers/manifest/metaplaylist/representation_index.js +2 -2
  224. package/dist/es2017/parsers/manifest/smooth/representation_index.d.ts +5 -5
  225. package/dist/es2017/parsers/manifest/smooth/representation_index.js +25 -9
  226. package/dist/es2017/parsers/manifest/utils/index_helpers.js +1 -1
  227. package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
  228. package/dist/es2017/public_types.d.ts +107 -36
  229. package/dist/es2017/transports/dash/init_segment_loader.js +5 -0
  230. package/dist/es2017/transports/dash/manifest_parser.js +3 -0
  231. package/dist/es2017/transports/dash/segment_loader.js +1 -0
  232. package/dist/es2017/transports/dash/text_loader.js +2 -0
  233. package/dist/es2017/transports/metaplaylist/manifest_loader.js +1 -0
  234. package/dist/es2017/transports/metaplaylist/pipelines.js +4 -1
  235. package/dist/es2017/transports/smooth/pipelines.js +2 -0
  236. package/dist/es2017/transports/smooth/segment_loader.js +1 -0
  237. package/dist/es2017/transports/types.d.ts +12 -0
  238. package/dist/es2017/transports/utils/generate_manifest_loader.js +3 -0
  239. package/dist/es2017/utils/request/fetch.d.ts +6 -0
  240. package/dist/es2017/utils/request/fetch.js +29 -8
  241. package/dist/es2017/utils/request/xhr.d.ts +11 -5
  242. package/dist/es2017/utils/request/xhr.js +30 -9
  243. package/dist/mpd-parser.wasm +0 -0
  244. package/dist/rx-player.js +1335 -812
  245. package/dist/rx-player.min.js +1 -1
  246. package/package.json +7 -4
  247. package/scripts/canal-release.patch +78 -0
  248. package/scripts/make-dev-releases +65 -0
  249. package/scripts/update-version +7 -0
  250. package/sonar-project.properties +1 -1
  251. package/src/compat/is_codec_supported.ts +23 -1
  252. package/src/core/adaptive/adaptive_representation_selector.ts +4 -21
  253. package/src/core/adaptive/network_analyzer.ts +3 -3
  254. package/src/core/api/debug/buffer_graph.ts +2 -5
  255. package/src/core/api/debug/modules/general_info.ts +15 -10
  256. package/src/core/api/index.ts +1 -0
  257. package/src/core/api/option_utils.ts +3 -3
  258. package/src/core/api/playback_observer.ts +327 -107
  259. package/src/core/api/public_api.ts +42 -14
  260. package/src/core/api/utils.ts +3 -1
  261. package/src/core/decrypt/get_media_keys.ts +2 -8
  262. package/src/core/fetchers/manifest/manifest_fetcher.ts +21 -3
  263. package/src/core/fetchers/segment/segment_fetcher.ts +19 -5
  264. package/src/core/fetchers/segment/segment_fetcher_creator.ts +1 -0
  265. package/src/core/fetchers/utils/schedule_request.ts +1 -1
  266. package/src/core/init/directfile_content_initializer.ts +31 -15
  267. package/src/core/init/media_source_content_initializer.ts +40 -27
  268. package/src/core/init/utils/content_time_boundaries_observer.ts +24 -23
  269. package/src/core/init/utils/create_stream_playback_observer.ts +19 -20
  270. package/src/core/init/utils/get_initial_time.ts +25 -12
  271. package/src/core/init/utils/initial_seek_and_play.ts +140 -108
  272. package/src/core/init/utils/rebuffering_controller.ts +32 -77
  273. package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +5 -2
  274. package/src/core/segment_buffers/garbage_collector.ts +1 -1
  275. package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +10 -2
  276. package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +1 -1
  277. package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +1 -1
  278. package/src/core/segment_buffers/index.ts +2 -0
  279. package/src/core/segment_buffers/inventory/index.ts +2 -0
  280. package/src/core/segment_buffers/inventory/segment_inventory.ts +49 -17
  281. package/src/core/stream/adaptation/get_representations_switch_strategy.ts +21 -12
  282. package/src/core/stream/orchestrator/stream_orchestrator.ts +14 -19
  283. package/src/core/stream/period/period_stream.ts +7 -8
  284. package/src/core/stream/period/types.ts +2 -3
  285. package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +21 -15
  286. package/src/core/stream/representation/representation_stream.ts +3 -5
  287. package/src/core/stream/representation/types.ts +2 -2
  288. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +1 -1
  289. package/src/core/stream/representation/utils/get_buffer_status.ts +5 -4
  290. package/src/core/stream/representation/utils/get_needed_segments.ts +2 -2
  291. package/src/default_config.ts +22 -17
  292. package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +3 -1
  293. package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +2 -0
  294. package/src/manifest/adaptation.ts +2 -1
  295. package/src/manifest/representation_index/static.ts +2 -2
  296. package/src/manifest/representation_index/types.ts +4 -4
  297. package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +182 -36
  298. package/src/parsers/manifest/dash/common/indexes/base.ts +12 -4
  299. package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +19 -5
  300. package/src/parsers/manifest/dash/common/indexes/index.ts +16 -4
  301. package/src/parsers/manifest/dash/common/indexes/list.ts +2 -2
  302. package/src/parsers/manifest/dash/common/indexes/template.ts +52 -31
  303. package/src/parsers/manifest/dash/common/indexes/timeline/index.ts +4 -1
  304. package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +366 -60
  305. package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +63 -25
  306. package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +10 -4
  307. package/src/parsers/manifest/dash/common/parse_mpd.ts +28 -15
  308. package/src/parsers/manifest/dash/common/parse_periods.ts +12 -17
  309. package/src/parsers/manifest/dash/common/parse_representation_index.ts +50 -26
  310. package/src/parsers/manifest/dash/common/parse_representations.ts +9 -3
  311. package/src/parsers/manifest/local/representation_index.ts +3 -3
  312. package/src/parsers/manifest/metaplaylist/representation_index.ts +2 -2
  313. package/src/parsers/manifest/smooth/representation_index.ts +23 -9
  314. package/src/parsers/manifest/utils/__tests__/get_first_time_from_adaptations.test.ts +1 -1
  315. package/src/parsers/manifest/utils/__tests__/get_last_time_from_adaptation.test.ts +1 -1
  316. package/src/parsers/manifest/utils/index_helpers.ts +1 -1
  317. package/src/parsers/texttracks/ttml/html/apply_line_height.ts +3 -1
  318. package/src/public_types.ts +108 -36
  319. package/src/transports/dash/init_segment_loader.ts +5 -0
  320. package/src/transports/dash/manifest_parser.ts +6 -0
  321. package/src/transports/dash/segment_loader.ts +1 -0
  322. package/src/transports/dash/text_loader.ts +2 -0
  323. package/src/transports/metaplaylist/manifest_loader.ts +1 -0
  324. package/src/transports/metaplaylist/pipelines.ts +4 -1
  325. package/src/transports/smooth/pipelines.ts +2 -0
  326. package/src/transports/smooth/segment_loader.ts +1 -0
  327. package/src/transports/types.ts +12 -0
  328. package/src/transports/utils/generate_manifest_loader.ts +3 -0
  329. package/src/utils/request/fetch.ts +35 -8
  330. package/src/utils/request/xhr.ts +45 -14
  331. package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  332. package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.js +0 -54
  333. package/dist/es2017/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
  334. package/dist/es2017/parsers/manifest/utils/is_segment_still_available.js +0 -51
  335. package/src/parsers/manifest/utils/is_segment_still_available.ts +0 -58
  336. package/src/typings/object-assign.d.ts +0 -48
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rx-player",
3
3
  "author": "Canal+",
4
- "version": "4.0.0-dev.2023111400",
4
+ "version": "4.0.0-dev.2023121900",
5
5
  "description": "Canal+ HTML5 Video Player",
6
6
  "main": "./dist/commonjs/index.js",
7
7
  "module": "./dist/es2017/index.js",
@@ -138,12 +138,13 @@
138
138
  "demo": "node ./scripts/build_demo.mjs --production-mode",
139
139
  "demo:min": "node ./scripts/build_demo.mjs --production-mode --minify",
140
140
  "demo:watch": "node ./scripts/build_demo.mjs --watch --production-mode",
141
- "doc": "docgen.ico doc/ doc/generated \"$(cat VERSION)\"",
141
+ "doc": "readme.doc doc/ doc/generated \"$(cat VERSION)\"",
142
142
  "lint": "eslint src -c .eslintrc.js",
143
143
  "lint:demo": "eslint -c demo/full/.eslintrc.js demo/full/scripts",
144
144
  "lint:tests": "eslint tests/**/*.js --ignore-pattern '/tests/performance/bundle*'",
145
145
  "list": "node scripts/list-npm-scripts.mjs",
146
146
  "prepublishOnly": "npm run build:all",
147
+ "releases:dev": "./scripts/make-dev-releases",
147
148
  "standalone": "node ./scripts/run_standalone_demo.mjs",
148
149
  "start": "node ./scripts/start_demo_web_server.mjs",
149
150
  "sart:wasm": "node ./scripts/start_demo_web_server.mjs --include-wasm",
@@ -172,6 +173,7 @@
172
173
  "@babel/plugin-transform-runtime": "7.22.15",
173
174
  "@babel/preset-env": "7.22.20",
174
175
  "@babel/preset-react": "7.22.15",
176
+ "@canalplus/readme.doc": "^0.3.0",
175
177
  "@types/chai": "4.3.6",
176
178
  "@types/jest": "29.5.5",
177
179
  "@types/mocha": "10.0.1",
@@ -185,7 +187,6 @@
185
187
  "babel-loader": "9.1.3",
186
188
  "chai": "4.3.8",
187
189
  "core-js": "3.32.2",
188
- "docgen.ico": "^0.2.3",
189
190
  "esbuild": "0.19.3",
190
191
  "eslint": "8.50.0",
191
192
  "eslint-plugin-ban": "1.6.0",
@@ -215,7 +216,6 @@
215
216
  "terser-webpack-plugin": "5.3.9",
216
217
  "ts-jest": "29.1.1",
217
218
  "ts-loader": "9.4.4",
218
- "tslint": "6.1.3",
219
219
  "typescript": "5.2.2",
220
220
  "webpack": "5.88.2",
221
221
  "webpack-cli": "5.1.4"
@@ -283,6 +283,9 @@
283
283
  "doc": "Generate the HTML documentation in doc/generated/pages"
284
284
  },
285
285
  "Update the RxPlayer's version": {
286
+ },
287
+ "Make a release": {
288
+ "releases:dev": "Produce dev npm releases (which are tagged pre-releases on npm) with the code in the current branch",
286
289
  "update-version": "Update the version to the string given in argument (example: `npm run update-version 3.8.0`). Will update the codebase and perform every builds."
287
290
  }
288
291
  }
@@ -0,0 +1,78 @@
1
+ diff --git a/src/parsers/texttracks/ttml/html/apply_extent.ts b/src/parsers/texttracks/ttml/html/apply_extent.ts
2
+ index 5772fa8fb..eb3a051e4 100644
3
+ --- a/src/parsers/texttracks/ttml/html/apply_extent.ts
4
+ +++ b/src/parsers/texttracks/ttml/html/apply_extent.ts
5
+ @@ -54,7 +54,14 @@ export default function applyExtent(
6
+ secondExtent[2] === "%" ||
7
+ secondExtent[2] === "em")
8
+ {
9
+ - element.style.height = secondExtent[1] + secondExtent[2];
10
+ + const toNum = Number(secondExtent[1]);
11
+ + if (secondExtent[2] === "%" && !isNaN(toNum) &&
12
+ + (toNum < 0 || toNum > 100))
13
+ + {
14
+ + element.style.width = "80%";
15
+ + } else {
16
+ + element.style.height = secondExtent[1] + secondExtent[2];
17
+ + }
18
+ } else if (secondExtent[2] === "c") {
19
+ addClassName(element, "proportional-style");
20
+ element.setAttribute("data-proportional-height", secondExtent[1]);
21
+ diff --git a/src/parsers/texttracks/ttml/html/apply_line_height.ts b/src/parsers/texttracks/ttml/html/apply_line_height.ts
22
+ index 4f727229a..253aa1a72 100644
23
+ --- a/src/parsers/texttracks/ttml/html/apply_line_height.ts
24
+ +++ b/src/parsers/texttracks/ttml/html/apply_line_height.ts
25
+ @@ -14,16 +14,15 @@
26
+ * limitations under the License.
27
+ */
28
+
29
+ -import { addClassName } from "../../../../compat";
30
+ import log from "../../../../log";
31
+ import { REGXP_LENGTH } from "../regexps";
32
+
33
+ /**
34
+ - * @param {HTMLElement} element
35
+ + * @param {HTMLElement} _element
36
+ * @param {string} lineHeight
37
+ */
38
+ export default function applyLineHeight(
39
+ - element : HTMLElement,
40
+ + _element : HTMLElement,
41
+ lineHeight : string
42
+ ) : void {
43
+ const trimmedLineHeight = lineHeight.trim();
44
+ @@ -40,10 +39,10 @@ export default function applyLineHeight(
45
+ firstLineHeight[2] === "%" ||
46
+ firstLineHeight[2] === "em")
47
+ {
48
+ - element.style.lineHeight = firstLineHeight[1] + firstLineHeight[2];
49
+ + // element.style.lineHeight = firstLineHeight[1] + firstLineHeight[2];
50
+ } else if (firstLineHeight[2] === "c") {
51
+ - addClassName(element, "proportional-style");
52
+ - element.setAttribute("data-proportional-line-height", firstLineHeight[1]);
53
+ + // addClassName(element, "proportional-style");
54
+ + // element.setAttribute("data-proportional-line-height", firstLineHeight[1]);
55
+ } else {
56
+ log.warn("TTML Parser: unhandled lineHeight unit:", firstLineHeight[2]);
57
+ }
58
+ diff --git a/src/parsers/texttracks/ttml/html/apply_origin.ts b/src/parsers/texttracks/ttml/html/apply_origin.ts
59
+ index 01a205aad..91d69fa3c 100644
60
+ --- a/src/parsers/texttracks/ttml/html/apply_origin.ts
61
+ +++ b/src/parsers/texttracks/ttml/html/apply_origin.ts
62
+ @@ -53,7 +53,15 @@ export default function applyOrigin(
63
+ secondOrigin[2] === "%" ||
64
+ secondOrigin[2] === "em")
65
+ {
66
+ - element.style.top = secondOrigin[1] + secondOrigin[2];
67
+ + const toNum = Number(secondOrigin[1]);
68
+ + if (secondOrigin[2] === "%" && !isNaN(toNum) &&
69
+ + (toNum < 0 || toNum > 100))
70
+ + {
71
+ + element.style.bottom = "5%";
72
+ + element.style.left = "10%";
73
+ + } else {
74
+ + element.style.top = secondOrigin[1] + secondOrigin[2];
75
+ + }
76
+ } else if (secondOrigin[2] === "c") {
77
+ addClassName(element, "proportional-style");
78
+ element.setAttribute("data-proportional-top", secondOrigin[1]);
@@ -0,0 +1,65 @@
1
+ #!/bin/bash
2
+
3
+ # make-dev-releases
4
+ # =================
5
+ #
6
+ # This script produces pre-releases on top of the current branch for the
7
+ # `dev-v4` and `canal-v4` versions (as per their npm tags).
8
+ #
9
+ # To use it:
10
+ #
11
+ # 1. Be sure that you're on the branch corresponding to the pre-release you
12
+ # want to publish, at the repository's root directory.
13
+ #
14
+ # 2. Call this script followed with the corresponding version number it would
15
+ # have as an official release in the `MAJOR.MINOR.PATCH` format (e.g.
16
+ # `./update-version 4.1.3`). Special suffix corresponding to the date and
17
+ # tag will be added automatically by this script.
18
+ #
19
+ # 3. When the script ask you to confirm, check that the preceding commands did
20
+ # not output any issue and if it didn't you can confirm.
21
+ #
22
+ # 4. That's it!
23
+
24
+ set -e
25
+
26
+ current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
27
+ version=$1
28
+ date=$(date "+%Y%m%d")
29
+ dev_branch="release/v${version}-dev.${date}00"
30
+ canal_branch="release/v${version}-canal.${date}00"
31
+
32
+ git checkout -b ${dev_branch}
33
+ ./scripts/update-version $1-dev.${date}00
34
+ git add --all
35
+ git commit -m "update version"
36
+ while true; do
37
+ read -n1 -p "Do you wish to push and publish the dev build? [y/n] " yn
38
+ echo ""
39
+ case $yn in
40
+ [Yy]* ) break;;
41
+ [Nn]* ) exit;;
42
+ * ) echo "Please answer y or n.";;
43
+ esac
44
+ done
45
+ git push origin ${dev_branch}
46
+ npm publish --tag dev-v4
47
+
48
+ git checkout $current_branch
49
+
50
+ git checkout -b ${canal_branch}
51
+ git apply ./scripts/canal-release.patch
52
+ ./scripts/update-version $1-canal.${date}00
53
+ git add --all
54
+ git commit -m "update version"
55
+ git push origin ${canal_branch}
56
+ while true; do
57
+ read -n1 -p "Do you wish to push and publish the canal build? [y/n] " yn
58
+ echo ""
59
+ case $yn in
60
+ [Yy]* ) break;;
61
+ [Nn]* ) exit;;
62
+ * ) echo "Please answer y or n.";;
63
+ esac
64
+ done
65
+ npm publish --tag canal-v4
@@ -21,8 +21,15 @@
21
21
 
22
22
  set -e
23
23
 
24
+ if [ $# -eq 0 ]; then
25
+ echo "no version in argument"
26
+ exit 1
27
+ fi
28
+
24
29
  version=$1
30
+ date_iso=$(date "+%Y-%m-%d")
25
31
 
32
+ sed -i.bak -e "s/^\#\# Unreleased/\#\# v${version} \(${date_iso}\)/gi" CHANGELOG.md && rm CHANGELOG.md.bak
26
33
  sed -i.bak -e "s/\/\\* PLAYER_VERSION \\*\/\"\(.*\)\";/\/* PLAYER_VERSION *\/\"${version}\";/g" src/core/api/public_api.ts && rm src/core/api/public_api.ts.bak
27
34
  sed -i.bak -e "s/\"version\":\s*\"[0-9]\+\.[0-9]\+\.[0-9]\+[^\"]*\"/\"version\": \"${version}\"/g" package.json && rm package.json.bak
28
35
  sed -i.bak -e "s/sonar\.projectVersion= *.*/sonar.projectVersion=${version}/g" sonar-project.properties && rm sonar-project.properties.bak
@@ -1,7 +1,7 @@
1
1
  sonar.projectKey=rx-player
2
2
  sonar.organization=rx-player
3
3
  sonar.projectName=rx-player
4
- sonar.projectVersion=4.0.0-dev.2023111400
4
+ sonar.projectVersion=4.0.0-dev.2023121900
5
5
  sonar.sources=./src,./demo,./tests
6
6
  sonar.exclusions=demo/full/bundle.js,demo/standalone/lib.js,demo/bundle.js
7
7
  sonar.host.url=https://sonarcloud.io
@@ -16,6 +16,17 @@
16
16
 
17
17
  import { MediaSource_ } from "./browser_compatibility_types";
18
18
 
19
+ /**
20
+ * Setting this value limit the number of entries in the support map
21
+ * preventing important memory usage, value is arbitrary
22
+ */
23
+ const MAX_SUPPORT_MAP_ENTRIES = 200;
24
+
25
+ /**
26
+ * caching the codec support reduce the amount of call to `isTypeSupported`
27
+ * and help for performance especially on low-end devices.
28
+ */
29
+ const supportMap: Map<string, boolean> = new Map();
19
30
  /**
20
31
  * Returns true if the given codec is supported by the browser's MediaSource
21
32
  * implementation.
@@ -33,7 +44,18 @@ export default function isCodecSupported(mimeType : string) : boolean {
33
44
  /* eslint-disable @typescript-eslint/unbound-method */
34
45
  if (typeof MediaSource_.isTypeSupported === "function") {
35
46
  /* eslint-enable @typescript-eslint/unbound-method */
36
- return MediaSource_.isTypeSupported(mimeType);
47
+ const cachedSupport = supportMap.get(mimeType);
48
+ if (cachedSupport !== undefined) {
49
+ return cachedSupport;
50
+ } else {
51
+ const isSupported = MediaSource_.isTypeSupported(mimeType);
52
+ if (supportMap.size >= MAX_SUPPORT_MAP_ENTRIES) {
53
+ supportMap.clear();
54
+ }
55
+ supportMap.set(mimeType, isSupported);
56
+ return isSupported;
57
+ }
58
+
37
59
  }
38
60
 
39
61
  return true;
@@ -30,7 +30,7 @@ import SharedReference, {
30
30
  import TaskCanceller, {
31
31
  CancellationSignal,
32
32
  } from "../../utils/task_canceller";
33
- import { IReadOnlyPlaybackObserver } from "../api";
33
+ import { IObservationPosition, IReadOnlyPlaybackObserver } from "../api";
34
34
  import { IBufferType } from "../segment_buffers";
35
35
  import BufferBasedChooser from "./buffer_based_chooser";
36
36
  import GuessBasedChooser from "./guess_based_chooser";
@@ -272,7 +272,7 @@ function getEstimateReference(
272
272
  }
273
273
  const { position, speed } = lastPlaybackObservation;
274
274
  const timeRanges = val.buffered;
275
- const bufferGap = getLeftSizeOfBufferedTimeRange(timeRanges, position.last);
275
+ const bufferGap = getLeftSizeOfBufferedTimeRange(timeRanges, position.getWanted());
276
276
  const { representation } = val.content;
277
277
  const currentScore = scoreCalculator.getEstimate(representation);
278
278
  const currentBitrate = representation.bitrate;
@@ -389,7 +389,7 @@ function getEstimateReference(
389
389
  if (lowLatencyMode &&
390
390
  currentRepresentationVal !== null &&
391
391
  context.manifest.isDynamic &&
392
- maximumPosition - position.last < 40)
392
+ maximumPosition - position.getWanted() < 40)
393
393
  {
394
394
  chosenRepFromGuessMode = guessBasedChooser
395
395
  .getGuess(sortedRepresentations,
@@ -595,24 +595,7 @@ export interface IRepresentationEstimatorPlaybackObservation {
595
595
  * Information on the current media position in seconds at the time of a
596
596
  * Playback Observation.
597
597
  */
598
- position : {
599
- /**
600
- * Known position at the time the Observation was emitted, in seconds.
601
- *
602
- * Note that it might have changed since. If you want truly precize
603
- * information, you should recuperate it from the HTMLMediaElement directly
604
- * through another mean.
605
- */
606
- last : number;
607
- /**
608
- * Actually wanted position in seconds that is not yet reached.
609
- *
610
- * This might for example be set to the initial position when the content is
611
- * loading (and thus potentially at a `0` position) but which will be seeked
612
- * to a given position once possible.
613
- */
614
- pending : number | undefined;
615
- };
598
+ position : IObservationPosition;
616
599
  /**
617
600
  * Last "playback rate" set by the user. This is the ideal "playback rate" at
618
601
  * which the media should play.
@@ -154,7 +154,7 @@ function estimateStarvationModeBitrate(
154
154
  const { bufferGap, speed, position } = playbackInfo;
155
155
  const realBufferGap = isFinite(bufferGap) ? bufferGap :
156
156
  0;
157
- const nextNeededPosition = position.last + realBufferGap;
157
+ const nextNeededPosition = position.getWanted() + realBufferGap;
158
158
  const concernedRequests = getConcernedRequests(pendingRequests, nextNeededPosition);
159
159
 
160
160
  if (concernedRequests.length !== 1) { // 0 == no request
@@ -238,7 +238,7 @@ function shouldDirectlySwitchToLowBitrate(
238
238
  }
239
239
  const realBufferGap = isFinite(playbackInfo.bufferGap) ? playbackInfo.bufferGap :
240
240
  0;
241
- const nextNeededPosition = playbackInfo.position.last + realBufferGap;
241
+ const nextNeededPosition = playbackInfo.position.getWanted() + realBufferGap;
242
242
  const nextRequest = arrayFind(requests, ({ content }) =>
243
243
  content.segment.duration > 0 &&
244
244
  (content.segment.time + content.segment.duration) > nextNeededPosition);
@@ -334,7 +334,7 @@ export default class NetworkAnalyzer {
334
334
  const { ABR_STARVATION_DURATION_DELTA } = config.getCurrent();
335
335
  // check if should get in/out of starvation mode
336
336
  if (isNaN(duration) ||
337
- realBufferGap + position.last < duration - ABR_STARVATION_DURATION_DELTA)
337
+ realBufferGap + position.getWanted() < duration - ABR_STARVATION_DURATION_DELTA)
338
338
  {
339
339
  if (!this._inStarvationMode && realBufferGap <= localConf.starvationGap) {
340
340
  log.info("ABR: enter starvation mode.");
@@ -1,7 +1,7 @@
1
1
  import { Representation } from "../../../manifest";
2
2
  import { IBufferedChunk } from "../../segment_buffers";
3
3
 
4
- const BUFFER_WIDTH_IN_SECONDS = 10000;
4
+ const BUFFER_WIDTH_IN_SECONDS = 30 * 60;
5
5
 
6
6
  const COLORS = [
7
7
  "#2ab7ca",
@@ -95,10 +95,7 @@ export default class SegmentBufferGraph {
95
95
  let minimumPosition;
96
96
  let maximumPosition;
97
97
  if (maximumPoint - minimumPoint > BUFFER_WIDTH_IN_SECONDS) {
98
- if (currentTime === undefined) {
99
- minimumPosition = minimumPoint;
100
- maximumPosition = maximumPoint;
101
- } else if (maximumPoint - currentTime < BUFFER_WIDTH_IN_SECONDS / 2) {
98
+ if (maximumPoint - currentTime < BUFFER_WIDTH_IN_SECONDS / 2) {
102
99
  maximumPosition = maximumPoint;
103
100
  minimumPosition = maximumPoint - BUFFER_WIDTH_IN_SECONDS;
104
101
  } else if (currentTime - minimumPoint < BUFFER_WIDTH_IN_SECONDS / 2) {
@@ -157,23 +157,28 @@ export default function constructDebugGeneralInfo(
157
157
  ]);
158
158
  adaptationsElt.appendChild(textAdaps);
159
159
  }
160
- const videoBitrates = instance.getVideoTrack()?.representations.map(r => {
161
- return r.bitrate;
162
- }).filter(bitrate => bitrate !== undefined) ?? [];
163
- const audioBitrates = instance.getAudioTrack()?.representations.map(r => {
164
- return r.bitrate;
165
- }).filter(bitrate => bitrate !== undefined) ?? [];
160
+ const adaptations = instance.__priv_getCurrentAdaptation();
161
+ const videoBitratesStr = adaptations?.video?.representations.map((r) => {
162
+ return String(r.bitrate ?? "N/A") +
163
+ (r.isSupported ? "" : " U!") +
164
+ (r.decipherable !== false ? "" : " E!");
165
+ }) ?? [];
166
+ const audioBitratesStr = adaptations?.video?.representations.map((r) => {
167
+ return String(r.bitrate ?? "N/A") +
168
+ (r.isSupported ? "" : " U!") +
169
+ (r.decipherable !== false ? "" : " E!");
170
+ }) ?? [];
166
171
  representationsElt.innerHTML = "";
167
- if (videoBitrates.length > 0) {
172
+ if (videoBitratesStr.length > 0) {
168
173
  representationsElt.appendChild(createMetricTitle("vb"));
169
174
  representationsElt.appendChild(createElement("span", {
170
- textContent: videoBitrates.join(" ") + " ",
175
+ textContent: videoBitratesStr.join(" ") + " ",
171
176
  }));
172
177
  }
173
- if (audioBitrates.length > 0) {
178
+ if (audioBitratesStr.length > 0) {
174
179
  representationsElt.appendChild(createMetricTitle("ab"));
175
180
  representationsElt.appendChild(createElement("span", {
176
- textContent: audioBitrates.join(" ") + " ",
181
+ textContent: audioBitratesStr.join(" ") + " ",
177
182
  }));
178
183
  }
179
184
  } else {
@@ -18,6 +18,7 @@ import PlaybackObserver from "./playback_observer";
18
18
  import Player from "./public_api";
19
19
  export { PlaybackObserver };
20
20
  export {
21
+ IObservationPosition,
21
22
  IPlaybackObservation,
22
23
  IPlaybackObserverEventType,
23
24
  IReadOnlyPlaybackObserver,
@@ -42,6 +42,7 @@ export type IParsedStartAtOption = { position : number } |
42
42
  { wallClockTime : number } |
43
43
  { percentage : number } |
44
44
  { fromLastPosition : number } |
45
+ { fromLivePosition : number } |
45
46
  { fromFirstPosition : number };
46
47
 
47
48
  /** Options of the RxPlayer's constructor once parsed. */
@@ -383,9 +384,8 @@ function parseLoadVideoOptions(
383
384
  }
384
385
 
385
386
  if (!isNullOrUndefined(options.startAt)) {
386
- // TODO Better way to express that in TypeScript?
387
- if ((options.startAt as { wallClockTime? : Date|number }).wallClockTime
388
- instanceof Date
387
+ if ("wallClockTime" in options.startAt
388
+ && options.startAt.wallClockTime instanceof Date
389
389
  ) {
390
390
  const wallClockTime = (options.startAt as { wallClockTime : Date })
391
391
  .wallClockTime.getTime() / 1000;