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
@@ -25,8 +25,8 @@ export default function getInitSegment(index: {
25
25
  timescale: number;
26
26
  initialization?: {
27
27
  mediaURLs: string[] | null;
28
- range?: [number, number];
29
- };
30
- indexRange?: [number, number];
28
+ range?: [number, number] | undefined;
29
+ } | undefined;
30
+ indexRange?: [number, number] | undefined;
31
31
  indexTimeOffset: number;
32
32
  }, isEMSGWhitelisted?: (inbandEvent: IEMSG) => boolean): ISegment;
@@ -26,9 +26,9 @@ import { IIndexSegment } from "../../../utils/index_helpers";
26
26
  * @returns {Array.<Object>}
27
27
  */
28
28
  export default function getSegmentsFromTimeline(index: {
29
- availabilityTimeComplete?: boolean;
29
+ availabilityTimeComplete?: boolean | undefined;
30
30
  mediaURLs: string[] | null;
31
- startNumber?: number;
31
+ startNumber?: number | undefined;
32
32
  timeline: IIndexSegment[];
33
33
  timescale: number;
34
34
  indexTimeOffset: number;
@@ -13,7 +13,7 @@ export interface IListIndex {
13
13
  */
14
14
  duration: number;
15
15
  /** Byte range for a possible index of segments in the server. */
16
- indexRange?: [number, number];
16
+ indexRange?: [number, number] | undefined;
17
17
  /**
18
18
  * Temporal offset, in the current timescale (see timescale), to add to the
19
19
  * presentation time (time a segment has at decoding time) to obtain the
@@ -32,14 +32,14 @@ export interface IListIndex {
32
32
  /** URLs to access the initialization segment. */
33
33
  mediaURLs: string[] | null;
34
34
  /** possible byte range to request it. */
35
- range?: [number, number];
36
- };
35
+ range?: [number, number] | undefined;
36
+ } | undefined;
37
37
  /** Information on the list of segments for this index. */
38
38
  list: Array<{
39
39
  /** URLs of the segment. */
40
40
  mediaURLs: string[] | null;
41
41
  /** Possible byte-range of the segment. */
42
- mediaRange?: [number, number];
42
+ mediaRange?: [number, number] | undefined;
43
43
  }>;
44
44
  /**
45
45
  * Timescale to convert a time given here into seconds.
@@ -53,15 +53,15 @@ export interface IListIndex {
53
53
  * Most of the properties here are already defined in IListIndex.
54
54
  */
55
55
  export interface IListIndexIndexArgument {
56
- duration?: number;
57
- indexRange?: [number, number];
56
+ duration?: number | undefined;
57
+ indexRange?: [number, number] | undefined;
58
58
  initialization?: {
59
- media?: string;
60
- range?: [number, number];
59
+ media?: string | undefined;
60
+ range?: [number, number] | undefined;
61
61
  };
62
62
  list: Array<{
63
- media?: string;
64
- mediaRange?: [number, number];
63
+ media?: string | undefined;
64
+ mediaRange?: [number, number] | undefined;
65
65
  }>;
66
66
  /**
67
67
  * Offset present in the index to convert from the mediaTime (time declared in
@@ -77,8 +77,8 @@ export interface IListIndexIndexArgument {
77
77
  * The time given here is in the current
78
78
  * timescale (see timescale)
79
79
  */
80
- presentationTimeOffset?: number;
81
- timescale?: number;
80
+ presentationTimeOffset?: number | undefined;
81
+ timescale?: number | undefined;
82
82
  }
83
83
  /** Aditional context needed by a SegmentList RepresentationIndex. */
84
84
  export interface IListIndexContextArgument {
@@ -87,9 +87,9 @@ export interface IListIndexContextArgument {
87
87
  /** Base URL for the Representation concerned. */
88
88
  representationBaseURLs: IResolvedBaseUrl[];
89
89
  /** ID of the Representation concerned. */
90
- representationId?: string;
90
+ representationId?: string | undefined;
91
91
  /** Bitrate of the Representation concerned. */
92
- representationBitrate?: number;
92
+ representationBitrate?: number | undefined;
93
93
  isEMSGWhitelisted: (inbandEvent: IEMSG) => boolean;
94
94
  }
95
95
  export default class ListRepresentationIndex implements IRepresentationIndex {
@@ -35,14 +35,14 @@ export interface ITemplateIndex {
35
35
  */
36
36
  timescale: number;
37
37
  /** Byte range for a possible index of segments in the server. */
38
- indexRange?: [number, number];
38
+ indexRange?: [number, number] | undefined;
39
39
  /** Information on the initialization segment. */
40
40
  initialization?: {
41
41
  /** URLs to access the initialization segment. */
42
42
  mediaURLs: string[] | null;
43
43
  /** possible byte range to request it. */
44
- range?: [number, number];
45
- };
44
+ range?: [number, number] | undefined;
45
+ } | undefined;
46
46
  /**
47
47
  * URL base to access any segment.
48
48
  * Can contain token to replace to convert it to real URLs.
@@ -77,23 +77,23 @@ export interface ITemplateIndex {
77
77
  */
78
78
  presentationTimeOffset: number;
79
79
  /** Number from which the first segments in this index starts with. */
80
- startNumber?: number;
80
+ startNumber?: number | undefined;
81
81
  }
82
82
  /**
83
83
  * `index` Argument for a SegmentTemplate RepresentationIndex.
84
84
  * Most of the properties here are already defined in ITemplateIndex.
85
85
  */
86
86
  export interface ITemplateIndexIndexArgument {
87
- duration?: number;
88
- indexRange?: [number, number];
87
+ duration?: number | undefined;
88
+ indexRange?: [number, number] | undefined;
89
89
  initialization?: {
90
- media?: string;
91
- range?: [number, number];
92
- };
93
- media?: string;
94
- presentationTimeOffset?: number;
95
- startNumber?: number;
96
- timescale?: number;
90
+ media?: string | undefined;
91
+ range?: [number, number] | undefined;
92
+ } | undefined;
93
+ media?: string | undefined;
94
+ presentationTimeOffset?: number | undefined;
95
+ startNumber?: number | undefined;
96
+ timescale?: number | undefined;
97
97
  }
98
98
  /** Aditional context needed by a SegmentTemplate RepresentationIndex. */
99
99
  export interface ITemplateIndexContextArgument {
@@ -111,9 +111,9 @@ export interface ITemplateIndexContextArgument {
111
111
  /** Base URL for the Representation concerned. */
112
112
  representationBaseURLs: IResolvedBaseUrl[];
113
113
  /** ID of the Representation concerned. */
114
- representationId?: string;
114
+ representationId?: string | undefined;
115
115
  /** Bitrate of the Representation concerned. */
116
- representationBitrate?: number;
116
+ representationBitrate?: number | undefined;
117
117
  isEMSGWhitelisted: (inbandEvent: IEMSG) => boolean;
118
118
  }
119
119
  /**
@@ -134,9 +134,9 @@ export default class TemplateRepresentationIndex implements IRepresentationIndex
134
134
  /** Absolute start of the Period, in seconds. */
135
135
  private _periodStart;
136
136
  /** Difference between the end time of the Period and its start time, in timescale. */
137
- private _scaledPeriodEnd?;
137
+ private _scaledPeriodEnd;
138
138
  /** Minimum availabilityTimeOffset concerning the segments of this Representation. */
139
- private _availabilityTimeOffset?;
139
+ private _availabilityTimeOffset;
140
140
  /** Whether the corresponding Manifest can be updated and changed. */
141
141
  private _isDynamic;
142
142
  private _isEMSGWhitelisted;
@@ -41,7 +41,7 @@ export default function constructTimelineFromElements(elements, scaledPeriodStar
41
41
  null :
42
42
  initialTimeline[i + 1];
43
43
  var timelineElement = convertElementsToIndexSegment(item, previousItem, nextItem, scaledPeriodStart);
44
- if (timelineElement != null) {
44
+ if (timelineElement !== null) {
45
45
  timeline.push(timelineElement);
46
46
  }
47
47
  }
@@ -29,7 +29,7 @@ export interface ITimelineIndex {
29
29
  /** If `false`, the last segment anounced might be still incomplete. */
30
30
  availabilityTimeComplete: boolean;
31
31
  /** Byte range for a possible index of segments in the server. */
32
- indexRange?: [number, number];
32
+ indexRange?: [number, number] | undefined;
33
33
  /**
34
34
  * Temporal offset, in the current timescale (see timescale), to add to the
35
35
  * presentation time (time a segment has at decoding time) to obtain the
@@ -48,15 +48,15 @@ export interface ITimelineIndex {
48
48
  /** URLs to access the initialization segment. */
49
49
  mediaURLs: string[] | null;
50
50
  /** possible byte range to request it. */
51
- range?: [number, number];
52
- };
51
+ range?: [number, number] | undefined;
52
+ } | undefined;
53
53
  /**
54
54
  * Base URL(s) to access any segment. Can contain tokens to replace to convert
55
55
  * it to real URLs.
56
56
  */
57
57
  mediaURLs: string[] | null;
58
58
  /** Number from which the first segments in this index starts with. */
59
- startNumber?: number;
59
+ startNumber?: number | undefined;
60
60
  /**
61
61
  * Every segments defined in this index.
62
62
  * `null` at the beginning as this property is parsed lazily (only when first
@@ -87,14 +87,14 @@ export interface ITimelineIndex {
87
87
  * Most of the properties here are already defined in ITimelineIndex.
88
88
  */
89
89
  export interface ITimelineIndexIndexArgument {
90
- indexRange?: [number, number];
90
+ indexRange?: [number, number] | undefined;
91
91
  initialization?: {
92
- media?: string;
93
- range?: [number, number];
94
- };
95
- media?: string;
96
- startNumber?: number;
97
- timescale?: number;
92
+ media?: string | undefined;
93
+ range?: [number, number] | undefined;
94
+ } | undefined;
95
+ media?: string | undefined;
96
+ startNumber?: number | undefined;
97
+ timescale?: number | undefined;
98
98
  /**
99
99
  * Offset present in the index to convert from the mediaTime (time declared in
100
100
  * the media segments and in this index) to the presentationTime (time wanted
@@ -109,9 +109,9 @@ export interface ITimelineIndexIndexArgument {
109
109
  * The time given here is in the current
110
110
  * timescale (see timescale)
111
111
  */
112
- presentationTimeOffset?: number;
113
- timelineParser?: () => HTMLCollection;
114
- timeline?: ISegmentTimelineElement[];
112
+ presentationTimeOffset?: number | undefined;
113
+ timelineParser?: (() => HTMLCollection) | undefined;
114
+ timeline?: ISegmentTimelineElement[] | undefined;
115
115
  }
116
116
  /** Aditional context needed by a SegmentTimeline RepresentationIndex. */
117
117
  export interface ITimelineIndexContextArgument {
@@ -119,9 +119,9 @@ export interface ITimelineIndexContextArgument {
119
119
  availabilityTimeComplete: boolean;
120
120
  /** Allows to obtain the minimum and maximum positions of a content. */
121
121
  manifestBoundsCalculator: ManifestBoundsCalculator;
122
- /** Start of the period concerned by this RepresentationIndex, in seconds. */
122
+ /** Start of the period linked to this RepresentationIndex, in seconds. */
123
123
  periodStart: number;
124
- /** End of the period concerned by this RepresentationIndex, in seconds. */
124
+ /** End of the period linked to this RepresentationIndex, in seconds. */
125
125
  periodEnd: number | undefined;
126
126
  /** Whether the corresponding Manifest can be updated and changed. */
127
127
  isDynamic: boolean;
@@ -129,13 +129,13 @@ export interface ITimelineIndexContextArgument {
129
129
  * Time (in terms of `performance.now`) at which the XML file containing this
130
130
  * index was received
131
131
  */
132
- receivedTime?: number;
132
+ receivedTime?: number | undefined;
133
133
  /** Base URL for the Representation concerned. */
134
134
  representationBaseURLs: IResolvedBaseUrl[];
135
135
  /** ID of the Representation concerned. */
136
- representationId?: string;
136
+ representationId?: string | undefined;
137
137
  /** Bitrate of the Representation concerned. */
138
- representationBitrate?: number;
138
+ representationBitrate?: number | undefined;
139
139
  /**
140
140
  * The parser should take this previous version of the
141
141
  * `TimelineRepresentationIndex` - which was from the same Representation
@@ -145,11 +145,17 @@ export interface ITimelineIndexContextArgument {
145
145
  * Use with moderation.
146
146
  */
147
147
  unsafelyBaseOnPreviousRepresentation: Representation | null;
148
+ /** Function that tells if an EMSG is whitelisted by the manifest */
148
149
  isEMSGWhitelisted: (inbandEvent: IEMSG) => boolean;
150
+ /**
151
+ * Set to `true` if the linked Period is the chronologically last one in the
152
+ * Manifest.
153
+ */
154
+ isLastPeriod: boolean;
149
155
  }
150
156
  export interface ILastSegmentInformation {
151
157
  /** End of the timeline on `time`, timescaled. */
152
- lastPosition?: number;
158
+ lastPosition?: number | undefined;
153
159
  /** Defines the time at which `lastPosition` was last calculated. */
154
160
  time: number;
155
161
  }
@@ -181,6 +187,8 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
181
187
  */
182
188
  private _unsafelyBaseOnPreviousIndex;
183
189
  private _isEMSGWhitelisted;
190
+ /** `true` if the linked Period is the chronologically last one in the Manifest. */
191
+ private _isLastPeriod;
184
192
  /**
185
193
  * @param {Object} index
186
194
  * @param {Object} context
@@ -39,7 +39,7 @@ var TimelineRepresentationIndex = /** @class */ (function () {
39
39
  throw new Error("The given index is not compatible with a " +
40
40
  "TimelineRepresentationIndex.");
41
41
  }
42
- var availabilityTimeComplete = context.availabilityTimeComplete, manifestBoundsCalculator = context.manifestBoundsCalculator, isDynamic = context.isDynamic, representationBaseURLs = context.representationBaseURLs, representationId = context.representationId, representationBitrate = context.representationBitrate, periodStart = context.periodStart, periodEnd = context.periodEnd, isEMSGWhitelisted = context.isEMSGWhitelisted;
42
+ var availabilityTimeComplete = context.availabilityTimeComplete, manifestBoundsCalculator = context.manifestBoundsCalculator, isDynamic = context.isDynamic, isLastPeriod = context.isLastPeriod, representationBaseURLs = context.representationBaseURLs, representationId = context.representationId, representationBitrate = context.representationBitrate, periodStart = context.periodStart, periodEnd = context.periodEnd, isEMSGWhitelisted = context.isEMSGWhitelisted;
43
43
  var timescale = (_a = index.timescale) !== null && _a !== void 0 ? _a : 1;
44
44
  var presentationTimeOffset = index.presentationTimeOffset != null ?
45
45
  index.presentationTimeOffset :
@@ -48,6 +48,7 @@ var TimelineRepresentationIndex = /** @class */ (function () {
48
48
  var indexTimeOffset = presentationTimeOffset - scaledStart;
49
49
  this._manifestBoundsCalculator = manifestBoundsCalculator;
50
50
  this._isEMSGWhitelisted = isEMSGWhitelisted;
51
+ this._isLastPeriod = isLastPeriod;
51
52
  this._lastUpdate = context.receivedTime == null ?
52
53
  performance.now() :
53
54
  context.receivedTime;
@@ -204,6 +205,7 @@ var TimelineRepresentationIndex = /** @class */ (function () {
204
205
  this._scaledPeriodEnd = newIndex._scaledPeriodEnd;
205
206
  this._lastUpdate = newIndex._lastUpdate;
206
207
  this._manifestBoundsCalculator = newIndex._manifestBoundsCalculator;
208
+ this._isLastPeriod = newIndex._isLastPeriod;
207
209
  };
208
210
  /**
209
211
  * Update this RepresentationIndex with a shorter version of it coming from a
@@ -217,11 +219,15 @@ var TimelineRepresentationIndex = /** @class */ (function () {
217
219
  if (newIndex._index.timeline === null) {
218
220
  newIndex._index.timeline = newIndex._getTimeline();
219
221
  }
220
- updateSegmentTimeline(this._index.timeline, newIndex._index.timeline);
222
+ var hasReplaced = updateSegmentTimeline(this._index.timeline, newIndex._index.timeline);
223
+ if (hasReplaced) {
224
+ this._index.startNumber = newIndex._index.startNumber;
225
+ }
221
226
  this._isDynamic = newIndex._isDynamic;
222
227
  this._scaledPeriodStart = newIndex._scaledPeriodStart;
223
228
  this._scaledPeriodEnd = newIndex._scaledPeriodEnd;
224
229
  this._lastUpdate = newIndex._lastUpdate;
230
+ this._isLastPeriod = newIndex._isLastPeriod;
225
231
  };
226
232
  /**
227
233
  * Returns `true` if this RepresentationIndex currently contains its last
@@ -230,7 +236,13 @@ var TimelineRepresentationIndex = /** @class */ (function () {
230
236
  * @returns {Boolean}
231
237
  */
232
238
  TimelineRepresentationIndex.prototype.isFinished = function () {
233
- if (!this._isDynamic) {
239
+ if (!this._isDynamic || !this._isLastPeriod) {
240
+ // Either the content is not dynamic, in which case no new segment will
241
+ // be generated, either it is but this index is not linked to the current
242
+ // last Period in the MPD, in which case it is inferred that it has been
243
+ // completely generated. Note that this second condition might break very
244
+ // very rare use cases where old Periods are still being generated, yet it
245
+ // should fix more cases than it breaks.
234
246
  return true;
235
247
  }
236
248
  if (this._index.timeline === null) {
@@ -273,7 +285,10 @@ var TimelineRepresentationIndex = /** @class */ (function () {
273
285
  return; // we don't know yet
274
286
  }
275
287
  var scaledFirstPosition = toIndexTime(firstPosition, this._index);
276
- clearTimelineFromPosition(this._index.timeline, scaledFirstPosition);
288
+ var nbEltsRemoved = clearTimelineFromPosition(this._index.timeline, scaledFirstPosition);
289
+ if (this._index.startNumber !== undefined) {
290
+ this._index.startNumber += nbEltsRemoved;
291
+ }
277
292
  };
278
293
  TimelineRepresentationIndex.getIndexEnd = function (timeline, scaledPeriodEnd) {
279
294
  if (timeline.length <= 0) {
@@ -18,8 +18,8 @@ import { IRepresentationIntermediateRepresentation } from "../node_parser_types"
18
18
  declare type IAdaptationType = "audio" | "video" | "text" | "image";
19
19
  /** Structure of a parsed "scheme-like" element in the MPD. */
20
20
  interface IScheme {
21
- schemeIdUri?: string;
22
- value?: string;
21
+ schemeIdUri?: string | undefined;
22
+ value?: string | undefined;
23
23
  }
24
24
  /**
25
25
  * Infers the type of adaptation from codec and mimetypes found in it.
@@ -46,7 +46,7 @@ export default class ManifestBoundsCalculator {
46
46
  * @param {Object} args
47
47
  */
48
48
  constructor(args: {
49
- timeShiftBufferDepth?: number;
49
+ timeShiftBufferDepth: number | undefined;
50
50
  isDynamic: boolean;
51
51
  });
52
52
  /**
@@ -16,35 +16,21 @@
16
16
  import { Period } from "../../../../manifest";
17
17
  import { IParsedAdaptations } from "../../types";
18
18
  import { IAdaptationSetIntermediateRepresentation, ISegmentTemplateIntermediateRepresentation } from "../node_parser_types";
19
- import ManifestBoundsCalculator from "./manifest_bounds_calculator";
20
- import { IResolvedBaseUrl } from "./resolve_base_urls";
19
+ import { IRepresentationContext } from "./parse_representations";
20
+ /**
21
+ * Process AdaptationSets intermediate representations to return under its final
22
+ * form.
23
+ * Note that the AdaptationSets returned are sorted by priority (from the most
24
+ * priority to the least one).
25
+ * @param {Array.<Object>} adaptationsIR
26
+ * @param {Object} context
27
+ * @returns {Array.<Object>}
28
+ */
29
+ export default function parseAdaptationSets(adaptationsIR: IAdaptationSetIntermediateRepresentation[], context: IAdaptationSetContext): IParsedAdaptations;
21
30
  /** Context needed when calling `parseAdaptationSets`. */
22
- export interface IAdaptationSetsContextInfos {
23
- /** Whether we should request new segments even if they are not yet finished. */
24
- aggressiveMode: boolean;
25
- availabilityTimeComplete: boolean;
26
- /** availabilityTimeOffset of the concerned period. */
27
- availabilityTimeOffset: number;
28
- /** Eventual URLs from which every relative URL will be based on. */
29
- baseURLs: IResolvedBaseUrl[];
30
- /** Allows to obtain the first available position of a content. */
31
- manifestBoundsCalculator: ManifestBoundsCalculator;
32
- end?: number;
33
- /** Whether the Manifest can evolve with time. */
34
- isDynamic: boolean;
35
- /** Manifest DASH profiles used for signaling some features */
36
- manifestProfiles?: string;
37
- /**
38
- * Time (in terms of `performance.now`) at which the XML file containing
39
- * this AdaptationSet was received.
40
- */
41
- receivedTime?: number;
31
+ export interface IAdaptationSetContext extends IInheritedRepresentationContext {
42
32
  /** SegmentTemplate parsed in the Period, if found. */
43
- segmentTemplate?: ISegmentTemplateIntermediateRepresentation;
44
- /** Start time of the current period, in seconds. */
45
- start: number;
46
- /** Depth of the buffer for the whole content, in seconds. */
47
- timeShiftBufferDepth?: number;
33
+ segmentTemplate?: ISegmentTemplateIntermediateRepresentation | undefined;
48
34
  /**
49
35
  * The parser should take this Period - which is from a previously parsed
50
36
  * Manifest for the same dynamic content - as a base to speed-up the parsing
@@ -56,12 +42,8 @@ export interface IAdaptationSetsContextInfos {
56
42
  unsafelyBaseOnPreviousPeriod: Period | null;
57
43
  }
58
44
  /**
59
- * Process AdaptationSets intermediate representations to return under its final
60
- * form.
61
- * Note that the AdaptationSets returned are sorted by priority (from the most
62
- * priority to the least one).
63
- * @param {Array.<Object>} adaptationsIR
64
- * @param {Object} periodInfos
65
- * @returns {Array.<Object>}
45
+ * Supplementary context needed to parse a Representation common with
46
+ * `IRepresentationContext`.
66
47
  */
67
- export default function parseAdaptationSets(adaptationsIR: IAdaptationSetIntermediateRepresentation[], periodInfos: IAdaptationSetsContextInfos): IParsedAdaptations;
48
+ declare type IInheritedRepresentationContext = Omit<IRepresentationContext, "unsafelyBaseOnPreviousAdaptation" | "parentSegmentTemplates">;
49
+ export {};
@@ -30,7 +30,7 @@ import resolveBaseURLs from "./resolve_base_urls";
30
30
  * @returns {Boolean}
31
31
  */
32
32
  function isVisuallyImpaired(accessibility) {
33
- if (accessibility == null) {
33
+ if (accessibility === undefined) {
34
34
  return false;
35
35
  }
36
36
  var isVisuallyImpairedAudioDvbDash = (accessibility.schemeIdUri === "urn:tva:metadata:cs:AudioPurposeCS:2007" &&
@@ -47,7 +47,7 @@ function isVisuallyImpaired(accessibility) {
47
47
  * @returns {Boolean}
48
48
  */
49
49
  function isHardOfHearing(accessibility) {
50
- if (accessibility == null) {
50
+ if (accessibility === undefined) {
51
51
  return false;
52
52
  }
53
53
  return (accessibility.schemeIdUri === "urn:tva:metadata:cs:AudioPurposeCS:2007" &&
@@ -61,7 +61,7 @@ function isHardOfHearing(accessibility) {
61
61
  * @returns {Boolean}
62
62
  */
63
63
  function hasSignLanguageInterpretation(accessibility) {
64
- if (accessibility == null) {
64
+ if (accessibility === undefined) {
65
65
  return false;
66
66
  }
67
67
  return (accessibility.schemeIdUri === "urn:mpeg:dash:role:2011" &&
@@ -137,10 +137,10 @@ function getAdaptationSetSwitchingIDs(adaptation) {
137
137
  * Note that the AdaptationSets returned are sorted by priority (from the most
138
138
  * priority to the least one).
139
139
  * @param {Array.<Object>} adaptationsIR
140
- * @param {Object} periodInfos
140
+ * @param {Object} context
141
141
  * @returns {Array.<Object>}
142
142
  */
143
- export default function parseAdaptationSets(adaptationsIR, periodInfos) {
143
+ export default function parseAdaptationSets(adaptationsIR, context) {
144
144
  var _a;
145
145
  var _b, _c, _d, _e, _f, _g, _h;
146
146
  var parsedAdaptations = {};
@@ -171,9 +171,9 @@ export default function parseAdaptationSets(adaptationsIR, periodInfos) {
171
171
  roles.some(function (role) { return role.value === "main"; }) &&
172
172
  roles.some(function (role) { return role.schemeIdUri === "urn:mpeg:dash:role:2011"; });
173
173
  var representationsIR = adaptation.children.representations;
174
- var availabilityTimeComplete = (_b = adaptation.attributes.availabilityTimeComplete) !== null && _b !== void 0 ? _b : periodInfos.availabilityTimeComplete;
174
+ var availabilityTimeComplete = (_b = adaptation.attributes.availabilityTimeComplete) !== null && _b !== void 0 ? _b : context.availabilityTimeComplete;
175
175
  var availabilityTimeOffset = ((_c = adaptation.attributes.availabilityTimeOffset) !== null && _c !== void 0 ? _c : 0) +
176
- periodInfos.availabilityTimeOffset;
176
+ context.availabilityTimeOffset;
177
177
  var adaptationMimeType = adaptation.attributes.mimeType;
178
178
  var adaptationCodecs = adaptation.attributes.codecs;
179
179
  var type = inferAdaptationType(representationsIR, isNonEmptyString(adaptationMimeType) ?
@@ -190,25 +190,26 @@ export default function parseAdaptationSets(adaptationsIR, periodInfos) {
190
190
  var newID = void 0;
191
191
  var adaptationSetSwitchingIDs = getAdaptationSetSwitchingIDs(adaptation);
192
192
  var parentSegmentTemplates = [];
193
- if (periodInfos.segmentTemplate !== undefined) {
194
- parentSegmentTemplates.push(periodInfos.segmentTemplate);
193
+ if (context.segmentTemplate !== undefined) {
194
+ parentSegmentTemplates.push(context.segmentTemplate);
195
195
  }
196
196
  if (adaptation.children.segmentTemplate !== undefined) {
197
197
  parentSegmentTemplates.push(adaptation.children.segmentTemplate);
198
198
  }
199
- var adaptationInfos = {
200
- aggressiveMode: periodInfos.aggressiveMode,
199
+ var reprCtxt = {
200
+ aggressiveMode: context.aggressiveMode,
201
201
  availabilityTimeComplete: availabilityTimeComplete,
202
202
  availabilityTimeOffset: availabilityTimeOffset,
203
- baseURLs: resolveBaseURLs(periodInfos.baseURLs, adaptationChildren.baseURLs),
204
- manifestBoundsCalculator: periodInfos.manifestBoundsCalculator,
205
- end: periodInfos.end,
206
- isDynamic: periodInfos.isDynamic,
207
- manifestProfiles: periodInfos.manifestProfiles,
203
+ baseURLs: resolveBaseURLs(context.baseURLs, adaptationChildren.baseURLs),
204
+ manifestBoundsCalculator: context.manifestBoundsCalculator,
205
+ end: context.end,
206
+ isDynamic: context.isDynamic,
207
+ isLastPeriod: context.isLastPeriod,
208
+ manifestProfiles: context.manifestProfiles,
208
209
  parentSegmentTemplates: parentSegmentTemplates,
209
- receivedTime: periodInfos.receivedTime,
210
- start: periodInfos.start,
211
- timeShiftBufferDepth: periodInfos.timeShiftBufferDepth,
210
+ receivedTime: context.receivedTime,
211
+ start: context.start,
212
+ timeShiftBufferDepth: context.timeShiftBufferDepth,
212
213
  unsafelyBaseOnPreviousAdaptation: null,
213
214
  };
214
215
  var trickModeProperty = Array.isArray(essentialProperties) ?
@@ -226,9 +227,9 @@ export default function parseAdaptationSets(adaptationsIR, periodInfos) {
226
227
  // Add to the already existing main video adaptation
227
228
  // TODO remove that ugly custom logic?
228
229
  var videoMainAdaptation = parsedAdaptations.video[lastMainAdaptationIndex.video];
229
- adaptationInfos.unsafelyBaseOnPreviousAdaptation = (_f = (_e = periodInfos
230
+ reprCtxt.unsafelyBaseOnPreviousAdaptation = (_f = (_e = context
230
231
  .unsafelyBaseOnPreviousPeriod) === null || _e === void 0 ? void 0 : _e.getAdaptation(videoMainAdaptation.id)) !== null && _f !== void 0 ? _f : null;
231
- var representations = parseRepresentations(representationsIR, adaptation, adaptationInfos);
232
+ var representations = parseRepresentations(representationsIR, adaptation, reprCtxt);
232
233
  (_a = videoMainAdaptation.representations).push.apply(_a, representations);
233
234
  newID = videoMainAdaptation.id;
234
235
  }
@@ -267,9 +268,9 @@ export default function parseAdaptationSets(adaptationsIR, periodInfos) {
267
268
  }
268
269
  newID = adaptationID;
269
270
  parsedAdaptationsIDs.push(adaptationID);
270
- adaptationInfos.unsafelyBaseOnPreviousAdaptation = (_h = (_g = periodInfos
271
+ reprCtxt.unsafelyBaseOnPreviousAdaptation = (_h = (_g = context
271
272
  .unsafelyBaseOnPreviousPeriod) === null || _g === void 0 ? void 0 : _g.getAdaptation(adaptationID)) !== null && _h !== void 0 ? _h : null;
272
- var representations = parseRepresentations(representationsIR, adaptation, adaptationInfos);
273
+ var representations = parseRepresentations(representationsIR, adaptation, reprCtxt);
273
274
  var parsedAdaptationSet = { id: adaptationID, representations: representations, type: type, isTrickModeTrack: isTrickModeTrack };
274
275
  if (adaptation.attributes.language != null) {
275
276
  parsedAdaptationSet.language = adaptation.attributes.language;
@@ -26,11 +26,11 @@ export interface IMPDParserArguments {
26
26
  * If set, offset to add to `performance.now()` to obtain the current server's
27
27
  * time.
28
28
  */
29
- externalClockOffset?: number;
29
+ externalClockOffset?: number | undefined;
30
30
  /** Time, in terms of `performance.now` at which this MPD was received. */
31
- manifestReceivedTime?: number;
31
+ manifestReceivedTime?: number | undefined;
32
32
  /** Default base time, in seconds. */
33
- referenceDateTime?: number;
33
+ referenceDateTime?: number | undefined;
34
34
  /**
35
35
  * The parser should take this Manifest - which is a previously parsed
36
36
  * Manifest for the same dynamic content - as a base to speed-up the parsing
@@ -41,12 +41,12 @@ export interface IMPDParserArguments {
41
41
  */
42
42
  unsafelyBaseOnPreviousManifest: Manifest | null;
43
43
  /** URL of the manifest (post-redirection if one). */
44
- url?: string;
44
+ url?: string | undefined;
45
45
  }
46
46
  export interface ILoadedXlinkData {
47
- url?: string;
48
- sendingTime?: number;
49
- receivedTime?: number;
47
+ url?: string | undefined;
48
+ sendingTime?: number | undefined;
49
+ receivedTime?: number | undefined;
50
50
  parsed: IPeriodIntermediateRepresentation[];
51
51
  warnings: Error[];
52
52
  }
@@ -94,4 +94,4 @@ export declare type IIrParserResponse = IIrParserResponseNeedsClock | IIrParserR
94
94
  * @param {Array.<Object>} warnings
95
95
  * @returns {Object}
96
96
  */
97
- export default function parseMpdIr(mpdIR: IMPDIntermediateRepresentation, args: IMPDParserArguments, warnings: Error[], hasLoadedClock?: boolean, xlinkInfos?: IXLinkInfos): IIrParserResponse;
97
+ export default function parseMpdIr(mpdIR: IMPDIntermediateRepresentation, args: IMPDParserArguments, warnings: Error[], hasLoadedClock?: boolean | undefined, xlinkInfos?: IXLinkInfos): IIrParserResponse;