rx-player 4.0.0-alpha.2023012000 → 4.0.0-beta.1

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 (211) hide show
  1. package/.eslintrc.js +8 -0
  2. package/CHANGELOG.md +71 -2
  3. package/VERSION +1 -1
  4. package/dist/_esm5.processed/compat/browser_detection.d.ts +23 -12
  5. package/dist/_esm5.processed/compat/browser_detection.js +80 -38
  6. package/dist/_esm5.processed/compat/can_reuse_media_keys.js +2 -2
  7. package/dist/_esm5.processed/compat/eme/close_session.js +2 -2
  8. package/dist/_esm5.processed/compat/event_listeners.d.ts +24 -4
  9. package/dist/_esm5.processed/compat/event_listeners.js +73 -38
  10. package/dist/_esm5.processed/compat/should_reload_media_source_on_decipherability_update.d.ts +2 -2
  11. package/dist/_esm5.processed/compat/should_reload_media_source_on_decipherability_update.js +2 -2
  12. package/dist/_esm5.processed/config.d.ts +3 -1
  13. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +3 -2
  14. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +16 -13
  15. package/dist/_esm5.processed/core/adaptive/utils/{filter_by_width.d.ts → filter_by_resolution.d.ts} +11 -5
  16. package/dist/_esm5.processed/core/adaptive/utils/{filter_by_width.js → filter_by_resolution.js} +14 -6
  17. package/dist/_esm5.processed/core/api/debug/buffer_graph.d.ts +28 -0
  18. package/dist/_esm5.processed/core/api/debug/buffer_graph.js +175 -0
  19. package/dist/_esm5.processed/core/api/debug/buffer_size_graph.d.ts +10 -0
  20. package/dist/_esm5.processed/core/api/debug/buffer_size_graph.js +104 -0
  21. package/dist/_esm5.processed/core/api/debug/constants.d.ts +2 -0
  22. package/dist/_esm5.processed/core/api/debug/constants.js +2 -0
  23. package/dist/_esm5.processed/core/api/debug/index.d.ts +2 -0
  24. package/dist/_esm5.processed/core/api/debug/index.js +2 -0
  25. package/dist/_esm5.processed/core/api/debug/modules/general_info.d.ts +3 -0
  26. package/dist/_esm5.processed/core/api/debug/modules/general_info.js +180 -0
  27. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.d.ts +4 -0
  28. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +121 -0
  29. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.d.ts +3 -0
  30. package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.js +35 -0
  31. package/dist/_esm5.processed/core/api/debug/render.d.ts +3 -0
  32. package/dist/_esm5.processed/core/api/debug/render.js +32 -0
  33. package/dist/_esm5.processed/core/api/debug/utils.d.ts +39 -0
  34. package/dist/_esm5.processed/core/api/debug/utils.js +57 -0
  35. package/dist/_esm5.processed/core/api/option_utils.d.ts +1 -1
  36. package/dist/_esm5.processed/core/api/option_utils.js +5 -5
  37. package/dist/_esm5.processed/core/api/playback_observer.js +3 -2
  38. package/dist/_esm5.processed/core/api/public_api.d.ts +18 -11
  39. package/dist/_esm5.processed/core/api/public_api.js +83 -48
  40. package/dist/_esm5.processed/core/api/utils.js +3 -3
  41. package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.d.ts +32 -13
  42. package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.js +28 -7
  43. package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +1 -1
  44. package/dist/_esm5.processed/core/decrypt/content_decryptor.js +1 -1
  45. package/dist/_esm5.processed/core/decrypt/find_key_system.js +29 -6
  46. package/dist/_esm5.processed/core/decrypt/{get_current_key_system.d.ts → get_key_system_configuration.d.ts} +4 -3
  47. package/dist/_esm5.processed/core/decrypt/{get_current_key_system.js → get_key_system_configuration.js} +11 -5
  48. package/dist/_esm5.processed/core/decrypt/index.d.ts +2 -2
  49. package/dist/_esm5.processed/core/decrypt/index.js +2 -2
  50. package/dist/_esm5.processed/core/decrypt/session_events_listener.js +35 -31
  51. package/dist/_esm5.processed/core/decrypt/utils/check_key_statuses.js +4 -0
  52. package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.d.ts +17 -8
  53. package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.js +10 -6
  54. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +5 -4
  55. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +22 -5
  56. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +37 -21
  57. package/dist/_esm5.processed/core/fetchers/segment/task_prioritizer.js +21 -23
  58. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +17 -7
  59. package/dist/_esm5.processed/core/init/directfile_content_initializer.js +1 -1
  60. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +30 -34
  61. package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.js +2 -2
  62. package/dist/_esm5.processed/core/init/utils/create_media_source.js +3 -12
  63. package/dist/_esm5.processed/core/init/utils/end_of_stream.js +6 -3
  64. package/dist/_esm5.processed/core/init/utils/get_loaded_reference.js +2 -1
  65. package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +9 -5
  66. package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.js +2 -1
  67. package/dist/_esm5.processed/core/init/utils/media_duration_updater.js +24 -20
  68. package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +1 -1
  69. package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.js +6 -4
  70. package/dist/_esm5.processed/core/init/utils/throw_on_media_error.js +1 -1
  71. package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +7 -10
  72. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +4 -2
  73. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +13 -9
  74. package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +30 -16
  75. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +26 -12
  76. package/dist/_esm5.processed/core/stream/period/period_stream.js +11 -10
  77. package/dist/_esm5.processed/core/stream/representation/representation_stream.js +15 -15
  78. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.js +1 -1
  79. package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.js +16 -6
  80. package/dist/_esm5.processed/core/stream/utils/create_reload_request.js +1 -1
  81. package/dist/_esm5.processed/default_config.d.ts +22 -5
  82. package/dist/_esm5.processed/default_config.js +25 -5
  83. package/dist/_esm5.processed/experimental/features/debug_element.d.ts +8 -0
  84. package/dist/_esm5.processed/experimental/features/debug_element.js +10 -0
  85. package/dist/_esm5.processed/experimental/features/index.d.ts +1 -0
  86. package/dist/_esm5.processed/experimental/features/index.js +1 -0
  87. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +7 -4
  88. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +8 -4
  89. package/dist/_esm5.processed/features/features_object.js +1 -0
  90. package/dist/_esm5.processed/features/initialize_features.js +13 -10
  91. package/dist/_esm5.processed/features/types.d.ts +3 -0
  92. package/dist/_esm5.processed/manifest/adaptation.js +4 -0
  93. package/dist/_esm5.processed/manifest/manifest.js +2 -0
  94. package/dist/_esm5.processed/manifest/representation.js +11 -4
  95. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +105 -137
  96. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +25 -5
  97. package/dist/_esm5.processed/public_types.d.ts +8 -1
  98. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +15 -11
  99. package/dist/_esm5.processed/transports/dash/low_latency_segment_loader.js +2 -2
  100. package/dist/_esm5.processed/transports/dash/manifest_parser.js +1 -1
  101. package/dist/_esm5.processed/transports/dash/segment_loader.js +4 -4
  102. package/dist/_esm5.processed/transports/local/segment_loader.js +13 -26
  103. package/dist/_esm5.processed/transports/smooth/segment_loader.js +4 -4
  104. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +3 -3
  105. package/dist/_esm5.processed/utils/cancellable_sleep.js +4 -10
  106. package/dist/_esm5.processed/utils/create_cancellable_promise.d.ts +26 -0
  107. package/dist/_esm5.processed/utils/create_cancellable_promise.js +52 -0
  108. package/dist/_esm5.processed/utils/reference.js +6 -0
  109. package/dist/_esm5.processed/utils/request/xhr.js +1 -1
  110. package/dist/_esm5.processed/utils/task_canceller.d.ts +34 -15
  111. package/dist/_esm5.processed/utils/task_canceller.js +55 -22
  112. package/dist/rx-player.js +1057 -766
  113. package/dist/rx-player.min.js +1 -1
  114. package/jest.config.js +1 -5
  115. package/package.json +19 -21
  116. package/scripts/build/constants.d.ts +1 -0
  117. package/scripts/fast_demo_build.js +38 -39
  118. package/sonar-project.properties +1 -1
  119. package/src/compat/__tests__/should_reload_media_source_on_decipherability_update.test.ts +1 -1
  120. package/src/compat/browser_detection.ts +99 -52
  121. package/src/compat/can_reuse_media_keys.ts +5 -2
  122. package/src/compat/eme/close_session.ts +2 -2
  123. package/src/compat/event_listeners.ts +109 -41
  124. package/src/compat/should_reload_media_source_on_decipherability_update.ts +3 -3
  125. package/src/core/adaptive/adaptive_representation_selector.ts +28 -19
  126. package/src/core/adaptive/utils/__tests__/filter_by_resolution.test.ts +82 -0
  127. package/src/core/adaptive/utils/{filter_by_width.ts → filter_by_resolution.ts} +21 -7
  128. package/src/core/api/__tests__/option_utils.test.ts +11 -7
  129. package/src/core/api/debug/buffer_graph.ts +247 -0
  130. package/src/core/api/debug/buffer_size_graph.ts +130 -0
  131. package/src/core/api/debug/constants.ts +2 -0
  132. package/src/core/api/debug/index.ts +3 -0
  133. package/src/core/api/debug/modules/general_info.ts +184 -0
  134. package/src/core/api/debug/modules/segment_buffer_content.ts +155 -0
  135. package/src/core/api/debug/modules/segment_buffer_size.ts +48 -0
  136. package/src/core/api/debug/render.ts +40 -0
  137. package/src/core/api/debug/utils.ts +103 -0
  138. package/src/core/api/option_utils.ts +8 -7
  139. package/src/core/api/playback_observer.ts +4 -2
  140. package/src/core/api/public_api.ts +99 -56
  141. package/src/core/api/utils.ts +3 -3
  142. package/src/core/decrypt/__tests__/__global__/utils.ts +61 -40
  143. package/src/core/decrypt/attach_media_keys.ts +1 -1
  144. package/src/core/decrypt/content_decryptor.ts +1 -1
  145. package/src/core/decrypt/find_key_system.ts +25 -11
  146. package/src/core/decrypt/{get_current_key_system.ts → get_key_system_configuration.ts} +12 -6
  147. package/src/core/decrypt/index.ts +2 -2
  148. package/src/core/decrypt/session_events_listener.ts +39 -38
  149. package/src/core/decrypt/utils/check_key_statuses.ts +6 -0
  150. package/src/core/fetchers/cdn_prioritizer.ts +18 -9
  151. package/src/core/fetchers/manifest/manifest_fetcher.ts +5 -4
  152. package/src/core/fetchers/segment/segment_fetcher.ts +36 -14
  153. package/src/core/fetchers/segment/task_prioritizer.ts +25 -30
  154. package/src/core/fetchers/utils/schedule_request.ts +18 -7
  155. package/src/core/init/directfile_content_initializer.ts +1 -1
  156. package/src/core/init/media_source_content_initializer.ts +40 -44
  157. package/src/core/init/utils/content_time_boundaries_observer.ts +2 -2
  158. package/src/core/init/utils/create_media_source.ts +4 -16
  159. package/src/core/init/utils/end_of_stream.ts +6 -3
  160. package/src/core/init/utils/get_loaded_reference.ts +2 -1
  161. package/src/core/init/utils/initial_seek_and_play.ts +9 -5
  162. package/src/core/init/utils/initialize_content_decryption.ts +2 -1
  163. package/src/core/init/utils/media_duration_updater.ts +26 -21
  164. package/src/core/init/utils/rebuffering_controller.ts +1 -1
  165. package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +6 -4
  166. package/src/core/init/utils/throw_on_media_error.ts +1 -1
  167. package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +7 -11
  168. package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +4 -2
  169. package/src/core/segment_buffers/segment_buffers_store.ts +16 -13
  170. package/src/core/stream/adaptation/adaptation_stream.ts +33 -19
  171. package/src/core/stream/orchestrator/stream_orchestrator.ts +26 -12
  172. package/src/core/stream/period/period_stream.ts +11 -10
  173. package/src/core/stream/representation/representation_stream.ts +15 -15
  174. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +1 -1
  175. package/src/core/stream/representation/utils/downloading_queue.ts +16 -4
  176. package/src/core/stream/utils/create_reload_request.ts +1 -1
  177. package/src/default_config.ts +36 -14
  178. package/src/experimental/features/__tests__/debug_element.test.ts +26 -0
  179. package/src/experimental/features/debug_element.ts +13 -0
  180. package/src/experimental/features/index.ts +1 -0
  181. package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +7 -4
  182. package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +8 -4
  183. package/src/features/__tests__/initialize_features.test.ts +11 -0
  184. package/src/features/features_object.ts +1 -0
  185. package/src/features/initialize_features.ts +15 -10
  186. package/src/features/types.ts +9 -0
  187. package/src/manifest/__tests__/period.test.ts +8 -4
  188. package/src/manifest/adaptation.ts +7 -0
  189. package/src/manifest/manifest.ts +4 -0
  190. package/src/manifest/representation.ts +10 -4
  191. package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +116 -151
  192. package/src/parsers/manifest/dash/common/parse_representations.ts +21 -4
  193. package/src/public_types.ts +11 -2
  194. package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +31 -22
  195. package/src/transports/dash/low_latency_segment_loader.ts +2 -2
  196. package/src/transports/dash/manifest_parser.ts +1 -1
  197. package/src/transports/dash/segment_loader.ts +4 -4
  198. package/src/transports/local/segment_loader.ts +14 -30
  199. package/src/transports/smooth/segment_loader.ts +4 -4
  200. package/src/transports/utils/call_custom_manifest_loader.ts +3 -3
  201. package/src/typings/globals.d.ts +2 -0
  202. package/src/utils/cancellable_sleep.ts +5 -14
  203. package/src/utils/create_cancellable_promise.ts +69 -0
  204. package/src/utils/reference.ts +6 -0
  205. package/src/utils/request/xhr.ts +1 -1
  206. package/src/utils/task_canceller.ts +63 -34
  207. package/tsconfig.json +1 -1
  208. package/tsconfig.modules.json +1 -1
  209. package/a.js +0 -381
  210. package/locked_reps.js +0 -46
  211. package/src/core/adaptive/utils/__tests__/filter_by_width.test.ts +0 -60
package/.eslintrc.js CHANGED
@@ -16,10 +16,18 @@ module.exports = {
16
16
  "plugins": [
17
17
  "eslint-plugin-import",
18
18
  "eslint-plugin-jsdoc",
19
+ "ban",
19
20
  "@typescript-eslint",
20
21
  "@typescript-eslint/tslint"
21
22
  ],
22
23
  "rules": {
24
+ "ban/ban": [
25
+ 2,
26
+ {
27
+ "name": ["*", "finally"],
28
+ "message": "Promise.prototype.finally is forbidden due to poor support from older devices.\nNote that this linting rule just bans naively all \"finally\" method calls, if in this case it wasn't called on a Promise, you can safely ignore this error",
29
+ }
30
+ ],
23
31
  "@typescript-eslint/adjacent-overload-signatures": "error",
24
32
  "@typescript-eslint/array-type": [
25
33
  "error",
package/CHANGELOG.md CHANGED
@@ -1,8 +1,61 @@
1
1
  # Changelog
2
2
 
3
- ## v4.0.0-alpha.2022110300 (2022-11-03)
3
+ ## v4.0.0-beta.1 (2023-03-08)
4
4
 
5
- ### Changed
5
+ ### Bug fixes
6
+
7
+ - (v4.0.0-beta.0-only issue) Fix memory leak
8
+ - (v4.0.0-beta.0-only issue) Fix MediaSource duration when maxBufferedEnd is inferior to current duration but superior to calculated duration
9
+ - (v4.0.0-beta.0-only issue) Fix stopAtEnd option by also switching to STOPPED state on ended
10
+ - (v4.0.0-beta.0-only issue) Fix some target's support by not relying on Promise.prototype.finally anymore [#1224]
11
+ - (v4.0.0-beta.0-only issue) For dynamic contents, always set a very high duration [#1220]
12
+ - (v4.0.0-beta.0-only issue) DRM: Fix fallbacking for an already-played content by checking key statuses initially linked to a MediaKeySession
13
+
14
+ ### Other improvements
15
+
16
+ - Based on the v3.30.0 of which it inherits all the features, bug fixes and other improvments
17
+
18
+
19
+ ## v3.30.0 (2023-03-07)
20
+
21
+ ### Features
22
+
23
+ - Add `updateContentUrls` API, allowing to update the Manifest's URL during playback [#1182]
24
+ - DASH: implement forced-subtitles, adding the `forced` property to the audio tracks API and selecting by default a forced text track linked to the audio track's language if present [#1187]
25
+ - DRM: add the `getKeySystemConfiguration` method to the RxPlayer [#1202]
26
+ - add experimental `DEBUG_ELEMENT` feature and `createDebugElement` method to render a default debugging HTML element [#1200]
27
+
28
+ ### Deprecated
29
+
30
+ - Deprecate the `getVideoLoadedTime` method which can be easily replaced (see Deprecated method documentation)
31
+ - Deprecate the `getVideoPlayedTime` method which can be easily replaced (see Deprecated method documentation)
32
+ - Deprecate the `transportOptions.aggressiveMode` option
33
+ - DRM: Deprecate the `keySystems[].onKeyStatusesChange` callback as no good use case was found for it.
34
+
35
+ ### Bug fixes
36
+
37
+ - Fix segment requesting error when playing a DASH content without an url and without BaseURL elements [#1192]
38
+ - API: Stop sending events if the content is stopped due to a side-effect of one of the event handler [#1197]
39
+ - text-tracks/ttml: fix inconsistent line spacing when resizing the `textTrackElement` [#1191]
40
+ - DRM: Fix race condition leading to a JS error instead of a `NO_PLAYABLE_REPRESENTATION` [#1201]
41
+ - DRM/Compat: Renew MediaKeys at each `loadVideo` on all WebOS (LG TV) platforms to work around issues [#1188]
42
+
43
+ ### Other improvements
44
+
45
+ - DASH: better detect closed captions [#1187]
46
+ - DASH: handle `endNumber` DASH attribute [#1186]
47
+ - DASH: Do not merge AdaptationSet with role "main" anymore [#1214]
48
+ - DASH: parse `transferCharacteristics` property in the MPD to better detect hdr [#1212]
49
+ - Support encrypted contents on Panasonic 2019 TVs [#1226]
50
+ - Better handle SourceBuffer's QuotaExceededError, responsible for `MediaError` with the `BUFFER_FULL_ERROR` code [#1221]
51
+ - API: send available...TracksChange events in the very unlikely scenario where tracks are added after a manifest update [#1197]
52
+ - Completely remove RxJS dependency from the RxPlayer's source code [#1193]
53
+ - DRM: Request PR recommendation when PlayReady is asked and try default recommendation robustnesses [#1189]
54
+
55
+
56
+ ## v4.0.0-beta.0 (2023-01-27)
57
+
58
+ ### Changes
6
59
 
7
60
  - Create `"FREEZING"` player state for cases where the playback position is currently not advancing due to an unknown reason, to separate it from regular `"BUFFERING"`. [#1146]
8
61
  - The `RELOADING` player state (gettable through the `getPlayerState` and `playerStateChange` API) can now happen at any time to unlock playback.
@@ -17,6 +70,7 @@
17
70
  - Remove `audioBitrateChange` and `videoBitrateChange` events in profit of the new `audioRepresentationChange` and `videoRepresentationChange` events
18
71
  - Remove `availableAudioBitratesChange` and `availableVideoBitratesChange` events. Those are less needed with the new Representations lock API and can be mostly replicated through the `audioTrackChange` and `videoTrackChange` events
19
72
  - "Flatten" the `transportOptions` loadVideo options by putting all its inner properties directly at the top level of loadVideo options, to simplify its documentation and discoverability [#1149]
73
+ - Remove `limitVideoWidth` constructor option in profit of the more configurable `videoResolutionLimit` constructor option
20
74
  - Rename `networkConfig` into `requestConfig` and re-organize its inner properties to pave the way for future request-related APIs.
21
75
  - Remove `stopAtEnd` `loadVideo` option and don't automatically stop when reaching the end by default. This behavior can be counter-intuitive and can be very easily implemented by the application.
22
76
  - Remove `decipherabilityUpdate` event as it appeared to be not easily exploitable and exposed internal logic too much [#1168]
@@ -74,7 +128,10 @@
74
128
  - Add `lockVideoRepresentations`, `lockAudioRepresentations`, `getLockedVideoRepresentations`, `getLockedAudioRepresentations`, `unlockVideoRepresentations` and `unlockAudioRepresentations` methods to allow a complex selection of Representations that are currently allowed to play.
75
129
  - Add `getVideoRepresentation` and `getAudioRepresentation` method to retrieve information on the currently loaded representations [#1144]
76
130
  - Add `audioRepresentationChange` and `videoRepresentationChange` events to be notified when the currently-loaded Representation for the current Period changes.
131
+ - Add `updateContentUrls` API, allowing to update the Manifest's URL during playback [#1182]
132
+ - DASH: implement forced-subtitles, adding the `forced` property to the audio tracks API and selecting by default a forced text track linked to the audio track's language if present [#1187]
77
133
  - Add `getContentUrls` allowing to retrieve the one or several known URLs through which the current Manifest or content is reachable.
134
+ - Add `videoResolutionLimit` constructor option allowing to automatically limit a video Representation's resolution.
78
135
  - Add `newAvailablePeriods` event to signal new Period on which a track and/or Representation choice can be made
79
136
  - Add `brokenRepresentationsLock` event for when a Representations lock could not be respected anymore
80
137
  - Add `trackUpdate` event for when a track has been updated for any type and Period
@@ -99,6 +156,18 @@
99
156
  - Add `IVideoTrackSetting` public type to define the object that may be given to the `setVideoTrack` method
100
157
  - Add `ITextTrackSetting` public type to define the object that may be given to the `setTextTrack` method
101
158
 
159
+ ### Bug fixes
160
+
161
+ - Fix segment requesting error when playing a DASH content without an url and without BaseURL elements [#1192]
162
+ - API: Stop sending events if the content is stopped due to a side-effect of one of the event handler [#1197]
163
+ - text-tracks/ttml: fix inconsistent line spacing when resizing the `textTrackElement` [#1191]
164
+ - DRM: Fix race condition leading to a JS error instead of a `NO_PLAYABLE_REPRESENTATION` [#1201]
165
+ - DRM/Compat: Renew MediaKeys at each `loadVideo` on all WebOS (LG TV) platforms to work around issues [#1188]
166
+
167
+ ### Other improvements
168
+
169
+ - Remove dependency to RxJS, improving the debugging experience and preventing some uncaught Error from being thrown
170
+
102
171
 
103
172
  ## v3.29.0 (2022-11-16)
104
173
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.0-alpha.2023012000
1
+ 4.0.0-beta.1
@@ -13,17 +13,28 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- declare const isIE11: boolean;
17
- declare const isIEOrEdge: boolean;
18
- declare const isEdgeChromium: boolean;
19
- declare const isFirefox: boolean;
20
- declare const isSamsungBrowser: boolean;
21
- declare const isTizen: boolean;
22
- declare const isWebOs: boolean;
23
- declare const isWebOs2021: boolean;
24
- declare const isWebOs2022: boolean;
16
+ /** Edge Chromium, regardless of the device */
17
+ declare let isEdgeChromium: boolean;
18
+ /** IE11, regardless of the device */
19
+ declare let isIE11: boolean;
20
+ /** IE11 or Edge __Legacy__ (not Edge Chromium), regardless of the device */
21
+ declare let isIEOrEdge: boolean;
22
+ /** Firefox, regardless of the device */
23
+ declare let isFirefox: boolean;
25
24
  /** `true` on Safari on a PC platform (i.e. not iPhone / iPad etc.) */
26
- declare const isSafariDesktop: boolean;
25
+ declare let isSafariDesktop: boolean;
27
26
  /** `true` on Safari on an iPhone, iPad & iPod platform */
28
- declare const isSafariMobile: boolean;
29
- export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
27
+ declare let isSafariMobile: boolean;
28
+ /** Samsung's own browser application */
29
+ declare let isSamsungBrowser: boolean;
30
+ /** `true` on devices where Tizen is the OS (e.g. Samsung TVs). */
31
+ declare let isTizen: boolean;
32
+ /** `true` on devices where WebOS is the OS (e.g. LG TVs). */
33
+ declare let isWebOs: boolean;
34
+ /** `true` specifically for WebOS 2021 version. */
35
+ declare let isWebOs2021: boolean;
36
+ /** `true` specifically for WebOS 2022 version. */
37
+ declare let isWebOs2022: boolean;
38
+ /** `true` for Panasonic devices. */
39
+ declare let isPanasonic: boolean;
40
+ export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
@@ -13,44 +13,86 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- var _a, _b;
17
16
  import isNode from "./is_node";
18
- // true on IE11
19
- // false on Edge and other IEs/browsers.
20
- var isIE11 = !isNode &&
21
- typeof window.MSInputMethodContext !== "undefined" &&
22
- typeof document.documentMode !== "undefined";
23
- // true for IE / Edge
24
- var isIEOrEdge = isNode ?
25
- false :
26
- navigator.appName === "Microsoft Internet Explorer" ||
27
- navigator.appName === "Netscape" &&
28
- /(Trident|Edge)\//.test(navigator.userAgent);
29
- var isEdgeChromium = !isNode &&
30
- navigator.userAgent.toLowerCase().indexOf("edg/") !== -1;
31
- var isFirefox = !isNode &&
32
- navigator.userAgent.toLowerCase().indexOf("firefox") !== -1;
33
- var isSamsungBrowser = !isNode &&
34
- /SamsungBrowser/.test(navigator.userAgent);
35
- var isTizen = !isNode &&
36
- /Tizen/.test(navigator.userAgent);
37
- var isWebOs = !isNode &&
38
- navigator.userAgent.indexOf("Web0S") >= 0;
39
- // Inspired form: http://webostv.developer.lge.com/discover/specifications/web-engine/
40
- // Note: even that page doesn't correspond to what we've actually seen in the
41
- // wild
42
- var isWebOs2021 = isWebOs &&
43
- (/[Ww]eb[O0]S.TV-2021/.test(navigator.userAgent) ||
44
- /[Cc]hr[o0]me\/79/.test(navigator.userAgent));
45
- var isWebOs2022 = isWebOs &&
46
- (/[Ww]eb[O0]S.TV-2022/.test(navigator.userAgent) ||
47
- /[Cc]hr[o0]me\/87/.test(navigator.userAgent));
17
+ /** Edge Chromium, regardless of the device */
18
+ var isEdgeChromium = false;
19
+ /** IE11, regardless of the device */
20
+ var isIE11 = false;
21
+ /** IE11 or Edge __Legacy__ (not Edge Chromium), regardless of the device */
22
+ var isIEOrEdge = false;
23
+ /** Firefox, regardless of the device */
24
+ var isFirefox = false;
48
25
  /** `true` on Safari on a PC platform (i.e. not iPhone / iPad etc.) */
49
- var isSafariDesktop = !isNode && (Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") >= 0 ||
50
- ((_b = (_a = window.safari) === null || _a === void 0 ? void 0 : _a.pushNotification) === null || _b === void 0 ? void 0 : _b.toString()) ===
51
- "[object SafariRemoteNotification]");
26
+ var isSafariDesktop = false;
52
27
  /** `true` on Safari on an iPhone, iPad & iPod platform */
53
- var isSafariMobile = !isNode &&
54
- typeof navigator.platform === "string" &&
55
- /iPad|iPhone|iPod/.test(navigator.platform);
56
- export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
28
+ var isSafariMobile = false;
29
+ /** Samsung's own browser application */
30
+ var isSamsungBrowser = false;
31
+ /** `true` on devices where Tizen is the OS (e.g. Samsung TVs). */
32
+ var isTizen = false;
33
+ /** `true` on devices where WebOS is the OS (e.g. LG TVs). */
34
+ var isWebOs = false;
35
+ /** `true` specifically for WebOS 2021 version. */
36
+ var isWebOs2021 = false;
37
+ /** `true` specifically for WebOS 2022 version. */
38
+ var isWebOs2022 = false;
39
+ /** `true` for Panasonic devices. */
40
+ var isPanasonic = false;
41
+ ((function findCurrentBrowser() {
42
+ var _a, _b;
43
+ if (isNode) {
44
+ return;
45
+ }
46
+ // 1 - Find out browser between IE/Edge Legacy/Edge Chromium/Firefox/Safari
47
+ if (typeof window.MSInputMethodContext !== "undefined" &&
48
+ typeof document.documentMode !== "undefined") {
49
+ isIE11 = true;
50
+ isIEOrEdge = true;
51
+ }
52
+ else if (navigator.appName === "Microsoft Internet Explorer" ||
53
+ navigator.appName === "Netscape" &&
54
+ /(Trident|Edge)\//.test(navigator.userAgent)) {
55
+ isIEOrEdge = true;
56
+ }
57
+ else if (navigator.userAgent.toLowerCase().indexOf("edg/") !== -1) {
58
+ isEdgeChromium = true;
59
+ }
60
+ else if (navigator.userAgent.toLowerCase().indexOf("firefox") !== -1) {
61
+ isFirefox = true;
62
+ }
63
+ else if (typeof navigator.platform === "string" &&
64
+ /iPad|iPhone|iPod/.test(navigator.platform)) {
65
+ isSafariMobile = true;
66
+ }
67
+ else if (Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") >= 0 ||
68
+ ((_b = (_a = window.safari) === null || _a === void 0 ? void 0 : _a.pushNotification) === null || _b === void 0 ? void 0 : _b.toString()) ===
69
+ "[object SafariRemoteNotification]") {
70
+ isSafariDesktop = true;
71
+ }
72
+ // 2 - Find out specific device/platform information
73
+ // Samsung browser e.g. on Android
74
+ if (/SamsungBrowser/.test(navigator.userAgent)) {
75
+ isSamsungBrowser = true;
76
+ }
77
+ if (/Tizen/.test(navigator.userAgent)) {
78
+ isTizen = true;
79
+ // Inspired form: http://webostv.developer.lge.com/discover/specifications/web-engine/
80
+ // Note: even that page doesn't correspond to what we've actually seen in the
81
+ // wild
82
+ }
83
+ else if (/[Ww]eb[O0]S/.test(navigator.userAgent)) {
84
+ isWebOs = true;
85
+ if (/[Ww]eb[O0]S.TV-2022/.test(navigator.userAgent) ||
86
+ /[Cc]hr[o0]me\/87/.test(navigator.userAgent)) {
87
+ isWebOs2022 = true;
88
+ }
89
+ else if (/[Ww]eb[O0]S.TV-2021/.test(navigator.userAgent) ||
90
+ /[Cc]hr[o0]me\/79/.test(navigator.userAgent)) {
91
+ isWebOs2021 = true;
92
+ }
93
+ }
94
+ else if (/[Pp]anasonic/.test(navigator.userAgent)) {
95
+ isPanasonic = true;
96
+ }
97
+ })());
98
+ export { isEdgeChromium, isIE11, isIEOrEdge, isFirefox, isPanasonic, isSafariDesktop, isSafariMobile, isSamsungBrowser, isTizen, isWebOs, isWebOs2021, isWebOs2022, };
@@ -1,4 +1,4 @@
1
- import { isWebOs } from "./browser_detection";
1
+ import { isPanasonic, isWebOs, } from "./browser_detection";
2
2
  /**
3
3
  * Returns `true` if a `MediaKeys` instance (the `Encrypted Media Extension`
4
4
  * concept) can be reused between contents.
@@ -12,5 +12,5 @@ import { isWebOs } from "./browser_detection";
12
12
  * @returns {boolean}
13
13
  */
14
14
  export default function canReuseMediaKeys() {
15
- return !isWebOs;
15
+ return !isWebOs && !isPanasonic;
16
16
  }
@@ -136,7 +136,7 @@ export default function closeSession(session) {
136
136
  return [3 /*break*/, 4];
137
137
  case 2:
138
138
  err_2 = _a.sent();
139
- if (timeoutCanceller.isUsed) { // Reminder: cancelled == session closed
139
+ if (timeoutCanceller.isUsed()) { // Reminder: cancelled == session closed
140
140
  return [2 /*return*/];
141
141
  }
142
142
  // The caught error can tell if session is closed
@@ -151,7 +151,7 @@ export default function closeSession(session) {
151
151
  _a.sent();
152
152
  return [3 /*break*/, 4];
153
153
  case 4:
154
- if (timeoutCanceller.isUsed) { // Reminder: cancelled == session closed
154
+ if (timeoutCanceller.isUsed()) { // Reminder: cancelled == session closed
155
155
  return [2 /*return*/];
156
156
  }
157
157
  throw new Error("Compat: Couldn't know if session is closed");
@@ -22,6 +22,12 @@ export interface IEventEmitterLike {
22
22
  removeEventListener: (eventName: string, handler: () => void) => void;
23
23
  }
24
24
  export type IEventTargetLike = HTMLElement | IEventEmitterLike | IEventEmitter<unknown>;
25
+ /**
26
+ * Get video width from Picture-in-Picture window
27
+ * @param {HTMLMediaElement} mediaElement
28
+ * @param {Object} pipWindow
29
+ * @returns {number}
30
+ */
25
31
  export interface IPictureInPictureEvent {
26
32
  isEnabled: boolean;
27
33
  pipWindow: ICompatPictureInPictureWindow | null;
@@ -45,14 +51,28 @@ declare function getPictureOnPictureStateRef(elt: HTMLMediaElement, stopListenin
45
51
  */
46
52
  declare function getVideoVisibilityRef(pipStatus: IReadOnlySharedReference<IPictureInPictureEvent>, stopListening: CancellationSignal): IReadOnlySharedReference<boolean>;
47
53
  /**
48
- * Get video width from HTML video element, or video estimated dimensions
49
- * when Picture-in-Picture is activated.
54
+ * Get video width and height from the screen dimensions.
55
+ * @param {Object} stopListening
56
+ * @returns {Object}
57
+ */
58
+ declare function getScreenResolutionRef(stopListening: CancellationSignal): IReadOnlySharedReference<{
59
+ width: number | undefined;
60
+ height: number | undefined;
61
+ pixelRatio: number;
62
+ }>;
63
+ /**
64
+ * Get video width and height from HTML media element, or video estimated
65
+ * dimensions when Picture-in-Picture is activated.
50
66
  * @param {HTMLMediaElement} mediaElement
51
67
  * @param {Object} pipStatusRef
52
68
  * @param {Object} stopListening
53
69
  * @returns {Object}
54
70
  */
55
- declare function getVideoWidthRef(mediaElement: HTMLMediaElement, pipStatusRef: IReadOnlySharedReference<IPictureInPictureEvent>, stopListening: CancellationSignal): IReadOnlySharedReference<number>;
71
+ declare function getElementResolutionRef(mediaElement: HTMLMediaElement, pipStatusRef: IReadOnlySharedReference<IPictureInPictureEvent>, stopListening: CancellationSignal): IReadOnlySharedReference<{
72
+ width: number | undefined;
73
+ height: number | undefined;
74
+ pixelRatio: number;
75
+ }>;
56
76
  /**
57
77
  * @param {HTMLMediaElement} mediaElement
58
78
  */
@@ -142,4 +162,4 @@ declare const onEnded: (element: IEventTargetLike, listener: (event?: unknown) =
142
162
  * emits
143
163
  */
144
164
  declare function addEventListener(elt: IEventEmitterLike, evt: string, listener: (x?: unknown) => void, stopListening: CancellationSignal): void;
145
- export { addEventListener, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef, onEncrypted, onEnded, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };
165
+ export { addEventListener, getPictureOnPictureStateRef, getVideoVisibilityRef, getElementResolutionRef, getScreenResolutionRef, onEncrypted, onEnded, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };
@@ -19,13 +19,8 @@ import isNonEmptyString from "../utils/is_non_empty_string";
19
19
  import isNullOrUndefined from "../utils/is_null_or_undefined";
20
20
  import noop from "../utils/noop";
21
21
  import createSharedReference from "../utils/reference";
22
- import isNode from "./is_node";
23
22
  import shouldFavourCustomSafariEME from "./should_favour_custom_safari_EME";
24
23
  var BROWSER_PREFIXES = ["", "webkit", "moz", "ms"];
25
- var pixelRatio = isNode ||
26
- window.devicePixelRatio == null ||
27
- window.devicePixelRatio === 0 ? 1 :
28
- window.devicePixelRatio;
29
24
  /**
30
25
  * Find the first supported event from the list given.
31
26
  * @param {HTMLElement} element
@@ -80,7 +75,7 @@ function createCompatibleEventListener(eventNames, prefixes) {
80
75
  var mem;
81
76
  var prefixedEvents = eventPrefixed(eventNames, prefixes);
82
77
  return function (element, listener, cancelSignal) {
83
- if (cancelSignal.isCancelled) {
78
+ if (cancelSignal.isCancelled()) {
84
79
  return;
85
80
  }
86
81
  // if the element is a HTMLElement we can detect
@@ -167,18 +162,6 @@ function getDocumentVisibilityRef(stopListening) {
167
162
  }, stopListening);
168
163
  return ref;
169
164
  }
170
- /**
171
- * Get video width from Picture-in-Picture window
172
- * @param {HTMLMediaElement} mediaElement
173
- * @param {Object} pipWindow
174
- * @returns {number}
175
- */
176
- function getVideoWidthFromPIPWindow(mediaElement, pipWindow) {
177
- var width = pipWindow.width, height = pipWindow.height;
178
- var videoRatio = mediaElement.clientHeight / mediaElement.clientWidth;
179
- var calcWidth = height / videoRatio;
180
- return Math.min(width, calcWidth);
181
- }
182
165
  /**
183
166
  * Emit when video enters and leaves Picture-In-Picture mode.
184
167
  * @param {HTMLMediaElement} elt
@@ -252,46 +235,98 @@ function getVideoVisibilityRef(pipStatus, stopListening) {
252
235
  }
253
236
  }
254
237
  /**
255
- * Get video width from HTML video element, or video estimated dimensions
256
- * when Picture-in-Picture is activated.
238
+ * Get video width and height from the screen dimensions.
239
+ * @param {Object} stopListening
240
+ * @returns {Object}
241
+ */
242
+ function getScreenResolutionRef(stopListening) {
243
+ var pixelRatio = window.devicePixelRatio == null ||
244
+ window.devicePixelRatio === 0 ? 1 :
245
+ window.devicePixelRatio;
246
+ var ref = createSharedReference({ width: window.screen.width,
247
+ height: window.screen.height, pixelRatio: pixelRatio }, stopListening);
248
+ var interval = window.setInterval(checkScreenResolution, 20000);
249
+ stopListening.register(function stopUpdating() {
250
+ clearInterval(interval);
251
+ });
252
+ return ref;
253
+ function checkScreenResolution() {
254
+ var oldVal = ref.getValue();
255
+ if (oldVal.width !== screen.width ||
256
+ oldVal.height !== screen.height ||
257
+ oldVal.pixelRatio !== pixelRatio) {
258
+ ref.setValue({ width: screen.width,
259
+ height: screen.height, pixelRatio: pixelRatio });
260
+ }
261
+ }
262
+ }
263
+ /**
264
+ * Get video width and height from HTML media element, or video estimated
265
+ * dimensions when Picture-in-Picture is activated.
257
266
  * @param {HTMLMediaElement} mediaElement
258
267
  * @param {Object} pipStatusRef
259
268
  * @param {Object} stopListening
260
269
  * @returns {Object}
261
270
  */
262
- function getVideoWidthRef(mediaElement, pipStatusRef, stopListening) {
263
- var ref = createSharedReference(mediaElement.clientWidth * pixelRatio, stopListening);
271
+ function getElementResolutionRef(mediaElement, pipStatusRef, stopListening) {
272
+ var pixelRatio = window.devicePixelRatio == null ||
273
+ window.devicePixelRatio === 0 ? 1 :
274
+ window.devicePixelRatio;
275
+ var ref = createSharedReference({ width: mediaElement.clientWidth,
276
+ height: mediaElement.clientHeight, pixelRatio: pixelRatio }, stopListening);
264
277
  var clearPreviousEventListener = noop;
265
- pipStatusRef.onUpdate(checkVideoWidth, { clearSignal: stopListening });
266
- addEventListener(window, "resize", checkVideoWidth, stopListening);
267
- var interval = window.setInterval(checkVideoWidth, 20000);
268
- checkVideoWidth();
269
- stopListening.register(function stopUpdatingVideoWidthRef() {
278
+ pipStatusRef.onUpdate(checkElementResolution, { clearSignal: stopListening });
279
+ addEventListener(window, "resize", checkElementResolution, stopListening);
280
+ addEventListener(mediaElement, "enterpictureinpicture", checkElementResolution, stopListening);
281
+ addEventListener(mediaElement, "leavepictureinpicture", checkElementResolution, stopListening);
282
+ var interval = window.setInterval(checkElementResolution, 20000);
283
+ checkElementResolution();
284
+ stopListening.register(function stopUpdating() {
270
285
  clearPreviousEventListener();
271
286
  clearInterval(interval);
272
287
  });
273
288
  return ref;
274
- function checkVideoWidth() {
289
+ function checkElementResolution() {
275
290
  clearPreviousEventListener();
276
291
  var pipStatus = pipStatusRef.getValue();
292
+ var pipWindow = pipStatus.pipWindow;
277
293
  if (!pipStatus.isEnabled) {
278
- ref.setValueIfChanged(mediaElement.clientWidth * pixelRatio);
294
+ var oldVal = ref.getValue();
295
+ if (oldVal.width !== mediaElement.clientWidth ||
296
+ oldVal.height !== mediaElement.clientHeight ||
297
+ oldVal.pixelRatio !== pixelRatio) {
298
+ ref.setValue({ width: mediaElement.clientWidth,
299
+ height: mediaElement.clientHeight, pixelRatio: pixelRatio });
300
+ }
279
301
  }
280
- else if (!isNullOrUndefined(pipStatus.pipWindow)) {
281
- var pipWindow_1 = pipStatus.pipWindow;
282
- var firstWidth = getVideoWidthFromPIPWindow(mediaElement, pipWindow_1);
302
+ else if (!isNullOrUndefined(pipWindow)) {
283
303
  var onPipResize_1 = function () {
284
- ref.setValueIfChanged(getVideoWidthFromPIPWindow(mediaElement, pipWindow_1) * pixelRatio);
304
+ updateToPipWindowResolution();
285
305
  };
286
- pipWindow_1.addEventListener("resize", onPipResize_1);
306
+ pipWindow.addEventListener("resize", onPipResize_1);
287
307
  clearPreviousEventListener = function () {
288
- pipWindow_1.removeEventListener("resize", onPipResize_1);
308
+ pipWindow.removeEventListener("resize", onPipResize_1);
289
309
  clearPreviousEventListener = noop;
290
310
  };
291
- ref.setValueIfChanged(firstWidth * pixelRatio);
311
+ updateToPipWindowResolution();
292
312
  }
293
313
  else {
294
- ref.setValueIfChanged(Infinity);
314
+ var oldVal = ref.getValue();
315
+ if (oldVal.width !== undefined ||
316
+ oldVal.height !== undefined ||
317
+ oldVal.pixelRatio !== pixelRatio) {
318
+ ref.setValue({ width: undefined,
319
+ height: undefined, pixelRatio: pixelRatio });
320
+ }
321
+ }
322
+ function updateToPipWindowResolution() {
323
+ var oldVal = ref.getValue();
324
+ if (oldVal.width !== (pipWindow === null || pipWindow === void 0 ? void 0 : pipWindow.width) ||
325
+ oldVal.height !== (pipWindow === null || pipWindow === void 0 ? void 0 : pipWindow.height) ||
326
+ oldVal.pixelRatio !== pixelRatio) {
327
+ ref.setValue({ width: pipWindow === null || pipWindow === void 0 ? void 0 : pipWindow.width,
328
+ height: pipWindow === null || pipWindow === void 0 ? void 0 : pipWindow.height, pixelRatio: pixelRatio });
329
+ }
295
330
  }
296
331
  }
297
332
  }
@@ -390,4 +425,4 @@ function addEventListener(elt, evt, listener, stopListening) {
390
425
  elt.removeEventListener(evt, listener);
391
426
  });
392
427
  }
393
- export { addEventListener, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef, onEncrypted, onEnded, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };
428
+ export { addEventListener, getPictureOnPictureStateRef, getVideoVisibilityRef, getElementResolutionRef, getScreenResolutionRef, onEncrypted, onEnded, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };
@@ -20,7 +20,7 @@
20
20
  * We found that on all Widevine targets tested, a simple seek is sufficient.
21
21
  * As widevine clients make a good chunk of users, we can make a difference
22
22
  * between them and others as it is for the better.
23
- * @param {string|null} currentKeySystem
23
+ * @param {string|undefined} currentKeySystem
24
24
  * @returns {Boolean}
25
25
  */
26
- export default function shouldReloadMediaSourceOnDecipherabilityUpdate(currentKeySystem: string | null): boolean;
26
+ export default function shouldReloadMediaSourceOnDecipherabilityUpdate(currentKeySystem: string | undefined): boolean;
@@ -20,10 +20,10 @@
20
20
  * We found that on all Widevine targets tested, a simple seek is sufficient.
21
21
  * As widevine clients make a good chunk of users, we can make a difference
22
22
  * between them and others as it is for the better.
23
- * @param {string|null} currentKeySystem
23
+ * @param {string|undefined} currentKeySystem
24
24
  * @returns {Boolean}
25
25
  */
26
26
  export default function shouldReloadMediaSourceOnDecipherabilityUpdate(currentKeySystem) {
27
- return currentKeySystem === null ||
27
+ return currentKeySystem === undefined ||
28
28
  currentKeySystem.indexOf("widevine") < 0;
29
29
  }
@@ -39,7 +39,7 @@ declare class ConfigHandler {
39
39
  DEFAULT_BASE_BANDWIDTH: number;
40
40
  INACTIVITY_DELAY: number;
41
41
  DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN: boolean;
42
- DEFAULT_LIMIT_VIDEO_WIDTH: boolean;
42
+ DEFAULT_VIDEO_RESOLUTION_LIMIT: "none";
43
43
  DEFAULT_LIVE_GAP: {
44
44
  DEFAULT: number;
45
45
  LOW_LATENCY: number;
@@ -124,6 +124,8 @@ declare class ConfigHandler {
124
124
  SEGMENT_PRIORITIES_STEPS: number[];
125
125
  MAX_HIGH_PRIORITY_LEVEL: number;
126
126
  MIN_CANCELABLE_PRIORITY: number;
127
+ EME_DEFAULT_VIDEO_CODECS: string[];
128
+ EME_DEFAULT_AUDIO_CODECS: string[];
127
129
  EME_DEFAULT_WIDEVINE_ROBUSTNESSES: string[];
128
130
  EME_DEFAULT_PLAYREADY_RECOMMENDATION_ROBUSTNESSES: string[];
129
131
  EME_KEY_SYSTEMS: Partial<Record<string, string[]>>;
@@ -19,6 +19,7 @@ import { CancellationSignal } from "../../utils/task_canceller";
19
19
  import { IReadOnlyPlaybackObserver } from "../api";
20
20
  import { IBufferType } from "../segment_buffers";
21
21
  import BandwidthEstimator from "./utils/bandwidth_estimator";
22
+ import { IResolutionInfo } from "./utils/filter_by_resolution";
22
23
  import { IPendingRequestStoreBegin, IPendingRequestStoreProgress } from "./utils/pending_requests_store";
23
24
  /**
24
25
  * Select the most adapted Representation according to the network and buffer
@@ -219,7 +220,7 @@ export interface IRepresentationEstimatorArguments {
219
220
  currentRepresentation: IReadOnlySharedReference<Representation | null>;
220
221
  /** Throttle Representation pool according to filters. */
221
222
  filters: {
222
- limitWidth: IReadOnlySharedReference<number | undefined>;
223
+ limitResolution: IReadOnlySharedReference<IResolutionInfo | undefined>;
223
224
  throttleBitrate: IReadOnlySharedReference<number>;
224
225
  };
225
226
  /**
@@ -300,6 +301,6 @@ export interface IAdaptiveRepresentationSelectorArguments {
300
301
  * to choose from.
301
302
  */
302
303
  export interface IRepresentationEstimatorThrottlers {
303
- limitWidth: Partial<Record<IBufferType, IReadOnlySharedReference<number>>>;
304
+ limitResolution: Partial<Record<IBufferType, IReadOnlySharedReference<IResolutionInfo>>>;
304
305
  throttleBitrate: Partial<Record<IBufferType, IReadOnlySharedReference<number>>>;
305
306
  }