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
@@ -50,6 +50,7 @@ export declare const enum PLAYER_STATES {
50
50
  ENDED = "ENDED",
51
51
  BUFFERING = "BUFFERING",
52
52
  SEEKING = "SEEKING",
53
+ FREEZING = "FREEZING",
53
54
  RELOADING = "RELOADING"
54
55
  }
55
56
  export declare function constructPlayerStateReference(initializer: ContentInitializer, mediaElement: HTMLMediaElement, playbackObserver: IReadOnlyPlaybackObserver<IPlaybackObservation>, cancelSignal: CancellationSignal): IReadOnlySharedReference<IPlayerState>;
@@ -16,6 +16,7 @@
16
16
  import config from "../../config";
17
17
  import arrayIncludes from "../../utils/array_includes";
18
18
  import SharedReference from "../../utils/reference";
19
+ var arr = ["seeking", "ended", "play", "pause"];
19
20
  /**
20
21
  * @param {HTMLMediaElement} mediaElement
21
22
  * @param {Object} playbackObserver - Observes playback conditions on
@@ -82,7 +83,7 @@ export function constructPlayerStateReference(initializer, mediaElement, playbac
82
83
  }
83
84
  }
84
85
  else {
85
- playerStateRef.setValueIfChanged(getLoadedContentState(mediaElement, null));
86
+ updateStateIfLoaded(null);
86
87
  }
87
88
  }, cancelSignal);
88
89
  initializer.addEventListener("reloadingMediaSource", function () {
@@ -97,27 +98,42 @@ export function constructPlayerStateReference(initializer, mediaElement, playbac
97
98
  var prevStallReason = null;
98
99
  initializer.addEventListener("stalled", function (s) {
99
100
  if (s !== prevStallReason) {
100
- if (isLoadedState(playerStateRef.getValue())) {
101
- playerStateRef.setValueIfChanged(getLoadedContentState(mediaElement, s));
102
- }
101
+ updateStateIfLoaded(s);
103
102
  prevStallReason = s;
104
103
  }
105
104
  }, cancelSignal);
106
105
  initializer.addEventListener("unstalled", function () {
107
106
  if (prevStallReason !== null) {
108
- if (isLoadedState(playerStateRef.getValue())) {
109
- playerStateRef.setValueIfChanged(getLoadedContentState(mediaElement, null));
110
- }
107
+ updateStateIfLoaded(null);
111
108
  prevStallReason = null;
112
109
  }
113
110
  }, cancelSignal);
114
111
  playbackObserver.listen(function (observation) {
115
- if (isLoadedState(playerStateRef.getValue()) &&
116
- arrayIncludes(["seeking", "ended", "play", "pause"], observation.event)) {
117
- playerStateRef.setValueIfChanged(getLoadedContentState(mediaElement, prevStallReason));
112
+ var initialState = playerStateRef.getValue();
113
+ if (isLoadedState(initialState) &&
114
+ arrayIncludes(arr, observation.event)) {
115
+ var newState = getLoadedContentState(mediaElement, prevStallReason);
116
+ window.sendLog("STATE cHAG: " + newState + " " + initialState);
117
+ // Some safety checks to avoid having nonsense state switches
118
+ if (newState === "PAUSED" /* PLAYER_STATES.PAUSED */ && initialState === "LOADED" /* PLAYER_STATES.LOADED */) {
119
+ return;
120
+ }
121
+ playerStateRef.setValueIfChanged(newState);
118
122
  }
119
123
  }, { clearSignal: cancelSignal });
120
124
  return playerStateRef;
125
+ function updateStateIfLoaded(stallRes) {
126
+ var initialState = playerStateRef.getValue();
127
+ if (!isLoadedState(initialState)) {
128
+ return;
129
+ }
130
+ var newState = getLoadedContentState(mediaElement, stallRes);
131
+ // Some safety checks to avoid having nonsense state switches
132
+ if (initialState === "LOADED" /* PLAYER_STATES.LOADED */ && newState === "PAUSED" /* PLAYER_STATES.PAUSED */) {
133
+ return;
134
+ }
135
+ playerStateRef.setValueIfChanged(newState);
136
+ }
121
137
  }
122
138
  /**
123
139
  * Get state string for a _loaded_ content.
@@ -144,7 +160,8 @@ export function getLoadedContentState(mediaElement, stalledStatus) {
144
160
  return "ENDED" /* PLAYER_STATES.ENDED */;
145
161
  }
146
162
  return stalledStatus === "seeking" ? "SEEKING" /* PLAYER_STATES.SEEKING */ :
147
- "BUFFERING" /* PLAYER_STATES.BUFFERING */;
163
+ stalledStatus === "freezing" ? "FREEZING" /* PLAYER_STATES.FREEZING */ :
164
+ "BUFFERING" /* PLAYER_STATES.BUFFERING */;
148
165
  }
149
166
  return mediaElement.paused ? "PAUSED" /* PLAYER_STATES.PAUSED */ :
150
167
  "PLAYING" /* PLAYER_STATES.PLAYING */;
@@ -166,8 +166,8 @@ var ContentDecryptor = /** @class */ (function (_super) {
166
166
  * MediaKeySessions persisted in older RxPlayer's versions.
167
167
  */
168
168
  var systemId;
169
- if (isNullOrUndefined(options.licenseStorage) ||
170
- options.licenseStorage.disableRetroCompatibility === true) {
169
+ if (isNullOrUndefined(options.persistentLicenseConfig) ||
170
+ options.persistentLicenseConfig.disableRetroCompatibility === true) {
171
171
  systemId = getDrmSystemId(mediaKeySystemAccess.keySystem);
172
172
  }
173
173
  _this.systemId = systemId;
@@ -405,7 +405,7 @@ var ContentDecryptor = /** @class */ (function (_super) {
405
405
  // persistent sessions.
406
406
  // Can we find a better strategy?
407
407
  this._lockInitDataQueue();
408
- if (options.persistentLicense !== true) {
408
+ if (isNullOrUndefined(options.persistentLicenseConfig)) {
409
409
  wantedSessionType = "temporary";
410
410
  }
411
411
  else if (!canCreatePersistentSession(mediaKeySystemAccess)) {
@@ -85,11 +85,12 @@ function checkCachedMediaKeySystemAccess(keySystems, currentKeySystemAccess, cur
85
85
  if (ks.type !== currentKeySystemOptions.type) {
86
86
  return false;
87
87
  }
88
- if ((ks.persistentLicense === true || ks.persistentStateRequired === true) &&
88
+ if ((!isNullOrUndefined(ks.persistentLicenseConfig) ||
89
+ ks.persistentState === "required") &&
89
90
  mksConfiguration.persistentState !== "required") {
90
91
  return false;
91
92
  }
92
- if (ks.distinctiveIdentifierRequired === true &&
93
+ if (ks.distinctiveIdentifier === "required" &&
93
94
  mksConfiguration.distinctiveIdentifier !== "required") {
94
95
  return false;
95
96
  }
@@ -119,67 +120,26 @@ function findKeySystemCanonicalName(ksType) {
119
120
  /**
120
121
  * Build configuration for the requestMediaKeySystemAccess EME API, based
121
122
  * on the current keySystem object.
122
- * @param {string|undefined} ksName - Generic name for the key system. e.g.
123
- * "clearkey", "widevine", "playready". Can be used to make exceptions depending
124
- * on it.
125
- * @param {string|undefined} ksType - KeySystem complete type (e.g.
126
- * "com.widevine.alpha").
127
- * @param {Object} keySystem
123
+ * @param {Object} keySystemTypeInfo
128
124
  * @returns {Array.<Object>} - Configuration to give to the
129
125
  * requestMediaKeySystemAccess API.
130
126
  */
131
- function buildKeySystemConfigurations(ksName, ksType, keySystem) {
127
+ function buildKeySystemConfigurations(keySystemTypeInfo) {
128
+ var keyName = keySystemTypeInfo.keyName, keyType = keySystemTypeInfo.keyType, keySystem = keySystemTypeInfo.keySystemOptions;
132
129
  var sessionTypes = ["temporary"];
133
130
  var persistentState = "optional";
134
131
  var distinctiveIdentifier = "optional";
135
- if (keySystem.persistentLicense === true) {
132
+ if (!isNullOrUndefined(keySystem.persistentLicenseConfig)) {
136
133
  persistentState = "required";
137
134
  sessionTypes.push("persistent-license");
138
135
  }
139
- if (keySystem.persistentStateRequired === true) {
140
- persistentState = "required";
141
- }
142
- if (keySystem.distinctiveIdentifierRequired === true) {
143
- distinctiveIdentifier = "required";
144
- }
145
- var _a = config.getCurrent(), EME_DEFAULT_AUDIO_CODECS = _a.EME_DEFAULT_AUDIO_CODECS, EME_DEFAULT_VIDEO_CODECS = _a.EME_DEFAULT_VIDEO_CODECS, EME_DEFAULT_WIDEVINE_ROBUSTNESSES = _a.EME_DEFAULT_WIDEVINE_ROBUSTNESSES, EME_DEFAULT_PLAYREADY_ROBUSTNESSES = _a.EME_DEFAULT_PLAYREADY_ROBUSTNESSES;
146
- // Set robustness, in order of consideration:
147
- // 1. the user specified its own robustnesses
148
- // 2. a "widevine" key system is used, in that case set the default widevine
149
- // robustnesses as defined in the config
150
- // 3. set an undefined robustness
151
- var videoRobustnesses;
152
- if (!isNullOrUndefined(keySystem.videoRobustnesses)) {
153
- videoRobustnesses = keySystem.videoRobustnesses;
154
- }
155
- else if (ksName === "widevine") {
156
- videoRobustnesses = EME_DEFAULT_WIDEVINE_ROBUSTNESSES;
157
- }
158
- else if (ksType === "com.microsoft.playready.recommendation") {
159
- videoRobustnesses = EME_DEFAULT_PLAYREADY_ROBUSTNESSES;
160
- }
161
- else {
162
- videoRobustnesses = [];
163
- }
164
- var audioRobustnesses;
165
- if (!isNullOrUndefined(keySystem.audioRobustnesses)) {
166
- audioRobustnesses = keySystem.audioRobustnesses;
167
- }
168
- else if (ksName === "widevine") {
169
- audioRobustnesses = EME_DEFAULT_WIDEVINE_ROBUSTNESSES;
136
+ if (!isNullOrUndefined(keySystem.persistentState)) {
137
+ persistentState = keySystem.persistentState;
170
138
  }
171
- else if (ksType === "com.microsoft.playready.recommendation") {
172
- audioRobustnesses = EME_DEFAULT_PLAYREADY_ROBUSTNESSES;
173
- }
174
- else {
175
- audioRobustnesses = [];
176
- }
177
- if (videoRobustnesses.length === 0) {
178
- videoRobustnesses.push(undefined);
179
- }
180
- if (audioRobustnesses.length === 0) {
181
- audioRobustnesses.push(undefined);
139
+ if (!isNullOrUndefined(keySystem.distinctiveIdentifier)) {
140
+ distinctiveIdentifier = keySystem.distinctiveIdentifier;
182
141
  }
142
+ var _a = config.getCurrent(), EME_DEFAULT_AUDIO_CODECS = _a.EME_DEFAULT_AUDIO_CODECS, EME_DEFAULT_VIDEO_CODECS = _a.EME_DEFAULT_VIDEO_CODECS, EME_DEFAULT_WIDEVINE_ROBUSTNESSES = _a.EME_DEFAULT_WIDEVINE_ROBUSTNESSES, EME_DEFAULT_PLAYREADY_RECOMMENDATION_ROBUSTNESSES = _a.EME_DEFAULT_PLAYREADY_RECOMMENDATION_ROBUSTNESSES;
183
143
  // From the W3 EME spec, we have to provide videoCapabilities and
184
144
  // audioCapabilities.
185
145
  // These capabilities must specify a codec (even though you can use a
@@ -191,18 +151,69 @@ function buildKeySystemConfigurations(ksName, ksType, keySystem) {
191
151
  // More details here:
192
152
  // https://storage.googleapis.com/wvdocs/Chrome_EME_Changes_and_Best_Practices.pdf
193
153
  // https://www.w3.org/TR/encrypted-media/#get-supported-configuration-and-consent
194
- var videoCapabilities = flatMap(videoRobustnesses, function (robustness) {
195
- return EME_DEFAULT_VIDEO_CODECS.map(function (contentType) {
196
- return robustness === undefined ? { contentType: contentType } :
197
- { contentType: contentType, robustness: robustness };
154
+ var audioCapabilities;
155
+ var videoCapabilities;
156
+ var audioCapabilitiesConfig = keySystem.audioCapabilitiesConfig, videoCapabilitiesConfig = keySystem.videoCapabilitiesConfig;
157
+ if ((audioCapabilitiesConfig === null || audioCapabilitiesConfig === void 0 ? void 0 : audioCapabilitiesConfig.type) === "full") {
158
+ audioCapabilities = audioCapabilitiesConfig.value;
159
+ }
160
+ else {
161
+ var audioRobustnesses = void 0;
162
+ if ((audioCapabilitiesConfig === null || audioCapabilitiesConfig === void 0 ? void 0 : audioCapabilitiesConfig.type) === "robustness") {
163
+ audioRobustnesses = audioCapabilitiesConfig.value;
164
+ }
165
+ else if (keyName === "widevine") {
166
+ audioRobustnesses = EME_DEFAULT_WIDEVINE_ROBUSTNESSES;
167
+ }
168
+ else if (keyType === "com.microsoft.playready.recommendation") {
169
+ audioRobustnesses = EME_DEFAULT_PLAYREADY_RECOMMENDATION_ROBUSTNESSES;
170
+ }
171
+ else {
172
+ audioRobustnesses = [];
173
+ }
174
+ if (audioRobustnesses.length === 0) {
175
+ audioRobustnesses.push(undefined);
176
+ }
177
+ var audioCodecs_1 = (audioCapabilitiesConfig === null || audioCapabilitiesConfig === void 0 ? void 0 : audioCapabilitiesConfig.type) === "contentType" ?
178
+ audioCapabilitiesConfig.value :
179
+ EME_DEFAULT_AUDIO_CODECS;
180
+ audioCapabilities = flatMap(audioRobustnesses, function (robustness) {
181
+ return audioCodecs_1.map(function (contentType) {
182
+ return robustness !== undefined ? { contentType: contentType, robustness: robustness } :
183
+ { contentType: contentType };
184
+ });
198
185
  });
199
- });
200
- var audioCapabilities = flatMap(audioRobustnesses, function (robustness) {
201
- return EME_DEFAULT_AUDIO_CODECS.map(function (contentType) {
202
- return robustness === undefined ? { contentType: contentType } :
203
- { contentType: contentType, robustness: robustness };
186
+ }
187
+ if ((videoCapabilitiesConfig === null || videoCapabilitiesConfig === void 0 ? void 0 : videoCapabilitiesConfig.type) === "full") {
188
+ videoCapabilities = videoCapabilitiesConfig.value;
189
+ }
190
+ else {
191
+ var videoRobustnesses = void 0;
192
+ if ((videoCapabilitiesConfig === null || videoCapabilitiesConfig === void 0 ? void 0 : videoCapabilitiesConfig.type) === "robustness") {
193
+ videoRobustnesses = videoCapabilitiesConfig.value;
194
+ }
195
+ else if (keyName === "widevine") {
196
+ videoRobustnesses = EME_DEFAULT_WIDEVINE_ROBUSTNESSES;
197
+ }
198
+ else if (keyType === "com.microsoft.playready.recommendation") {
199
+ videoRobustnesses = EME_DEFAULT_PLAYREADY_RECOMMENDATION_ROBUSTNESSES;
200
+ }
201
+ else {
202
+ videoRobustnesses = [];
203
+ }
204
+ if (videoRobustnesses.length === 0) {
205
+ videoRobustnesses.push(undefined);
206
+ }
207
+ var videoCodecs_1 = (videoCapabilitiesConfig === null || videoCapabilitiesConfig === void 0 ? void 0 : videoCapabilitiesConfig.type) === "contentType" ?
208
+ videoCapabilitiesConfig.value :
209
+ EME_DEFAULT_VIDEO_CODECS;
210
+ videoCapabilities = flatMap(videoRobustnesses, function (robustness) {
211
+ return videoCodecs_1.map(function (contentType) {
212
+ return robustness !== undefined ? { contentType: contentType, robustness: robustness } :
213
+ { contentType: contentType };
214
+ });
204
215
  });
205
- });
216
+ }
206
217
  var wantedMediaKeySystemConfiguration = {
207
218
  initDataTypes: ["cenc"],
208
219
  videoCapabilities: videoCapabilities,
@@ -291,9 +302,9 @@ export default function getMediaKeySystemAccess(mediaElement, keySystemsConfigs,
291
302
  */
292
303
  function recursivelyTestKeySystems(index) {
293
304
  return __awaiter(this, void 0, void 0, function () {
294
- var _a, keyName, keyType, keySystemOptions, keySystemConfigurations, keySystemAccess, _1;
295
- return __generator(this, function (_b) {
296
- switch (_b.label) {
305
+ var chosenType, keyType, keySystemOptions, keySystemConfigurations, keySystemAccess, _1;
306
+ return __generator(this, function (_a) {
307
+ switch (_a.label) {
297
308
  case 0:
298
309
  // if we iterated over the whole keySystemsType Array, quit on error
299
310
  if (index >= keySystemsType.length) {
@@ -304,22 +315,23 @@ export default function getMediaKeySystemAccess(mediaElement, keySystemsConfigs,
304
315
  if (eme.requestMediaKeySystemAccess == null) {
305
316
  throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");
306
317
  }
307
- _a = keySystemsType[index], keyName = _a.keyName, keyType = _a.keyType, keySystemOptions = _a.keySystemOptions;
308
- keySystemConfigurations = buildKeySystemConfigurations(keyName, keyType, keySystemOptions);
318
+ chosenType = keySystemsType[index];
319
+ keyType = chosenType.keyType, keySystemOptions = chosenType.keySystemOptions;
320
+ keySystemConfigurations = buildKeySystemConfigurations(chosenType);
309
321
  log.debug("DRM: Request keysystem access ".concat(keyType, ",") +
310
322
  "".concat(index + 1, " of ").concat(keySystemsType.length));
311
- _b.label = 1;
323
+ _a.label = 1;
312
324
  case 1:
313
- _b.trys.push([1, 3, , 4]);
325
+ _a.trys.push([1, 3, , 4]);
314
326
  return [4 /*yield*/, eme.requestMediaKeySystemAccess(keyType, keySystemConfigurations)];
315
327
  case 2:
316
- keySystemAccess = _b.sent();
328
+ keySystemAccess = _a.sent();
317
329
  log.info("DRM: Found compatible keysystem", keyType, index + 1);
318
330
  return [2 /*return*/, { type: "create-media-key-system-access",
319
331
  value: { options: keySystemOptions,
320
332
  mediaKeySystemAccess: keySystemAccess } }];
321
333
  case 3:
322
- _1 = _b.sent();
334
+ _1 = _a.sent();
323
335
  log.debug("DRM: Rejected access to keysystem", keyType, index + 1);
324
336
  if (cancelSignal.cancellationError !== null) {
325
337
  throw cancelSignal.cancellationError;
@@ -64,15 +64,16 @@ import ServerCertificateStore from "./utils/server_certificate_store";
64
64
  * @returns {Object|null}
65
65
  */
66
66
  function createPersistentSessionsStorage(keySystemOptions) {
67
- if (keySystemOptions.persistentLicense !== true) {
67
+ if (isNullOrUndefined(keySystemOptions.persistentLicenseConfig)) {
68
68
  return null;
69
69
  }
70
- var licenseStorage = keySystemOptions.licenseStorage;
71
- if (licenseStorage == null) {
72
- throw new EncryptedMediaError("INVALID_KEY_SYSTEM", "No license storage found for persistent license.");
70
+ var persistentLicenseConfig = keySystemOptions.persistentLicenseConfig;
71
+ if (persistentLicenseConfig == null) {
72
+ throw new EncryptedMediaError("INVALID_KEY_SYSTEM", "No `persistentLicenseConfig` found for " +
73
+ "persistent license.");
73
74
  }
74
75
  log.debug("DRM: Set the given license storage");
75
- return new PersistentSessionsStore(licenseStorage);
76
+ return new PersistentSessionsStore(persistentLicenseConfig);
76
77
  }
77
78
  /**
78
79
  * Create a MediaKeys instance and associated structures (or just return the
@@ -103,15 +103,18 @@ export default function SessionEventsListener(session, keySystemOptions, keySyst
103
103
  manualCanceller.cancel();
104
104
  callbacks.onError(new EncryptedMediaError("KEY_ERROR", evt.type));
105
105
  }, manualCanceller.signal);
106
- onKeyStatusesChange(session, function (keyStatusesEvent) {
107
- handleKeyStatusesChangeEvent(keyStatusesEvent).catch(function (error) {
106
+ onKeyStatusesChange(session, function () {
107
+ try {
108
+ checkAndHandleCurrentKeyStatuses();
109
+ }
110
+ catch (error) {
108
111
  if (cancelSignal.isCancelled() ||
109
112
  (manualCanceller.isUsed() && error instanceof CancellationSignal)) {
110
113
  return;
111
114
  }
112
115
  manualCanceller.cancel();
113
116
  callbacks.onError(error);
114
- });
117
+ }
115
118
  }, manualCanceller.signal);
116
119
  onKeyMessage(session, function (evt) {
117
120
  var messageEvent = evt;
@@ -159,72 +162,6 @@ export default function SessionEventsListener(session, keySystemOptions, keySyst
159
162
  }, manualCanceller.signal);
160
163
  checkAndHandleCurrentKeyStatuses();
161
164
  return;
162
- /**
163
- * @param {Event} keyStatusesEvent
164
- * @returns {Promise}
165
- */
166
- function handleKeyStatusesChangeEvent(keyStatusesEvent) {
167
- return __awaiter(this, void 0, void 0, function () {
168
- function runOnKeyStatusesChangeCallback() {
169
- return __awaiter(this, void 0, void 0, function () {
170
- var ret, error_1, err;
171
- return __generator(this, function (_a) {
172
- switch (_a.label) {
173
- case 0:
174
- if (manualCanceller.isUsed()) {
175
- return [2 /*return*/];
176
- }
177
- if (!(typeof keySystemOptions.onKeyStatusesChange === "function")) return [3 /*break*/, 7];
178
- ret = void 0;
179
- _a.label = 1;
180
- case 1:
181
- _a.trys.push([1, 3, , 4]);
182
- return [4 /*yield*/, keySystemOptions.onKeyStatusesChange(keyStatusesEvent, session)];
183
- case 2:
184
- ret = _a.sent();
185
- if (manualCanceller.isUsed()) {
186
- return [2 /*return*/];
187
- }
188
- return [3 /*break*/, 4];
189
- case 3:
190
- error_1 = _a.sent();
191
- if (cancelSignal.isCancelled()) {
192
- return [2 /*return*/];
193
- }
194
- err = new EncryptedMediaError("KEY_STATUS_CHANGE_ERROR", "Unknown `onKeyStatusesChange` error");
195
- if (!isNullOrUndefined(error_1) &&
196
- isNonEmptyString(error_1.message)) {
197
- err.message = error_1.message;
198
- }
199
- throw err;
200
- case 4:
201
- if (!isNullOrUndefined(ret)) return [3 /*break*/, 5];
202
- log.info("DRM: No license given, skipping session.update");
203
- return [3 /*break*/, 7];
204
- case 5: return [4 /*yield*/, updateSessionWithMessage(session, ret)];
205
- case 6:
206
- _a.sent();
207
- _a.label = 7;
208
- case 7: return [2 /*return*/];
209
- }
210
- });
211
- });
212
- }
213
- return __generator(this, function (_a) {
214
- switch (_a.label) {
215
- case 0:
216
- log.info("DRM: keystatuseschange event received", session.sessionId);
217
- return [4 /*yield*/, Promise.all([
218
- runOnKeyStatusesChangeCallback(),
219
- Promise.resolve(checkAndHandleCurrentKeyStatuses()),
220
- ])];
221
- case 1:
222
- _a.sent();
223
- return [2 /*return*/];
224
- }
225
- });
226
- });
227
- }
228
165
  /**
229
166
  * Check current MediaKeyStatus for each key in the given MediaKeySession and:
230
167
  * - throw if at least one status is a non-recoverable error
@@ -232,6 +169,7 @@ export default function SessionEventsListener(session, keySystemOptions, keySyst
232
169
  * - call onKeyUpdate callback when the MediaKeyStatus of any key is updated
233
170
  */
234
171
  function checkAndHandleCurrentKeyStatuses() {
172
+ log.info("DRM: keystatuseschange event received", session.sessionId);
235
173
  if (manualCanceller.isUsed() || session.keyStatuses.size === 0) {
236
174
  return;
237
175
  }
@@ -326,7 +264,7 @@ function formatGetLicenseError(error) {
326
264
  */
327
265
  function updateSessionWithMessage(session, message) {
328
266
  return __awaiter(this, void 0, void 0, function () {
329
- var error_2, reason;
267
+ var error_1, reason;
330
268
  return __generator(this, function (_a) {
331
269
  switch (_a.label) {
332
270
  case 0:
@@ -339,8 +277,8 @@ function updateSessionWithMessage(session, message) {
339
277
  _a.sent();
340
278
  return [3 /*break*/, 4];
341
279
  case 3:
342
- error_2 = _a.sent();
343
- reason = error_2 instanceof Error ? error_2.toString() :
280
+ error_1 = _a.sent();
281
+ reason = error_1 instanceof Error ? error_1.toString() :
344
282
  "`session.update` failed";
345
283
  throw new EncryptedMediaError("KEY_UPDATE_ERROR", reason);
346
284
  case 4:
@@ -14,11 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ICustomMediaKeySession } from "../../../compat/eme";
17
- import { IPersistentSessionInfo, IPersistentSessionStorage } from "../../../public_types";
17
+ import { IPersistentLicenseConfig, IPersistentSessionInfo } from "../../../public_types";
18
18
  import { IProcessedProtectionData } from "../types";
19
19
  /**
20
- * Set representing persisted licenses. Depends on a simple local-
21
- * storage implementation with a `save`/`load` synchronous interface
20
+ * Set representing persisted licenses. Depends on a simple
21
+ * implementation with a `save`/`load` synchronous interface
22
22
  * to persist information on persisted sessions.
23
23
  *
24
24
  * This set is used only for a cdm/keysystem with license persistency
@@ -32,7 +32,7 @@ export default class PersistentSessionsStore {
32
32
  * Create a new PersistentSessionsStore.
33
33
  * @param {Object} storage
34
34
  */
35
- constructor(storage: IPersistentSessionStorage);
35
+ constructor(storage: IPersistentLicenseConfig);
36
36
  /**
37
37
  * Returns the number of stored values.
38
38
  * @returns {number}
@@ -27,11 +27,11 @@ import SerializableBytes from "./serializable_bytes";
27
27
  * @param {Object} storage
28
28
  */
29
29
  function checkStorage(storage) {
30
- assertInterface(storage, { save: "function", load: "function" }, "licenseStorage");
30
+ assertInterface(storage, { save: "function", load: "function" }, "persistentLicenseConfig");
31
31
  }
32
32
  /**
33
- * Set representing persisted licenses. Depends on a simple local-
34
- * storage implementation with a `save`/`load` synchronous interface
33
+ * Set representing persisted licenses. Depends on a simple
34
+ * implementation with a `save`/`load` synchronous interface
35
35
  * to persist information on persisted sessions.
36
36
  *
37
37
  * This set is used only for a cdm/keysystem with license persistency
@@ -299,7 +299,9 @@ var PersistentSessionsStore = /** @class */ (function () {
299
299
  this._storage.save(this._entries);
300
300
  }
301
301
  catch (e) {
302
- log.warn("DRM-PSS: Could not save licenses in localStorage");
302
+ var err = e instanceof Error ? e :
303
+ undefined;
304
+ log.warn("DRM-PSS: Could not save MediaKeySession information", err);
303
305
  }
304
306
  };
305
307
  return PersistentSessionsStore;
@@ -163,9 +163,7 @@ export interface IManifestFetcherSettings {
163
163
  */
164
164
  lowLatencyMode: boolean;
165
165
  /** Maximum number of time a request on error will be retried. */
166
- maxRetryRegular: number | undefined;
167
- /** Maximum number of time a request be retried when the user is offline. */
168
- maxRetryOffline: number | undefined;
166
+ maxRetry: number | undefined;
169
167
  /**
170
168
  * Timeout after which request are aborted and, depending on other options,
171
169
  * retried.
@@ -68,7 +68,6 @@ import config from "../../../config";
68
68
  import { formatError } from "../../../errors";
69
69
  import log from "../../../log";
70
70
  import Manifest from "../../../manifest";
71
- import assert from "../../../utils/assert";
72
71
  import EventEmitter from "../../../utils/event_emitter";
73
72
  import isNullOrUndefined from "../../../utils/is_null_or_undefined";
74
73
  import noop from "../../../utils/noop";
@@ -184,20 +183,6 @@ var ManifestFetcher = /** @class */ (function (_super) {
184
183
  ManifestFetcher.prototype._fetchManifest = function (url) {
185
184
  var _a;
186
185
  return __awaiter(this, void 0, void 0, function () {
187
- /**
188
- * Call the resolver part of the pipeline, retrying if it fails according
189
- * to the current settings.
190
- * Returns the Promise of the last attempt.
191
- * /!\ This pipeline should have a `resolveManifestUrl` function defined.
192
- * @param {string | undefined} resolverUrl
193
- * @returns {Promise}
194
- */
195
- function callResolverWithRetries(resolverUrl) {
196
- var resolveManifestUrl = pipelines.resolveManifestUrl;
197
- assert(resolveManifestUrl !== undefined);
198
- var callResolver = function () { return resolveManifestUrl(resolverUrl, cancelSignal); };
199
- return scheduleRequestPromise(callResolver, backoffSettings, cancelSignal);
200
- }
201
186
  /**
202
187
  * Call the loader part of the pipeline, retrying if it fails according
203
188
  * to the current settings.
@@ -216,7 +201,7 @@ var ManifestFetcher = /** @class */ (function (_super) {
216
201
  var callLoader = function () { return loadManifest(manifestUrl, { timeout: requestTimeout }, cancelSignal); };
217
202
  return scheduleRequestPromise(callLoader, backoffSettings, cancelSignal);
218
203
  }
219
- var cancelSignal, settings, pipelines, requestUrl, backoffSettings, loadingPromise, response_1, err_1;
204
+ var cancelSignal, settings, pipelines, requestUrl, backoffSettings, response_1, err_1;
220
205
  var _this = this;
221
206
  return __generator(this, function (_b) {
222
207
  switch (_b.label) {
@@ -228,13 +213,10 @@ var ManifestFetcher = /** @class */ (function (_super) {
228
213
  backoffSettings = this._getBackoffSetting(function (err) {
229
214
  _this.trigger("warning", errorSelector(err));
230
215
  });
231
- loadingPromise = pipelines.resolveManifestUrl === undefined ?
232
- callLoaderWithRetries(requestUrl) :
233
- callResolverWithRetries(requestUrl).then(callLoaderWithRetries);
234
216
  _b.label = 1;
235
217
  case 1:
236
218
  _b.trys.push([1, 3, , 4]);
237
- return [4 /*yield*/, loadingPromise];
219
+ return [4 /*yield*/, callLoaderWithRetries(requestUrl)];
238
220
  case 2:
239
221
  response_1 = _b.sent();
240
222
  return [2 /*return*/, {
@@ -378,15 +360,14 @@ var ManifestFetcher = /** @class */ (function (_super) {
378
360
  * @returns {Object}
379
361
  */
380
362
  ManifestFetcher.prototype._getBackoffSetting = function (onRetry) {
381
- var _a = config.getCurrent(), DEFAULT_MAX_MANIFEST_REQUEST_RETRY = _a.DEFAULT_MAX_MANIFEST_REQUEST_RETRY, DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE = _a.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE, INITIAL_BACKOFF_DELAY_BASE = _a.INITIAL_BACKOFF_DELAY_BASE, MAX_BACKOFF_DELAY_BASE = _a.MAX_BACKOFF_DELAY_BASE;
382
- var _b = this._settings, lowLatencyMode = _b.lowLatencyMode, ogRegular = _b.maxRetryRegular, ogOffline = _b.maxRetryOffline;
363
+ var _a = config.getCurrent(), DEFAULT_MAX_MANIFEST_REQUEST_RETRY = _a.DEFAULT_MAX_MANIFEST_REQUEST_RETRY, INITIAL_BACKOFF_DELAY_BASE = _a.INITIAL_BACKOFF_DELAY_BASE, MAX_BACKOFF_DELAY_BASE = _a.MAX_BACKOFF_DELAY_BASE;
364
+ var _b = this._settings, lowLatencyMode = _b.lowLatencyMode, ogRegular = _b.maxRetry;
383
365
  var baseDelay = lowLatencyMode ? INITIAL_BACKOFF_DELAY_BASE.LOW_LATENCY :
384
366
  INITIAL_BACKOFF_DELAY_BASE.REGULAR;
385
367
  var maxDelay = lowLatencyMode ? MAX_BACKOFF_DELAY_BASE.LOW_LATENCY :
386
368
  MAX_BACKOFF_DELAY_BASE.REGULAR;
387
- var maxRetryRegular = ogRegular !== null && ogRegular !== void 0 ? ogRegular : DEFAULT_MAX_MANIFEST_REQUEST_RETRY;
388
- var maxRetryOffline = ogOffline !== null && ogOffline !== void 0 ? ogOffline : DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE;
389
- return { onRetry: onRetry, baseDelay: baseDelay, maxDelay: maxDelay, maxRetryRegular: maxRetryRegular, maxRetryOffline: maxRetryOffline };
369
+ var maxRetry = ogRegular !== null && ogRegular !== void 0 ? ogRegular : DEFAULT_MAX_MANIFEST_REQUEST_RETRY;
370
+ return { onRetry: onRetry, baseDelay: baseDelay, maxDelay: maxDelay, maxRetry: maxRetry };
390
371
  };
391
372
  /**
392
373
  * Performs Manifest refresh (recursively) when it judges it is time to do so.
@@ -539,7 +520,7 @@ var ManifestFetcher = /** @class */ (function (_super) {
539
520
  }
540
521
  else {
541
522
  fullRefresh = !enablePartialRefresh || manifestUpdateUrl === undefined;
542
- refreshURL = fullRefresh ? manifest.getUrl() :
523
+ refreshURL = fullRefresh ? manifest.getUrls()[0] :
543
524
  manifestUpdateUrl;
544
525
  }
545
526
  var externalClockOffset = manifest.clockOffset;
@@ -128,12 +128,7 @@ export interface ISegmentFetcherOptions {
128
128
  * Maximum number of retries to perform on "regular" errors (e.g. due to HTTP
129
129
  * status, integrity errors, timeouts...).
130
130
  */
131
- maxRetryRegular: number;
132
- /**
133
- * Maximum number of retries to perform when it appears that the user is
134
- * currently offline.
135
- */
136
- maxRetryOffline: number;
131
+ maxRetry: number;
137
132
  /**
138
133
  * Timeout after which request are aborted and, depending on other options,
139
134
  * retried.
@@ -146,9 +141,8 @@ export interface ISegmentFetcherOptions {
146
141
  * @param {Object}
147
142
  * @returns {Object}
148
143
  */
149
- export declare function getSegmentFetcherOptions(bufferType: string, { maxRetryRegular, maxRetryOffline, lowLatencyMode, requestTimeout }: {
150
- maxRetryRegular?: number | undefined;
151
- maxRetryOffline?: number | undefined;
144
+ export declare function getSegmentFetcherOptions({ maxRetry, lowLatencyMode, requestTimeout }: {
145
+ maxRetry?: number | undefined;
152
146
  requestTimeout?: number | undefined;
153
147
  lowLatencyMode: boolean;
154
148
  }): ISegmentFetcherOptions;