rx-player 3.26.2 → 3.26.3-dev.2022021400

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 (218) hide show
  1. package/.github/workflows/perfs.yml +22 -0
  2. package/CHANGELOG.md +19 -1
  3. package/VERSION +1 -1
  4. package/dist/_esm5.processed/compat/eme/custom_media_keys/index.js +6 -2
  5. package/dist/_esm5.processed/core/abr/buffer_based_chooser.d.ts +28 -6
  6. package/dist/_esm5.processed/core/abr/buffer_based_chooser.js +63 -12
  7. package/dist/_esm5.processed/core/abr/network_analyzer.d.ts +1 -1
  8. package/dist/_esm5.processed/core/abr/pending_requests_store.js +3 -5
  9. package/dist/_esm5.processed/core/abr/representation_estimator.d.ts +1 -1
  10. package/dist/_esm5.processed/core/abr/representation_estimator.js +2 -2
  11. package/dist/_esm5.processed/core/api/media_element_track_choice_manager.d.ts +6 -0
  12. package/dist/_esm5.processed/core/api/media_element_track_choice_manager.js +20 -3
  13. package/dist/_esm5.processed/core/api/public_api.d.ts +3 -3
  14. package/dist/_esm5.processed/core/api/public_api.js +2 -2
  15. package/dist/_esm5.processed/core/api/track_choice_manager.d.ts +6 -6
  16. package/dist/_esm5.processed/core/eme/__tests__/__global__/utils.d.ts +0 -2
  17. package/dist/_esm5.processed/core/eme/__tests__/__global__/utils.js +5 -10
  18. package/dist/_esm5.processed/core/eme/find_key_system.js +15 -5
  19. package/dist/_esm5.processed/core/eme/types.d.ts +2 -2
  20. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +4 -4
  21. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +1 -1
  22. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +2 -2
  23. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +5 -1
  24. package/dist/_esm5.processed/core/fetchers/utils/try_urls_with_backoff.js +1 -1
  25. package/dist/_esm5.processed/core/init/initialize_directfile.d.ts +2 -2
  26. package/dist/_esm5.processed/core/init/initialize_media_source.d.ts +1 -1
  27. package/dist/_esm5.processed/core/init/manifest_update_scheduler.d.ts +4 -4
  28. package/dist/_esm5.processed/core/init/stream_events_emitter/are_same_stream_events.d.ts +4 -4
  29. package/dist/_esm5.processed/core/init/stream_events_emitter/types.d.ts +2 -2
  30. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +3 -3
  31. package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/text_track_cues_store.js +32 -31
  32. package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +4 -4
  33. package/dist/_esm5.processed/core/stream/representation/force_garbage_collection.js +3 -4
  34. package/dist/_esm5.processed/errors/request_error.js +3 -1
  35. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/thumbnail_loader.d.ts +2 -2
  36. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/thumbnail_loader.js +1 -3
  37. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.d.ts +1 -1
  38. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.js +1 -1
  39. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/types.d.ts +3 -3
  40. package/dist/_esm5.processed/manifest/adaptation.d.ts +2 -2
  41. package/dist/_esm5.processed/manifest/adaptation.js +3 -1
  42. package/dist/_esm5.processed/manifest/manifest.d.ts +9 -9
  43. package/dist/_esm5.processed/manifest/period.d.ts +3 -3
  44. package/dist/_esm5.processed/manifest/representation.d.ts +2 -2
  45. package/dist/_esm5.processed/manifest/representation_index/types.d.ts +18 -18
  46. package/dist/_esm5.processed/manifest/types.d.ts +3 -3
  47. package/dist/_esm5.processed/parsers/manifest/dash/common/get_hdr_information.d.ts +1 -1
  48. package/dist/_esm5.processed/parsers/manifest/dash/common/get_periods_time_infos.d.ts +3 -3
  49. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +6 -6
  50. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.d.ts +3 -3
  51. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +2 -2
  52. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +14 -14
  53. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +17 -17
  54. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +1 -1
  55. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +28 -20
  56. package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +19 -4
  57. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +2 -2
  58. package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +1 -1
  59. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.d.ts +17 -35
  60. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +24 -23
  61. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +8 -8
  62. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +18 -27
  63. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +25 -23
  64. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +21 -15
  65. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +19 -19
  66. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.d.ts +15 -38
  67. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +8 -8
  68. package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +30 -30
  69. package/dist/_esm5.processed/parsers/manifest/dash/parsers_types.d.ts +3 -3
  70. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -1
  71. package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts +2 -2
  72. package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +7 -7
  73. package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +8 -8
  74. package/dist/_esm5.processed/parsers/manifest/types.d.ts +28 -28
  75. package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.d.ts +3 -2
  76. package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.js +15 -5
  77. package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.d.ts +2 -2
  78. package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.d.ts +11 -1
  79. package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.js +31 -19
  80. package/dist/_esm5.processed/parsers/texttracks/webvtt/html/to_html.d.ts +2 -2
  81. package/dist/_esm5.processed/parsers/texttracks/webvtt/parse_cue_block.d.ts +1 -1
  82. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +2 -1
  83. package/dist/_esm5.processed/transports/dash/image_pipelines.js +1 -1
  84. package/dist/_esm5.processed/transports/dash/init_segment_loader.js +1 -1
  85. package/dist/_esm5.processed/transports/dash/manifest_parser.js +1 -1
  86. package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +2 -2
  87. package/dist/_esm5.processed/transports/dash/segment_loader.js +2 -2
  88. package/dist/_esm5.processed/transports/dash/segment_parser.d.ts +1 -1
  89. package/dist/_esm5.processed/transports/dash/text_loader.d.ts +1 -1
  90. package/dist/_esm5.processed/transports/dash/text_loader.js +1 -1
  91. package/dist/_esm5.processed/transports/dash/text_parser.d.ts +1 -1
  92. package/dist/_esm5.processed/transports/local/segment_loader.d.ts +1 -2
  93. package/dist/_esm5.processed/transports/local/segment_loader.js +1 -1
  94. package/dist/_esm5.processed/transports/metaplaylist/manifest_loader.d.ts +1 -1
  95. package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +1 -1
  96. package/dist/_esm5.processed/transports/smooth/pipelines.js +1 -1
  97. package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +0 -1
  98. package/dist/_esm5.processed/transports/smooth/segment_loader.js +2 -2
  99. package/dist/_esm5.processed/transports/types.d.ts +36 -30
  100. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +1 -1
  101. package/dist/_esm5.processed/transports/utils/generate_manifest_loader.d.ts +1 -1
  102. package/dist/_esm5.processed/utils/cancellable_sleep.js +1 -1
  103. package/dist/_esm5.processed/utils/cast_to_observable.d.ts +1 -2
  104. package/dist/_esm5.processed/utils/cast_to_observable.js +1 -1
  105. package/dist/_esm5.processed/utils/request/fetch.d.ts +4 -5
  106. package/dist/_esm5.processed/utils/request/fetch.js +7 -4
  107. package/dist/_esm5.processed/utils/request/xhr.d.ts +6 -6
  108. package/dist/_esm5.processed/utils/request/xhr.js +2 -1
  109. package/dist/_esm5.processed/utils/rx-from_cancellable_promise.d.ts +1 -2
  110. package/dist/rx-player.js +404 -321
  111. package/dist/rx-player.min.js +1 -1
  112. package/package.json +3 -4
  113. package/scripts/doc-generator/generate_header_html.js +6 -7
  114. package/scripts/doc-generator/generate_page_html.js +3 -4
  115. package/scripts/doc-generator/generate_page_list_html.js +4 -5
  116. package/scripts/doc-generator/generate_sidebar_html.js +4 -7
  117. package/scripts/doc-generator/utils.js +0 -11
  118. package/scripts/generate_demo_list.js +3 -3
  119. package/scripts/generate_documentation_list.js +3 -3
  120. package/scripts/launch_static_server.js +127 -67
  121. package/scripts/run_standalone_demo.js +1 -0
  122. package/scripts/start_demo_web_server.js +1 -0
  123. package/sonar-project.properties +1 -1
  124. package/src/compat/__tests__/fullscreen.test.ts +7 -7
  125. package/src/compat/__tests__/is_vtt_cue.test.ts +1 -1
  126. package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +1 -1
  127. package/src/compat/eme/custom_media_keys/index.ts +7 -3
  128. package/src/core/abr/__tests__/{get_estimate_from_buffer_levels.test.ts → buffer_based_chooser.test.ts} +94 -123
  129. package/src/core/abr/buffer_based_chooser.ts +85 -20
  130. package/src/core/abr/network_analyzer.ts +1 -1
  131. package/src/core/abr/pending_requests_store.ts +3 -5
  132. package/src/core/abr/representation_estimator.ts +6 -3
  133. package/src/core/api/media_element_track_choice_manager.ts +22 -3
  134. package/src/core/api/public_api.ts +6 -6
  135. package/src/core/api/track_choice_manager.ts +10 -9
  136. package/src/core/eme/__tests__/__global__/utils.ts +5 -10
  137. package/src/core/eme/find_key_system.ts +14 -12
  138. package/src/core/eme/types.ts +2 -2
  139. package/src/core/fetchers/manifest/manifest_fetcher.ts +5 -5
  140. package/src/core/fetchers/segment/segment_fetcher.ts +6 -3
  141. package/src/core/fetchers/utils/try_urls_with_backoff.ts +1 -1
  142. package/src/core/init/initialize_directfile.ts +2 -2
  143. package/src/core/init/initialize_media_source.ts +2 -2
  144. package/src/core/init/manifest_update_scheduler.ts +7 -7
  145. package/src/core/init/stream_events_emitter/are_same_stream_events.ts +4 -4
  146. package/src/core/init/stream_events_emitter/types.ts +2 -2
  147. package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +3 -3
  148. package/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +32 -31
  149. package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +4 -4
  150. package/src/core/stream/representation/force_garbage_collection.ts +3 -5
  151. package/src/errors/request_error.ts +4 -1
  152. package/src/experimental/tools/VideoThumbnailLoader/thumbnail_loader.ts +3 -6
  153. package/src/experimental/tools/mediaCapabilitiesProber/api/index.ts +1 -1
  154. package/src/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.ts +3 -3
  155. package/src/experimental/tools/mediaCapabilitiesProber/types.ts +3 -3
  156. package/src/manifest/adaptation.ts +6 -4
  157. package/src/manifest/manifest.ts +10 -10
  158. package/src/manifest/period.ts +3 -3
  159. package/src/manifest/representation.ts +2 -2
  160. package/src/manifest/representation_index/types.ts +18 -18
  161. package/src/manifest/types.ts +3 -3
  162. package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +1 -0
  163. package/src/parsers/manifest/dash/common/get_hdr_information.ts +1 -1
  164. package/src/parsers/manifest/dash/common/get_periods_time_infos.ts +3 -3
  165. package/src/parsers/manifest/dash/common/indexes/base.ts +6 -6
  166. package/src/parsers/manifest/dash/common/indexes/get_init_segment.ts +4 -2
  167. package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +2 -2
  168. package/src/parsers/manifest/dash/common/indexes/list.ts +14 -14
  169. package/src/parsers/manifest/dash/common/indexes/template.ts +17 -16
  170. package/src/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.ts +1 -1
  171. package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +50 -22
  172. package/src/parsers/manifest/dash/common/infer_adaptation_type.ts +2 -2
  173. package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +1 -1
  174. package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +58 -70
  175. package/src/parsers/manifest/dash/common/parse_mpd.ts +8 -8
  176. package/src/parsers/manifest/dash/common/parse_periods.ts +80 -79
  177. package/src/parsers/manifest/dash/common/parse_representation_index.ts +83 -75
  178. package/src/parsers/manifest/dash/common/parse_representations.ts +44 -63
  179. package/src/parsers/manifest/dash/node_parser_types.ts +30 -30
  180. package/src/parsers/manifest/dash/parsers_types.ts +3 -3
  181. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -1
  182. package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +4 -4
  183. package/src/parsers/manifest/smooth/create_parser.ts +23 -21
  184. package/src/parsers/manifest/smooth/representation_index.ts +14 -14
  185. package/src/parsers/manifest/types.ts +28 -28
  186. package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +31 -33
  187. package/src/parsers/manifest/utils/clear_timeline_from_position.ts +15 -6
  188. package/src/parsers/manifest/utils/index_helpers.ts +2 -2
  189. package/src/parsers/manifest/utils/update_segment_timeline.ts +32 -21
  190. package/src/parsers/texttracks/webvtt/html/to_html.ts +2 -2
  191. package/src/parsers/texttracks/webvtt/parse_cue_block.ts +1 -1
  192. package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +2 -2
  193. package/src/transports/dash/image_pipelines.ts +1 -1
  194. package/src/transports/dash/init_segment_loader.ts +1 -1
  195. package/src/transports/dash/manifest_parser.ts +1 -1
  196. package/src/transports/dash/segment_loader.ts +7 -7
  197. package/src/transports/dash/segment_parser.ts +3 -1
  198. package/src/transports/dash/text_loader.ts +2 -2
  199. package/src/transports/dash/text_parser.ts +3 -1
  200. package/src/transports/local/segment_loader.ts +4 -4
  201. package/src/transports/metaplaylist/manifest_loader.ts +1 -1
  202. package/src/transports/metaplaylist/pipelines.ts +1 -1
  203. package/src/transports/smooth/pipelines.ts +7 -7
  204. package/src/transports/smooth/segment_loader.ts +8 -8
  205. package/src/transports/types.ts +37 -30
  206. package/src/transports/utils/call_custom_manifest_loader.ts +6 -6
  207. package/src/transports/utils/generate_manifest_loader.ts +1 -1
  208. package/src/utils/__tests__/flat_map.test.ts +12 -7
  209. package/src/utils/cancellable_sleep.ts +1 -1
  210. package/src/utils/cast_to_observable.ts +1 -2
  211. package/src/utils/request/fetch.ts +16 -13
  212. package/src/utils/request/xhr.ts +9 -7
  213. package/src/utils/rx-from_cancellable_promise.ts +1 -2
  214. package/tsconfig.json +1 -2
  215. package/tsconfig.modules.json +1 -2
  216. package/dist/_esm5.processed/core/abr/get_estimate_from_buffer_levels.d.ts +0 -29
  217. package/dist/_esm5.processed/core/abr/get_estimate_from_buffer_levels.js +0 -67
  218. package/src/core/abr/get_estimate_from_buffer_levels.ts +0 -85
@@ -127,7 +127,7 @@ const mediaCapabilitiesProber = {
127
127
  }>
128
128
  ) : Promise<ICompatibleKeySystem[]> {
129
129
  const promises: Array<Promise<{ globalStatus: ProberStatus;
130
- result? : ICompatibleKeySystem; }>> = [];
130
+ result? : ICompatibleKeySystem | undefined; }>> = [];
131
131
  configurations.forEach((configuration) => {
132
132
  const globalConfig = {
133
133
  keySystem: configuration,
@@ -36,7 +36,7 @@ export interface IProbedMediaConfiguration {
36
36
  globalStatus: ProberStatus;
37
37
  resultsFromAPIS: Array<{
38
38
  APIName: ICapabilitiesTypes;
39
- result?: IResultsFromAPI;
39
+ result?: IResultsFromAPI | undefined;
40
40
  }>;
41
41
  }
42
42
 
@@ -63,7 +63,7 @@ function probeMediaConfiguration(
63
63
  let globalStatus : ProberStatus|undefined;
64
64
  const resultsFromAPIS: Array<{
65
65
  APIName: ICapabilitiesTypes;
66
- result?: IResultsFromAPI;
66
+ result: IResultsFromAPI | undefined;
67
67
  }> = [];
68
68
  const promises = [];
69
69
  for (const browserAPI of browserAPIS) {
@@ -103,7 +103,7 @@ function probeMediaConfiguration(
103
103
  }
104
104
 
105
105
  return PPromise.all(promises).then(() => {
106
- if (globalStatus == null) {
106
+ if (globalStatus === undefined) {
107
107
  globalStatus = ProberStatus.Unknown;
108
108
  }
109
109
 
@@ -52,9 +52,9 @@ export interface IDisplayConfiguration {
52
52
  }
53
53
 
54
54
  export interface IMediaConfiguration {
55
- type?: "media-source"|"file";
56
- video?: IVideoConfiguration;
57
- audio?: IAudioConfiguration;
55
+ type?: "media-source" | "file" | undefined;
56
+ video?: IVideoConfiguration | undefined;
57
+ audio?: IAudioConfiguration | undefined;
58
58
  keySystem?: IKeySystem;
59
59
  hdcp?: string;
60
60
  display?: IDisplayConfiguration;
@@ -109,16 +109,18 @@ export default class Adaptation {
109
109
  * @param {Object|undefined} [options]
110
110
  */
111
111
  constructor(parsedAdaptation : IParsedAdaptation, options : {
112
- representationFilter? : IRepresentationFilter;
113
- isManuallyAdded? : boolean;
112
+ representationFilter? : IRepresentationFilter | undefined;
113
+ isManuallyAdded? : boolean | undefined;
114
114
  } = {}) {
115
115
  const { trickModeTracks } = parsedAdaptation;
116
116
  const { representationFilter, isManuallyAdded } = options;
117
117
  this.id = parsedAdaptation.id;
118
- this.isTrickModeTrack = parsedAdaptation.isTrickModeTrack;
119
-
120
118
  this.type = parsedAdaptation.type;
121
119
 
120
+ if (parsedAdaptation.isTrickModeTrack !== undefined) {
121
+ this.isTrickModeTrack = parsedAdaptation.isTrickModeTrack;
122
+ }
123
+
122
124
  if (parsedAdaptation.language !== undefined) {
123
125
  this.language = parsedAdaptation.language;
124
126
  this.normalizedLanguage = normalizeLanguage(parsedAdaptation.language);
@@ -83,18 +83,18 @@ interface ISupplementaryTextTrack {
83
83
  interface IManifestParsingOptions {
84
84
  /* eslint-disable import/no-deprecated */
85
85
  /** Text tracks to add manually to the Manifest instance. */
86
- supplementaryTextTracks? : ISupplementaryTextTrack[];
86
+ supplementaryTextTracks? : ISupplementaryTextTrack[] | undefined;
87
87
  /** Image tracks to add manually to the Manifest instance. */
88
- supplementaryImageTracks? : ISupplementaryImageTrack[];
88
+ supplementaryImageTracks? : ISupplementaryImageTrack[] | undefined;
89
89
  /* eslint-enable import/no-deprecated */
90
90
  /** External callback peforming an automatic filtering of wanted Representations. */
91
- representationFilter? : IRepresentationFilter;
91
+ representationFilter? : IRepresentationFilter | undefined;
92
92
  /** Optional URL that points to a shorter version of the Manifest used
93
93
  * for updates only. When using this URL for refresh, the manifest will be
94
94
  * updated with the partial update type. If this URL is undefined, then the
95
95
  * manifest will be updated fully when it needs to be refreshed, and it will
96
96
  * fetched through the original URL. */
97
- manifestUpdateUrl? : string;
97
+ manifestUpdateUrl? : string | undefined;
98
98
  }
99
99
 
100
100
  /** Representation affected by a `decipherabilityUpdate` event. */
@@ -197,7 +197,7 @@ export default class Manifest extends EventEmitter<IManifestEvents> {
197
197
 
198
198
  /** Optional URL that points to a shorter version of the Manifest used
199
199
  * for updates only. */
200
- public updateUrl?: string;
200
+ public updateUrl : string | undefined;
201
201
 
202
202
  /**
203
203
  * Suggested delay from the "live edge" (i.e. the position corresponding to
@@ -205,7 +205,7 @@ export default class Manifest extends EventEmitter<IManifestEvents> {
205
205
  * from.
206
206
  * This only applies to live contents.
207
207
  */
208
- public suggestedPresentationDelay? : number;
208
+ public suggestedPresentationDelay : number | undefined;
209
209
 
210
210
  /**
211
211
  * Amount of time, in seconds, this Manifest is valid from the time when it
@@ -213,7 +213,7 @@ export default class Manifest extends EventEmitter<IManifestEvents> {
213
213
  * If no lifetime is set, this Manifest does not become invalid after an
214
214
  * amount of time.
215
215
  */
216
- public lifetime? : number;
216
+ public lifetime : number | undefined;
217
217
 
218
218
  /**
219
219
  * Minimum time, in seconds, at which a segment defined in the Manifest
@@ -221,14 +221,14 @@ export default class Manifest extends EventEmitter<IManifestEvents> {
221
221
  * This is also used as an offset for live content to apply to a segment's
222
222
  * time.
223
223
  */
224
- public availabilityStartTime? : number;
224
+ public availabilityStartTime : number | undefined;
225
225
 
226
226
  /**
227
227
  * It specifies the wall-clock time when the manifest was generated and published
228
228
  * at the origin server. It is present in order to identify different versions
229
229
  * of manifest instances.
230
230
  */
231
- public publishTime?: number;
231
+ public publishTime: number | undefined;
232
232
 
233
233
  /**
234
234
  * Array containing every minor errors that happened when the Manifest has
@@ -271,7 +271,7 @@ export default class Manifest extends EventEmitter<IManifestEvents> {
271
271
  * segment, and `timeshiftDepth` would be the whole depth that will
272
272
  * become available once enough segments have been generated.
273
273
  */
274
- absoluteMinimumTime? : number;
274
+ absoluteMinimumTime? : number | undefined;
275
275
  /**
276
276
  * Some dynamic contents have the concept of a "window depth" (or "buffer
277
277
  * depth") which allows to set a minimum position for all reachable
@@ -50,13 +50,13 @@ export default class Period {
50
50
  * Duration of this Period, in seconds.
51
51
  * `undefined` for still-running Periods.
52
52
  */
53
- public duration? : number;
53
+ public duration : number | undefined;
54
54
 
55
55
  /**
56
56
  * Absolute end time of the Period, in seconds.
57
57
  * `undefined` for still-running Periods.
58
58
  */
59
- public end? : number;
59
+ public end : number | undefined;
60
60
 
61
61
  /**
62
62
  * Array containing every errors that happened when the Period has been
@@ -74,7 +74,7 @@ export default class Period {
74
74
  */
75
75
  constructor(
76
76
  args : IParsedPeriod,
77
- representationFilter? : IRepresentationFilter
77
+ representationFilter? : IRepresentationFilter | undefined
78
78
  ) {
79
79
  this.contentWarnings = [];
80
80
  this.id = args.id;
@@ -55,7 +55,7 @@ class Representation {
55
55
  * A string describing the codec used for this Representation.
56
56
  * undefined if we do not know.
57
57
  */
58
- public codec? : string;
58
+ public codec : string | undefined;
59
59
 
60
60
  /**
61
61
  * A string describing the mime-type for this Representation.
@@ -93,7 +93,7 @@ class Representation {
93
93
  * Representation
94
94
  * - if `undefined` there is no certainty on this matter
95
95
  */
96
- public decipherable? : boolean;
96
+ public decipherable? : boolean | undefined;
97
97
 
98
98
  /** `true` if the Representation is in a supported codec, false otherwise. */
99
99
  public isSupported : boolean;
@@ -38,12 +38,12 @@ export interface ISmoothInitSegmentPrivateInfos {
38
38
  * as found in the Manifest.
39
39
  */
40
40
  timescale : number;
41
- codecPrivateData? : string;
42
- bitsPerSample? : number;
43
- channels? : number;
44
- packetSize? : number;
45
- samplingRate? : number;
46
- protection? : { keyId : Uint8Array };
41
+ codecPrivateData? : string | undefined;
42
+ bitsPerSample? : number | undefined;
43
+ channels? : number | undefined;
44
+ packetSize? : number | undefined;
45
+ samplingRate? : number | undefined;
46
+ protection? : { keyId : Uint8Array } | undefined;
47
47
  }
48
48
 
49
49
  /**
@@ -78,7 +78,7 @@ export interface IMetaPlaylistPrivateInfos {
78
78
  /** The segment originally created by this transport's RepresentationIndex. */
79
79
  originalSegment : ISegment;
80
80
  contentStart : number;
81
- contentEnd? : number;
81
+ contentEnd? : number | undefined;
82
82
  }
83
83
 
84
84
  /**
@@ -112,12 +112,12 @@ export interface ILocalManifestSegmentPrivateInfos {
112
112
  * exploited by the corresponding transport logic.
113
113
  */
114
114
  export interface IPrivateInfos {
115
- smoothInitSegment? : ISmoothInitSegmentPrivateInfos;
116
- smoothMediaSegment? : ISmoothSegmentPrivateInfos;
117
- metaplaylistInfos? : IMetaPlaylistPrivateInfos;
118
- localManifestInitSegment? : ILocalManifestInitSegmentPrivateInfos;
119
- localManifestSegment? : ILocalManifestSegmentPrivateInfos;
120
- isEMSGWhitelisted? : (evt: IEMSG) => boolean;
115
+ smoothInitSegment? : ISmoothInitSegmentPrivateInfos | undefined;
116
+ smoothMediaSegment? : ISmoothSegmentPrivateInfos | undefined;
117
+ metaplaylistInfos? : IMetaPlaylistPrivateInfos | undefined;
118
+ localManifestInitSegment? : ILocalManifestInitSegmentPrivateInfos | undefined;
119
+ localManifestSegment? : ILocalManifestSegmentPrivateInfos | undefined;
120
+ isEMSGWhitelisted? : ((evt: IEMSG) => boolean) | undefined;
121
121
  }
122
122
 
123
123
  /** Represent a single Segment from a Representation. */
@@ -149,24 +149,24 @@ export interface ISegment {
149
149
  * contain an index describing other Segments
150
150
  * TODO put in privateInfos?
151
151
  */
152
- indexRange? : [number, number];
152
+ indexRange? : [number, number] | undefined;
153
153
  /**
154
154
  * Optional number of the Segment
155
155
  * TODO put in privateInfos?
156
156
  */
157
- number? : number;
157
+ number? : number | undefined;
158
158
  /**
159
159
  * Allows to store supplementary information on a segment that can be later
160
160
  * exploited by the transport logic.
161
161
  */
162
- privateInfos? : IPrivateInfos;
162
+ privateInfos? : IPrivateInfos | undefined;
163
163
  /** Optional byte range to retrieve the Segment from its URL(s) */
164
- range? : [number, number];
164
+ range? : [number, number] | undefined;
165
165
  /**
166
166
  * Estimated time, in seconds, at which the concerned segment should be
167
167
  * offseted when decoded.
168
168
  */
169
- timestampOffset? : number;
169
+ timestampOffset? : number | undefined;
170
170
  /**
171
171
  * Estimated start time for the segment, in seconds.
172
172
  * Note that some rounding errors and some differences between what the
@@ -39,7 +39,7 @@ export interface IHDRInformation {
39
39
  * It is used to ask to the user agent if the color depth is supported by the
40
40
  * output device.
41
41
  */
42
- colorDepth?: number;
42
+ colorDepth? : number | undefined;
43
43
  /**
44
44
  * It is the HDR eotf. It is the transfer function having the video signal as
45
45
  * input and converting it into the linear light output of the display. The
@@ -47,14 +47,14 @@ export interface IHDRInformation {
47
47
  *
48
48
  * It may be used here to ask the MediaSource if it supported.
49
49
  */
50
- eotf?: string;
50
+ eotf? : string | undefined;
51
51
  /**
52
52
  * It is the video color space used for encoding. An HDR content may not have
53
53
  * a wide color gamut.
54
54
  *
55
55
  * It may be used to ask about output device color space support.
56
56
  */
57
- colorSpace?: string;
57
+ colorSpace? : string | undefined;
58
58
  }
59
59
 
60
60
  /** Manifest, as documented in the API documentation. */
@@ -46,6 +46,7 @@ describe("DASH parsers - ManifestBoundsCalculator", () => {
46
46
  /* eslint-enable max-len */
47
47
  const manifestBoundsCalculator = new ManifestBoundsCalculator({
48
48
  isDynamic: false,
49
+ timeShiftBufferDepth: undefined,
49
50
  });
50
51
  expect(manifestBoundsCalculator.estimateMinimumBound()).toEqual(0);
51
52
  expect(manifestBoundsCalculator.estimateMinimumBound()).toEqual(0);
@@ -39,7 +39,7 @@ export interface IParsedWEBMHDRInformation {
39
39
  *
40
40
  * It may be used to ask about output device color space support.
41
41
  */
42
- colorSpace?: "rec2020";
42
+ colorSpace: "rec2020" | undefined;
43
43
  }
44
44
 
45
45
  /**
@@ -21,9 +21,9 @@ interface IPeriodTimeInformation {
21
21
  /** Time in seconds at which the Period starts. */
22
22
  periodStart: number;
23
23
  /** Difference in seconds between the Period's end and its start. */
24
- periodDuration?: number;
24
+ periodDuration?: number | undefined;
25
25
  /** Time in seconds at which the Period ends. */
26
- periodEnd?: number;
26
+ periodEnd?: number | undefined;
27
27
  }
28
28
 
29
29
  /** Additionnal context needed to retrieve the period time information. */
@@ -31,7 +31,7 @@ export interface IParsedPeriodsContext {
31
31
  /** Value of MPD@availabilityStartTime. */
32
32
  availabilityStartTime : number;
33
33
  /** Value of MPD@mediaPresentationDuration. */
34
- duration? : number;
34
+ duration? : number | undefined;
35
35
  /** `true` if MPD@type is equal to "dynamic". */
36
36
  isDynamic : boolean;
37
37
  }
@@ -38,7 +38,7 @@ import { createIndexURLs } from "./tokens";
38
38
  */
39
39
  export interface IBaseIndex {
40
40
  /** Byte range for a possible index of segments in the server. */
41
- indexRange?: [number, number];
41
+ indexRange?: [number, number] | undefined;
42
42
  /**
43
43
  * Temporal offset, in the current timescale (see timescale), to add to the
44
44
  * presentation time (time a segment has at decoding time) to obtain the
@@ -57,15 +57,15 @@ export interface IBaseIndex {
57
57
  /** URLs to access the initialization segment. */
58
58
  mediaURLs: string[] | null;
59
59
  /** possible byte range to request it. */
60
- range?: [number, number];
61
- };
60
+ range?: [number, number] | undefined;
61
+ } | undefined;
62
62
  /**
63
63
  * Base URL(s) to access any segment. Can contain tokens to replace to convert
64
64
  * it to real URLs.
65
65
  */
66
66
  mediaURLs : string[] | null;
67
67
  /** Number from which the first segments in this index starts with. */
68
- startNumber? : number;
68
+ startNumber? : number | undefined;
69
69
  /** Every segments defined in this index. */
70
70
  timeline : IIndexSegment[];
71
71
  /**
@@ -113,9 +113,9 @@ export interface IBaseIndexContextArgument {
113
113
  /** Base URL for the Representation concerned. */
114
114
  representationBaseURLs : IResolvedBaseUrl[];
115
115
  /** ID of the Representation concerned. */
116
- representationId? : string;
116
+ representationId? : string | undefined;
117
117
  /** Bitrate of the Representation concerned. */
118
- representationBitrate? : number;
118
+ representationBitrate? : number | undefined;
119
119
  /* Function that tells if an EMSG is whitelisted by the manifest */
120
120
  isEMSGWhitelisted: (inbandEvent: IEMSG) => boolean;
121
121
  }
@@ -25,8 +25,10 @@ import { IEMSG } from "../../../../containers/isobmff";
25
25
  */
26
26
  export default function getInitSegment(
27
27
  index: { timescale: number;
28
- initialization?: { mediaURLs: string[] | null; range?: [number, number] };
29
- indexRange?: [number, number];
28
+ initialization?: { mediaURLs: string[] | null;
29
+ range?: [number, number] | undefined; } |
30
+ undefined;
31
+ indexRange?: [number, number] | undefined;
30
32
  indexTimeOffset : number; },
31
33
  isEMSGWhitelisted?: (inbandEvent: IEMSG) => boolean
32
34
  ) : ISegment {
@@ -52,9 +52,9 @@ function getWantedRepeatIndex(
52
52
  * @returns {Array.<Object>}
53
53
  */
54
54
  export default function getSegmentsFromTimeline(
55
- index : { availabilityTimeComplete? : boolean;
55
+ index : { availabilityTimeComplete? : boolean | undefined;
56
56
  mediaURLs : string[] | null;
57
- startNumber? : number;
57
+ startNumber? : number | undefined;
58
58
  timeline : IIndexSegment[];
59
59
  timescale : number;
60
60
  indexTimeOffset : number; },
@@ -37,7 +37,7 @@ export interface IListIndex {
37
37
  */
38
38
  duration : number;
39
39
  /** Byte range for a possible index of segments in the server. */
40
- indexRange?: [number, number];
40
+ indexRange?: [number, number] | undefined;
41
41
  /**
42
42
  * Temporal offset, in the current timescale (see timescale), to add to the
43
43
  * presentation time (time a segment has at decoding time) to obtain the
@@ -56,14 +56,14 @@ export interface IListIndex {
56
56
  /** URLs to access the initialization segment. */
57
57
  mediaURLs: string[] | null;
58
58
  /** possible byte range to request it. */
59
- range?: [number, number];
60
- };
59
+ range?: [number, number] | undefined;
60
+ } | undefined;
61
61
  /** Information on the list of segments for this index. */
62
62
  list: Array<{
63
63
  /** URLs of the segment. */
64
64
  mediaURLs : string[] | null;
65
65
  /** Possible byte-range of the segment. */
66
- mediaRange? : [number, number];
66
+ mediaRange? : [number, number] | undefined;
67
67
  }>;
68
68
  /**
69
69
  * Timescale to convert a time given here into seconds.
@@ -78,12 +78,12 @@ export interface IListIndex {
78
78
  * Most of the properties here are already defined in IListIndex.
79
79
  */
80
80
  export interface IListIndexIndexArgument {
81
- duration? : number;
82
- indexRange?: [number, number];
83
- initialization?: { media? : string;
84
- range? : [number, number]; };
85
- list: Array<{ media? : string;
86
- mediaRange? : [number, number]; }>;
81
+ duration? : number | undefined;
82
+ indexRange?: [number, number] | undefined;
83
+ initialization?: { media? : string | undefined;
84
+ range? : [number, number] | undefined; };
85
+ list: Array<{ media? : string | undefined;
86
+ mediaRange? : [number, number] | undefined; }>;
87
87
  /**
88
88
  * Offset present in the index to convert from the mediaTime (time declared in
89
89
  * the media segments and in this index) to the presentationTime (time wanted
@@ -98,8 +98,8 @@ export interface IListIndexIndexArgument {
98
98
  * The time given here is in the current
99
99
  * timescale (see timescale)
100
100
  */
101
- presentationTimeOffset? : number;
102
- timescale? : number;
101
+ presentationTimeOffset? : number | undefined;
102
+ timescale? : number | undefined;
103
103
  }
104
104
 
105
105
  /** Aditional context needed by a SegmentList RepresentationIndex. */
@@ -109,9 +109,9 @@ export interface IListIndexContextArgument {
109
109
  /** Base URL for the Representation concerned. */
110
110
  representationBaseURLs : IResolvedBaseUrl[];
111
111
  /** ID of the Representation concerned. */
112
- representationId? : string;
112
+ representationId? : string | undefined;
113
113
  /** Bitrate of the Representation concerned. */
114
- representationBitrate? : number;
114
+ representationBitrate? : number | undefined;
115
115
  /* Function that tells if an EMSG is whitelisted by the manifest */
116
116
  isEMSGWhitelisted: (inbandEvent: IEMSG) => boolean;
117
117
  }
@@ -49,14 +49,14 @@ export interface ITemplateIndex {
49
49
  */
50
50
  timescale : number;
51
51
  /** Byte range for a possible index of segments in the server. */
52
- indexRange?: [number, number];
52
+ indexRange?: [number, number] | undefined;
53
53
  /** Information on the initialization segment. */
54
54
  initialization? : {
55
55
  /** URLs to access the initialization segment. */
56
56
  mediaURLs: string[] | null;
57
57
  /** possible byte range to request it. */
58
- range?: [number, number];
59
- };
58
+ range?: [number, number] | undefined;
59
+ } | undefined;
60
60
  /**
61
61
  * URL base to access any segment.
62
62
  * Can contain token to replace to convert it to real URLs.
@@ -91,7 +91,7 @@ export interface ITemplateIndex {
91
91
  */
92
92
  presentationTimeOffset : number;
93
93
  /** Number from which the first segments in this index starts with. */
94
- startNumber? : number;
94
+ startNumber? : number | undefined;
95
95
  }
96
96
 
97
97
  /**
@@ -99,14 +99,15 @@ export interface ITemplateIndex {
99
99
  * Most of the properties here are already defined in ITemplateIndex.
100
100
  */
101
101
  export interface ITemplateIndexIndexArgument {
102
- duration? : number;
103
- indexRange?: [number, number];
104
- initialization?: { media? : string;
105
- range? : [number, number]; };
106
- media? : string;
107
- presentationTimeOffset? : number;
108
- startNumber? : number;
109
- timescale? : number;
102
+ duration? : number | undefined;
103
+ indexRange?: [number, number] | undefined;
104
+ initialization?: { media? : string | undefined;
105
+ range? : [number, number] | undefined; } |
106
+ undefined;
107
+ media? : string | undefined;
108
+ presentationTimeOffset? : number | undefined;
109
+ startNumber? : number | undefined;
110
+ timescale? : number | undefined;
110
111
  }
111
112
 
112
113
  /** Aditional context needed by a SegmentTemplate RepresentationIndex. */
@@ -125,9 +126,9 @@ export interface ITemplateIndexContextArgument {
125
126
  /** Base URL for the Representation concerned. */
126
127
  representationBaseURLs : IResolvedBaseUrl[];
127
128
  /** ID of the Representation concerned. */
128
- representationId? : string;
129
+ representationId? : string | undefined;
129
130
  /** Bitrate of the Representation concerned. */
130
- representationBitrate? : number;
131
+ representationBitrate? : number | undefined;
131
132
  /* Function that tells if an EMSG is whitelisted by the manifest */
132
133
  isEMSGWhitelisted: (inbandEvent: IEMSG) => boolean;
133
134
  }
@@ -150,9 +151,9 @@ export default class TemplateRepresentationIndex implements IRepresentationIndex
150
151
  /** Absolute start of the Period, in seconds. */
151
152
  private _periodStart : number;
152
153
  /** Difference between the end time of the Period and its start time, in timescale. */
153
- private _scaledPeriodEnd? : number;
154
+ private _scaledPeriodEnd : number | undefined;
154
155
  /** Minimum availabilityTimeOffset concerning the segments of this Representation. */
155
- private _availabilityTimeOffset? : number;
156
+ private _availabilityTimeOffset : number | undefined;
156
157
  /** Whether the corresponding Manifest can be updated and changed. */
157
158
  private _isDynamic : boolean;
158
159
  /* Function that tells if an EMSG is whitelisted by the manifest */
@@ -52,7 +52,7 @@ export default function constructTimelineFromElements(
52
52
  previousItem,
53
53
  nextItem,
54
54
  scaledPeriodStart);
55
- if (timelineElement != null) {
55
+ if (timelineElement !== null) {
56
56
  timeline.push(timelineElement);
57
57
  }
58
58
  }