rx-player 3.29.0-dev.2022091600 → 3.29.0-dev.2022103100
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.
- package/CHANGELOG.md +22 -10
- package/MAINTAINERS.md +2 -1
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/browser_detection.d.ts +4 -1
- package/dist/_esm5.processed/compat/browser_detection.js +7 -1
- package/dist/_esm5.processed/compat/can_reuse_media_keys.d.ts +12 -0
- package/dist/_esm5.processed/compat/can_reuse_media_keys.js +15 -0
- package/dist/_esm5.processed/compat/enable_audio_track.d.ts +11 -0
- package/dist/_esm5.processed/compat/enable_audio_track.js +26 -0
- package/dist/_esm5.processed/compat/index.d.ts +4 -2
- package/dist/_esm5.processed/compat/index.js +4 -2
- package/dist/_esm5.processed/compat/{should_renew_media_keys.d.ts → should_renew_media_key_system_access.d.ts} +3 -3
- package/dist/_esm5.processed/compat/{should_renew_media_keys.js → should_renew_media_key_system_access.js} +3 -3
- package/dist/_esm5.processed/config.d.ts +1 -0
- package/dist/_esm5.processed/core/api/playback_observer.d.ts +14 -5
- package/dist/_esm5.processed/core/api/playback_observer.js +54 -22
- package/dist/_esm5.processed/core/api/public_api.d.ts +7 -4
- package/dist/_esm5.processed/core/api/public_api.js +79 -61
- package/dist/_esm5.processed/core/api/tracks_management/media_element_track_choice_manager.js +9 -10
- package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.js +1 -1
- package/dist/_esm5.processed/core/decrypt/find_key_system.js +3 -3
- package/dist/_esm5.processed/core/decrypt/get_media_keys.js +4 -1
- package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.d.ts +98 -0
- package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.js +173 -0
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +4 -4
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +2 -1
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +15 -16
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.d.ts +3 -1
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +5 -2
- package/dist/_esm5.processed/core/fetchers/utils/schedule_request.d.ts +103 -0
- package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +414 -0
- package/dist/_esm5.processed/core/init/content_time_boundaries_observer.d.ts +4 -3
- package/dist/_esm5.processed/core/init/content_time_boundaries_observer.js +21 -22
- package/dist/_esm5.processed/core/init/initialize_media_source.d.ts +18 -4
- package/dist/_esm5.processed/core/init/initialize_media_source.js +10 -2
- package/dist/_esm5.processed/core/init/load_on_media_source.js +7 -1
- package/dist/_esm5.processed/core/init/stall_avoider.js +3 -1
- package/dist/_esm5.processed/default_config.d.ts +11 -0
- package/dist/_esm5.processed/default_config.js +11 -0
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +1 -1
- package/dist/_esm5.processed/manifest/manifest.js +11 -2
- package/dist/_esm5.processed/manifest/representation.d.ts +12 -1
- package/dist/_esm5.processed/manifest/representation.js +1 -0
- package/dist/_esm5.processed/manifest/representation_index/static.d.ts +1 -1
- package/dist/_esm5.processed/manifest/representation_index/static.js +2 -2
- package/dist/_esm5.processed/manifest/representation_index/types.d.ts +32 -15
- package/dist/_esm5.processed/manifest/update_period_in_place.js +1 -0
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +10 -9
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +11 -11
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.js +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +7 -7
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +12 -8
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +5 -6
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +16 -16
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +11 -10
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +14 -13
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/tokens.d.ts +3 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/tokens.js +4 -12
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +2 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +1 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +6 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/resolve_base_urls.d.ts +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/resolve_base_urls.js +3 -8
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/BaseURL.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/BaseURL.js +2 -20
- package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +0 -6
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.js +0 -11
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/types.d.ts +5 -1
- package/dist/_esm5.processed/parsers/manifest/local/parse_local_manifest.js +2 -1
- package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +2 -2
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +7 -1
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +17 -11
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +2 -2
- package/dist/_esm5.processed/parsers/manifest/types.d.ts +24 -0
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_extent.js +8 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_origin.js +9 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/create_element.js +2 -1
- package/dist/_esm5.processed/transports/dash/construct_segment_url.d.ts +18 -0
- package/dist/_esm5.processed/transports/dash/construct_segment_url.js +21 -0
- package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +3 -2
- package/dist/_esm5.processed/transports/dash/image_pipelines.js +5 -3
- package/dist/_esm5.processed/transports/dash/segment_loader.js +4 -2
- package/dist/_esm5.processed/transports/dash/text_loader.js +4 -2
- package/dist/_esm5.processed/transports/dash/text_parser.js +3 -1
- package/dist/_esm5.processed/transports/local/segment_loader.d.ts +3 -2
- package/dist/_esm5.processed/transports/local/segment_loader.js +2 -2
- package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +8 -8
- package/dist/_esm5.processed/transports/smooth/pipelines.js +11 -7
- package/dist/_esm5.processed/transports/smooth/utils.d.ts +4 -2
- package/dist/_esm5.processed/transports/smooth/utils.js +7 -1
- package/dist/_esm5.processed/transports/types.d.ts +5 -3
- package/dist/_esm5.processed/utils/event_emitter.d.ts +1 -2
- package/dist/_esm5.processed/utils/resolve_url.d.ts +7 -4
- package/dist/_esm5.processed/utils/resolve_url.js +11 -8
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +5656 -13236
- package/dist/rx-player.min.js +1 -1
- package/jest.config.js +28 -23
- package/package.json +29 -29
- package/sonar-project.properties +1 -1
- package/src/compat/__tests__/can_reuse_media_keys.test.ts +54 -0
- package/src/compat/__tests__/enable_audio_track.test.ts +341 -0
- package/src/compat/__tests__/{should_renew_media_keys.test.ts → should_renew_media_key_system_access.test.ts} +7 -5
- package/src/compat/browser_detection.ts +10 -0
- package/src/compat/can_reuse_media_keys.ts +19 -0
- package/src/compat/enable_audio_track.ts +33 -0
- package/src/compat/index.ts +6 -2
- package/src/compat/{should_renew_media_keys.ts → should_renew_media_key_system_access.ts} +3 -3
- package/src/core/api/playback_observer.ts +97 -33
- package/src/core/api/public_api.ts +126 -74
- package/src/core/api/tracks_management/media_element_track_choice_manager.ts +3 -11
- package/src/core/decrypt/__tests__/__global__/media_keys.test.ts +182 -0
- package/src/core/decrypt/__tests__/__global__/utils.ts +2 -0
- package/src/core/decrypt/find_key_system.ts +3 -3
- package/src/core/decrypt/get_media_keys.ts +5 -1
- package/src/core/fetchers/cdn_prioritizer.ts +198 -0
- package/src/core/fetchers/manifest/manifest_fetcher.ts +7 -11
- package/src/core/fetchers/segment/segment_fetcher.ts +12 -10
- package/src/core/fetchers/segment/segment_fetcher_creator.ts +10 -1
- package/src/core/fetchers/utils/schedule_request.ts +482 -0
- package/src/core/init/content_time_boundaries_observer.ts +12 -12
- package/src/core/init/initialize_media_source.ts +31 -4
- package/src/core/init/load_on_media_source.ts +11 -2
- package/src/core/init/stall_avoider.ts +4 -1
- package/src/core/stream/orchestrator/stream_orchestrator.ts +0 -1
- package/src/default_config.ts +12 -0
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +1 -0
- package/src/manifest/manifest.ts +11 -2
- package/src/manifest/representation.ts +15 -0
- package/src/manifest/representation_index/__tests__/static.test.ts +1 -1
- package/src/manifest/representation_index/static.ts +3 -3
- package/src/manifest/representation_index/types.ts +33 -15
- package/src/manifest/update_period_in_place.ts +1 -0
- package/src/parsers/manifest/dash/common/indexes/base.ts +22 -23
- package/src/parsers/manifest/dash/common/indexes/get_init_segment.ts +6 -4
- package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +5 -5
- package/src/parsers/manifest/dash/common/indexes/list.ts +19 -20
- package/src/parsers/manifest/dash/common/indexes/template.ts +23 -27
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +25 -23
- package/src/parsers/manifest/dash/common/indexes/tokens.ts +7 -18
- package/src/parsers/manifest/dash/common/parse_mpd.ts +2 -4
- package/src/parsers/manifest/dash/common/parse_representation_index.ts +1 -6
- package/src/parsers/manifest/dash/common/parse_representations.ts +9 -0
- package/src/parsers/manifest/dash/common/resolve_base_urls.ts +5 -9
- package/src/parsers/manifest/dash/js-parser/node_parsers/BaseURL.ts +2 -29
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/AdaptationSet.test.ts +7 -11
- package/src/parsers/manifest/dash/node_parser_types.ts +0 -7
- package/src/parsers/manifest/dash/wasm-parser/rs/events.rs +3 -1
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/attributes.rs +1 -8
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.ts +0 -13
- package/src/parsers/manifest/dash/wasm-parser/ts/types.ts +8 -0
- package/src/parsers/manifest/local/parse_local_manifest.ts +1 -0
- package/src/parsers/manifest/local/representation_index.ts +2 -2
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +7 -1
- package/src/parsers/manifest/smooth/create_parser.ts +17 -13
- package/src/parsers/manifest/smooth/representation_index.ts +2 -2
- package/src/parsers/manifest/types.ts +26 -1
- package/src/parsers/manifest/utils/__tests__/get_first_time_from_adaptations.test.ts +15 -0
- package/src/parsers/manifest/utils/__tests__/get_last_time_from_adaptation.test.ts +15 -0
- package/src/parsers/texttracks/ttml/html/apply_extent.ts +8 -1
- package/src/parsers/texttracks/ttml/html/apply_origin.ts +9 -1
- package/src/parsers/texttracks/ttml/html/create_element.ts +2 -2
- package/src/transports/dash/construct_segment_url.ts +28 -0
- package/src/transports/dash/image_pipelines.ts +5 -2
- package/src/transports/dash/segment_loader.ts +5 -2
- package/src/transports/dash/text_loader.ts +5 -2
- package/src/transports/dash/text_parser.ts +3 -1
- package/src/transports/local/segment_loader.ts +3 -2
- package/src/transports/metaplaylist/pipelines.ts +28 -9
- package/src/transports/smooth/pipelines.ts +12 -6
- package/src/transports/smooth/utils.ts +13 -1
- package/src/transports/types.ts +6 -3
- package/src/utils/__tests__/event_emitter.test.ts +72 -67
- package/src/utils/__tests__/initialization_segment_cache.test.ts +7 -7
- package/src/utils/__tests__/resolve_url.test.ts +27 -23
- package/src/utils/event_emitter.ts +1 -3
- package/src/utils/resolve_url.ts +11 -8
- package/dist/_esm5.processed/core/fetchers/utils/try_urls_with_backoff.d.ts +0 -85
- package/dist/_esm5.processed/core/fetchers/utils/try_urls_with_backoff.js +0 -264
- package/dummy +0 -1
- package/src/core/fetchers/utils/try_urls_with_backoff.ts +0 -287
|
@@ -37,10 +37,9 @@ import isSegmentStillAvailable from "../../../../utils/is_segment_still_availabl
|
|
|
37
37
|
import updateSegmentTimeline from "../../../../utils/update_segment_timeline";
|
|
38
38
|
import { ISegmentTimelineElement } from "../../../node_parser_types";
|
|
39
39
|
import ManifestBoundsCalculator from "../../manifest_bounds_calculator";
|
|
40
|
-
import { IResolvedBaseUrl } from "../../resolve_base_urls";
|
|
41
40
|
import getInitSegment from "../get_init_segment";
|
|
42
41
|
import getSegmentsFromTimeline from "../get_segments_from_timeline";
|
|
43
|
-
import {
|
|
42
|
+
import { constructRepresentationUrl } from "../tokens";
|
|
44
43
|
import { getSegmentTimeRoundingError } from "../utils";
|
|
45
44
|
import constructTimelineFromElements from "./construct_timeline_from_elements";
|
|
46
45
|
// eslint-disable-next-line max-len
|
|
@@ -71,16 +70,22 @@ export interface ITimelineIndex {
|
|
|
71
70
|
indexTimeOffset : number;
|
|
72
71
|
/** Information on the initialization segment. */
|
|
73
72
|
initialization? : {
|
|
74
|
-
/**
|
|
75
|
-
|
|
73
|
+
/**
|
|
74
|
+
* URL path, to add to the wanted CDN, to access the initialization segment.
|
|
75
|
+
* `null` if no URL exists.
|
|
76
|
+
*/
|
|
77
|
+
url: string | null;
|
|
76
78
|
/** possible byte range to request it. */
|
|
77
79
|
range?: [number, number] | undefined;
|
|
78
80
|
} | undefined;
|
|
79
81
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
+
* Template for the URL suffix (to concatenate to the wanted CDN), to access any
|
|
83
|
+
* media segment.
|
|
84
|
+
* Can contain tokens to replace to convert it to real URLs.
|
|
85
|
+
*
|
|
86
|
+
* `null` if no URL exists.
|
|
82
87
|
*/
|
|
83
|
-
|
|
88
|
+
segmentUrlTemplate : string | null ;
|
|
84
89
|
/** Number from which the first segments in this index starts with. */
|
|
85
90
|
startNumber? : number | undefined;
|
|
86
91
|
/**
|
|
@@ -158,8 +163,6 @@ export interface ITimelineIndexContextArgument {
|
|
|
158
163
|
* index was received
|
|
159
164
|
*/
|
|
160
165
|
receivedTime? : number | undefined;
|
|
161
|
-
/** Base URL for the Representation concerned. */
|
|
162
|
-
representationBaseURLs : IResolvedBaseUrl[];
|
|
163
166
|
/** ID of the Representation concerned. */
|
|
164
167
|
representationId? : string | undefined;
|
|
165
168
|
/** Bitrate of the Representation concerned. */
|
|
@@ -247,7 +250,6 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
|
|
|
247
250
|
manifestBoundsCalculator,
|
|
248
251
|
isDynamic,
|
|
249
252
|
isLastPeriod,
|
|
250
|
-
representationBaseURLs,
|
|
251
253
|
representationId,
|
|
252
254
|
representationBitrate,
|
|
253
255
|
periodStart,
|
|
@@ -284,23 +286,25 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
|
|
|
284
286
|
|
|
285
287
|
this._isDynamic = isDynamic;
|
|
286
288
|
this._parseTimeline = index.timelineParser ?? null;
|
|
287
|
-
const
|
|
289
|
+
const initializationUrl = index.initialization?.media === undefined ?
|
|
290
|
+
null :
|
|
291
|
+
constructRepresentationUrl(index.initialization.media,
|
|
292
|
+
representationId,
|
|
293
|
+
representationBitrate);
|
|
294
|
+
|
|
295
|
+
const segmentUrlTemplate = index.media === undefined ?
|
|
296
|
+
null :
|
|
297
|
+
constructRepresentationUrl(index.media, representationId, representationBitrate);
|
|
288
298
|
this._index = { availabilityTimeComplete,
|
|
289
299
|
indexRange: index.indexRange,
|
|
290
300
|
indexTimeOffset,
|
|
291
301
|
initialization: index.initialization == null ?
|
|
292
302
|
undefined :
|
|
293
303
|
{
|
|
294
|
-
|
|
295
|
-
index.initialization.media,
|
|
296
|
-
representationId,
|
|
297
|
-
representationBitrate),
|
|
304
|
+
url: initializationUrl,
|
|
298
305
|
range: index.initialization.range,
|
|
299
306
|
},
|
|
300
|
-
|
|
301
|
-
index.media,
|
|
302
|
-
representationId,
|
|
303
|
-
representationBitrate),
|
|
307
|
+
segmentUrlTemplate,
|
|
304
308
|
startNumber: index.startNumber,
|
|
305
309
|
timeline: index.timeline ?? null,
|
|
306
310
|
timescale };
|
|
@@ -330,12 +334,12 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
|
|
|
330
334
|
}
|
|
331
335
|
|
|
332
336
|
// destructuring to please TypeScript
|
|
333
|
-
const {
|
|
337
|
+
const { segmentUrlTemplate,
|
|
334
338
|
startNumber,
|
|
335
339
|
timeline,
|
|
336
340
|
timescale,
|
|
337
341
|
indexTimeOffset } = this._index;
|
|
338
|
-
return getSegmentsFromTimeline({
|
|
342
|
+
return getSegmentsFromTimeline({ segmentUrlTemplate,
|
|
339
343
|
startNumber,
|
|
340
344
|
timeline,
|
|
341
345
|
timescale,
|
|
@@ -348,8 +352,6 @@ export default class TimelineRepresentationIndex implements IRepresentationIndex
|
|
|
348
352
|
|
|
349
353
|
/**
|
|
350
354
|
* Returns true if the index should be refreshed.
|
|
351
|
-
* @param {Number} _up
|
|
352
|
-
* @param {Number} to
|
|
353
355
|
* @returns {Boolean}
|
|
354
356
|
*/
|
|
355
357
|
shouldRefresh() : false {
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import isNonEmptyString from "../../../../../utils/is_non_empty_string";
|
|
18
|
-
import resolveURL from "../../../../../utils/resolve_url";
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* Pad with 0 in the left of the given n argument to reach l length
|
|
@@ -47,27 +46,17 @@ function processFormatedToken(
|
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
/**
|
|
50
|
-
* @param {string}
|
|
51
|
-
* @param {string|undefined}
|
|
52
|
-
* @param {string|undefined} id
|
|
49
|
+
* @param {string} urlTemplate
|
|
50
|
+
* @param {string|undefined} representationId
|
|
53
51
|
* @param {number|undefined} bitrate
|
|
54
52
|
* @returns {string}
|
|
55
53
|
*/
|
|
56
|
-
export function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
id?: string,
|
|
54
|
+
export function constructRepresentationUrl(
|
|
55
|
+
urlTemplate : string,
|
|
56
|
+
representationId?: string,
|
|
60
57
|
bitrate?: number
|
|
61
|
-
): string
|
|
62
|
-
|
|
63
|
-
return media !== undefined ? [replaceRepresentationDASHTokens(media, id, bitrate)] :
|
|
64
|
-
null;
|
|
65
|
-
}
|
|
66
|
-
return baseURLs.map(baseURL => {
|
|
67
|
-
return replaceRepresentationDASHTokens(resolveURL(baseURL, media),
|
|
68
|
-
id,
|
|
69
|
-
bitrate);
|
|
70
|
-
});
|
|
58
|
+
): string {
|
|
59
|
+
return replaceRepresentationDASHTokens(urlTemplate, representationId, bitrate);
|
|
71
60
|
}
|
|
72
61
|
|
|
73
62
|
/**
|
|
@@ -18,7 +18,7 @@ import config from "../../../../config";
|
|
|
18
18
|
import log from "../../../../log";
|
|
19
19
|
import Manifest from "../../../../manifest";
|
|
20
20
|
import arrayFind from "../../../../utils/array_find";
|
|
21
|
-
import {
|
|
21
|
+
import { getFilenameIndexInUrl } from "../../../../utils/resolve_url";
|
|
22
22
|
import { IParsedManifest } from "../../types";
|
|
23
23
|
import {
|
|
24
24
|
IMPDIntermediateRepresentation,
|
|
@@ -241,9 +241,7 @@ function parseCompleteIntermediateRepresentation(
|
|
|
241
241
|
attributes: rootAttributes } = mpdIR;
|
|
242
242
|
const isDynamic : boolean = rootAttributes.type === "dynamic";
|
|
243
243
|
const initialBaseUrl : IResolvedBaseUrl[] = args.url !== undefined ?
|
|
244
|
-
[{ url:
|
|
245
|
-
availabilityTimeOffset: 0,
|
|
246
|
-
availabilityTimeComplete: true }] :
|
|
244
|
+
[{ url: args.url.substring(0, getFilenameIndexInUrl(args.url)) }] :
|
|
247
245
|
[];
|
|
248
246
|
const mpdBaseUrls = resolveBaseURLs(initialBaseUrl, rootChildren.baseURLs);
|
|
249
247
|
const availabilityStartTime = parseAvailabilityStartTime(rootAttributes,
|
|
@@ -33,9 +33,7 @@ import {
|
|
|
33
33
|
TimelineRepresentationIndex,
|
|
34
34
|
} from "./indexes";
|
|
35
35
|
import ManifestBoundsCalculator from "./manifest_bounds_calculator";
|
|
36
|
-
import
|
|
37
|
-
IResolvedBaseUrl,
|
|
38
|
-
} from "./resolve_base_urls";
|
|
36
|
+
import { IResolvedBaseUrl } from "./resolve_base_urls";
|
|
39
37
|
|
|
40
38
|
/**
|
|
41
39
|
* Parse the specific segment indexing information found in a representation
|
|
@@ -48,8 +46,6 @@ export default function parseRepresentationIndex(
|
|
|
48
46
|
representation : IRepresentationIntermediateRepresentation,
|
|
49
47
|
context : IRepresentationIndexContext
|
|
50
48
|
) : IRepresentationIndex {
|
|
51
|
-
const representationBaseURLs = resolveBaseURLs(context.baseURLs,
|
|
52
|
-
representation.children.baseURLs);
|
|
53
49
|
const { aggressiveMode,
|
|
54
50
|
availabilityTimeOffset,
|
|
55
51
|
manifestBoundsCalculator,
|
|
@@ -80,7 +76,6 @@ export default function parseRepresentationIndex(
|
|
|
80
76
|
periodEnd,
|
|
81
77
|
periodStart,
|
|
82
78
|
receivedTime,
|
|
83
|
-
representationBaseURLs,
|
|
84
79
|
representationBitrate: representation.attributes.bitrate,
|
|
85
80
|
representationId: representation.attributes.id,
|
|
86
81
|
timeShiftBufferDepth };
|
|
@@ -20,6 +20,7 @@ import { IHDRInformation } from "../../../../public_types";
|
|
|
20
20
|
import arrayFind from "../../../../utils/array_find";
|
|
21
21
|
import objectAssign from "../../../../utils/object_assign";
|
|
22
22
|
import {
|
|
23
|
+
ICdnMetadata,
|
|
23
24
|
IContentProtections,
|
|
24
25
|
IParsedRepresentation,
|
|
25
26
|
} from "../../types";
|
|
@@ -33,6 +34,7 @@ import { getWEBMHDRInformation } from "./get_hdr_information";
|
|
|
33
34
|
import parseRepresentationIndex, {
|
|
34
35
|
IRepresentationIndexContext,
|
|
35
36
|
} from "./parse_representation_index";
|
|
37
|
+
import resolveBaseURLs from "./resolve_base_urls";
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* Combine inband event streams from representation and
|
|
@@ -159,9 +161,16 @@ export default function parseRepresentations(
|
|
|
159
161
|
representationBitrate = representation.attributes.bitrate;
|
|
160
162
|
}
|
|
161
163
|
|
|
164
|
+
const representationBaseURLs = resolveBaseURLs(context.baseURLs,
|
|
165
|
+
representation.children.baseURLs);
|
|
166
|
+
const cdnMetadata : ICdnMetadata[] = representationBaseURLs.map(x =>
|
|
167
|
+
({ baseUrl: x.url, id: x.serviceLocation }));
|
|
168
|
+
|
|
169
|
+
|
|
162
170
|
// Construct Representation Base
|
|
163
171
|
const parsedRepresentation : IParsedRepresentation =
|
|
164
172
|
{ bitrate: representationBitrate,
|
|
173
|
+
cdnMetadata,
|
|
165
174
|
index: representationIndex,
|
|
166
175
|
id: representationID };
|
|
167
176
|
|
|
@@ -19,8 +19,7 @@ import { IBaseUrlIntermediateRepresentation } from "../node_parser_types";
|
|
|
19
19
|
|
|
20
20
|
export interface IResolvedBaseUrl {
|
|
21
21
|
url : string;
|
|
22
|
-
|
|
23
|
-
availabilityTimeComplete : boolean;
|
|
22
|
+
serviceLocation? : string | undefined;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
/**
|
|
@@ -37,9 +36,7 @@ export default function resolveBaseURLs(
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
const newBaseUrls : IResolvedBaseUrl[] = newBaseUrlsIR.map(ir => {
|
|
40
|
-
return { url: ir.value
|
|
41
|
-
availabilityTimeOffset: ir.attributes.availabilityTimeOffset ?? 0,
|
|
42
|
-
availabilityTimeComplete: ir.attributes.availabilityTimeComplete ?? true };
|
|
39
|
+
return { url: ir.value };
|
|
43
40
|
});
|
|
44
41
|
if (currentBaseURLs.length === 0) {
|
|
45
42
|
return newBaseUrls;
|
|
@@ -51,11 +48,10 @@ export default function resolveBaseURLs(
|
|
|
51
48
|
for (let j = 0; j < newBaseUrls.length; j++) {
|
|
52
49
|
const newBaseUrl = newBaseUrls[j];
|
|
53
50
|
const newUrl = resolveURL(curBaseUrl.url, newBaseUrl.url);
|
|
54
|
-
const newAvailabilityTimeOffset = curBaseUrl.availabilityTimeOffset +
|
|
55
|
-
newBaseUrl.availabilityTimeOffset;
|
|
56
51
|
result.push({ url: newUrl,
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
serviceLocation: newBaseUrl.serviceLocation ??
|
|
53
|
+
curBaseUrl.serviceLocation });
|
|
54
|
+
|
|
59
55
|
}
|
|
60
56
|
}
|
|
61
57
|
return result;
|
|
@@ -15,48 +15,21 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { IBaseUrlIntermediateRepresentation } from "../../node_parser_types";
|
|
18
|
-
import {
|
|
19
|
-
parseBoolean,
|
|
20
|
-
parseMPDFloat,
|
|
21
|
-
ValueParser,
|
|
22
|
-
} from "./utils";
|
|
23
18
|
|
|
24
19
|
/**
|
|
25
20
|
* Parse an BaseURL element into an BaseURL intermediate
|
|
26
21
|
* representation.
|
|
27
|
-
* @param {Element}
|
|
22
|
+
* @param {Element} root - The BaseURL root element.
|
|
28
23
|
* @returns {Array.<Object|undefined>}
|
|
29
24
|
*/
|
|
30
25
|
export default function parseBaseURL(
|
|
31
26
|
root: Element
|
|
32
27
|
) : [IBaseUrlIntermediateRepresentation | undefined, Error[]] {
|
|
33
|
-
const attributes : { availabilityTimeOffset?: number;
|
|
34
|
-
availabilityTimeComplete?: boolean; } = {};
|
|
35
28
|
const value = root.textContent;
|
|
36
|
-
|
|
37
29
|
const warnings : Error[] = [];
|
|
38
|
-
const parseValue = ValueParser(attributes, warnings);
|
|
39
30
|
if (value === null || value.length === 0) {
|
|
40
31
|
return [undefined, warnings];
|
|
41
32
|
}
|
|
42
|
-
|
|
43
|
-
const attribute = root.attributes[i];
|
|
44
|
-
|
|
45
|
-
switch (attribute.name) {
|
|
46
|
-
case "availabilityTimeOffset":
|
|
47
|
-
parseValue(attribute.value, { asKey: "availabilityTimeOffset",
|
|
48
|
-
parser: parseMPDFloat,
|
|
49
|
-
dashName: "availabilityTimeOffset" });
|
|
50
|
-
break;
|
|
51
|
-
|
|
52
|
-
case "availabilityTimeComplete":
|
|
53
|
-
parseValue(attribute.value, { asKey: "availabilityTimeComplete",
|
|
54
|
-
parser: parseBoolean,
|
|
55
|
-
dashName: "availabilityTimeComplete" });
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return [ { value, attributes },
|
|
33
|
+
return [ { value },
|
|
61
34
|
warnings ];
|
|
62
35
|
}
|
|
@@ -359,14 +359,13 @@ describe("DASH Node Parsers - AdaptationSet", () => {
|
|
|
359
359
|
it("should correctly parse a non-empty baseURLs", () => {
|
|
360
360
|
const element1 = new DOMParser()
|
|
361
361
|
// eslint-disable-next-line max-len
|
|
362
|
-
.parseFromString("<AdaptationSet><BaseURL
|
|
362
|
+
.parseFromString("<AdaptationSet><BaseURL serviceLocation=\"foo\">a</BaseURL></AdaptationSet>", "text/xml")
|
|
363
363
|
.childNodes[0] as Element;
|
|
364
364
|
expect(createAdaptationSetIntermediateRepresentation(element1))
|
|
365
365
|
.toEqual([
|
|
366
366
|
{
|
|
367
367
|
attributes: {},
|
|
368
|
-
children: { baseURLs: [{
|
|
369
|
-
value: "a" }],
|
|
368
|
+
children: { baseURLs: [{ value: "a" }],
|
|
370
369
|
representations: [] },
|
|
371
370
|
},
|
|
372
371
|
[],
|
|
@@ -375,15 +374,14 @@ describe("DASH Node Parsers - AdaptationSet", () => {
|
|
|
375
374
|
const element2 = new DOMParser()
|
|
376
375
|
.parseFromString(
|
|
377
376
|
// eslint-disable-next-line max-len
|
|
378
|
-
"<AdaptationSet><BaseURL
|
|
377
|
+
"<AdaptationSet><BaseURL serviceLocation=\"4\">foo bar</BaseURL></AdaptationSet>",
|
|
379
378
|
"text/xml"
|
|
380
379
|
).childNodes[0] as Element;
|
|
381
380
|
expect(createAdaptationSetIntermediateRepresentation(element2))
|
|
382
381
|
.toEqual([
|
|
383
382
|
{
|
|
384
383
|
attributes: {},
|
|
385
|
-
children: { baseURLs: [{
|
|
386
|
-
value: "foo bar" }],
|
|
384
|
+
children: { baseURLs: [{ value: "foo bar" }],
|
|
387
385
|
representations: [] },
|
|
388
386
|
},
|
|
389
387
|
[],
|
|
@@ -393,16 +391,14 @@ describe("DASH Node Parsers - AdaptationSet", () => {
|
|
|
393
391
|
it("should correctly parse multiple non-empty baseURLs", () => {
|
|
394
392
|
const element1 = new DOMParser()
|
|
395
393
|
// eslint-disable-next-line max-len
|
|
396
|
-
.parseFromString("<AdaptationSet><BaseURL
|
|
394
|
+
.parseFromString("<AdaptationSet><BaseURL serviceLocation=\"\">a</BaseURL><BaseURL serviceLocation=\"http://test.com\">b</BaseURL></AdaptationSet>", "text/xml")
|
|
397
395
|
.childNodes[0] as Element;
|
|
398
396
|
expect(createAdaptationSetIntermediateRepresentation(element1))
|
|
399
397
|
.toEqual([
|
|
400
398
|
{
|
|
401
399
|
attributes: {},
|
|
402
|
-
children: { baseURLs: [ {
|
|
403
|
-
|
|
404
|
-
{ attributes: { availabilityTimeOffset: 12 },
|
|
405
|
-
value: "b" } ],
|
|
400
|
+
children: { baseURLs: [ { value: "a" },
|
|
401
|
+
{ value: "b" } ],
|
|
406
402
|
representations: [] },
|
|
407
403
|
},
|
|
408
404
|
[],
|
|
@@ -368,13 +368,6 @@ export interface IBaseUrlIntermediateRepresentation {
|
|
|
368
368
|
* This is the inner content of a BaseURL node.
|
|
369
369
|
*/
|
|
370
370
|
value: string;
|
|
371
|
-
|
|
372
|
-
/** Attributes assiociated to the BaseURL node. */
|
|
373
|
-
attributes: {
|
|
374
|
-
/** availabilityTimeOffset attribute assiociated to that BaseURL node. */
|
|
375
|
-
availabilityTimeOffset?: number;
|
|
376
|
-
availabilityTimeComplete?: boolean;
|
|
377
|
-
};
|
|
378
371
|
}
|
|
379
372
|
|
|
380
373
|
/** Intermediate representation for a Node following a "scheme" format. */
|
|
@@ -278,8 +278,10 @@ pub enum AttributeName {
|
|
|
278
278
|
/// format: the browser's `DOMParser` API needs to know all potential
|
|
279
279
|
/// namespaces that will appear in it.
|
|
280
280
|
Namespace = 70,
|
|
281
|
-
|
|
281
|
+
|
|
282
282
|
Label = 71, // String
|
|
283
|
+
|
|
284
|
+
ServiceLocation = 72, // String
|
|
283
285
|
}
|
|
284
286
|
|
|
285
287
|
impl TagName {
|
|
@@ -142,14 +142,7 @@ pub fn report_base_url_attrs(tag_bs : &quick_xml::events::BytesStart) {
|
|
|
142
142
|
for res_attr in tag_bs.attributes() {
|
|
143
143
|
match res_attr {
|
|
144
144
|
Ok(attr) => match attr.key {
|
|
145
|
-
b"
|
|
146
|
-
match attr.value.as_ref() {
|
|
147
|
-
b"INF" => AvailabilityTimeOffset.report(f64::INFINITY),
|
|
148
|
-
_ => AvailabilityTimeOffset.try_report_as_u64(&attr),
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
b"availabilityTimeComplete" =>
|
|
152
|
-
AvailabilityTimeComplete.try_report_as_bool(&attr),
|
|
145
|
+
b"serviceLocation" => ServiceLocation.try_report_as_string(&attr),
|
|
153
146
|
_ => {},
|
|
154
147
|
},
|
|
155
148
|
Err(err) => ParsingError::from(err).report_err(),
|
|
@@ -30,24 +30,11 @@ export function generateBaseUrlAttrParser(
|
|
|
30
30
|
linearMemory : WebAssembly.Memory
|
|
31
31
|
) : IAttributeParser {
|
|
32
32
|
const textDecoder = new TextDecoder();
|
|
33
|
-
let dataView;
|
|
34
33
|
return function onMPDAttribute(attr : number, ptr : number, len : number) {
|
|
35
34
|
switch (attr) {
|
|
36
35
|
case AttributeName.Text:
|
|
37
36
|
baseUrlAttrs.value = parseString(textDecoder, linearMemory.buffer, ptr, len);
|
|
38
37
|
break;
|
|
39
|
-
|
|
40
|
-
case AttributeName.AvailabilityTimeOffset: {
|
|
41
|
-
dataView = new DataView(linearMemory.buffer);
|
|
42
|
-
baseUrlAttrs.attributes.availabilityTimeOffset = dataView.getFloat64(ptr, true);
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
case AttributeName.AvailabilityTimeComplete: {
|
|
47
|
-
baseUrlAttrs.attributes.availabilityTimeComplete =
|
|
48
|
-
new DataView(linearMemory.buffer).getUint8(0) === 0;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
38
|
}
|
|
52
39
|
};
|
|
53
40
|
}
|
|
@@ -282,4 +282,12 @@ export const enum AttributeName {
|
|
|
282
282
|
Namespace = 70,
|
|
283
283
|
|
|
284
284
|
Label = 71, // String
|
|
285
|
+
|
|
286
|
+
ServiceLocation = 72, // String
|
|
287
|
+
|
|
288
|
+
QueryBeforeStart = 73, // Boolean
|
|
289
|
+
|
|
290
|
+
ProxyServerUrl = 74, // String
|
|
291
|
+
|
|
292
|
+
DefaultServiceLocation = 75,
|
|
285
293
|
}
|
|
@@ -133,6 +133,7 @@ function parseRepresentation(
|
|
|
133
133
|
undefined :
|
|
134
134
|
formatContentProtections(representation.contentProtections);
|
|
135
135
|
return { id,
|
|
136
|
+
cdnMetadata: null,
|
|
136
137
|
bitrate: representation.bitrate,
|
|
137
138
|
height: representation.height,
|
|
138
139
|
width: representation.width,
|
|
@@ -43,7 +43,7 @@ export default class LocalRepresentationIndex implements IRepresentationIndex {
|
|
|
43
43
|
end: 0,
|
|
44
44
|
duration: 0,
|
|
45
45
|
timescale: 1,
|
|
46
|
-
|
|
46
|
+
url: null,
|
|
47
47
|
complete: true,
|
|
48
48
|
privateInfos: {
|
|
49
49
|
localManifestInitSegment: { load: this._index.loadInitSegment } },
|
|
@@ -81,7 +81,7 @@ export default class LocalRepresentationIndex implements IRepresentationIndex {
|
|
|
81
81
|
duration: wantedSegment.duration,
|
|
82
82
|
timescale: 1,
|
|
83
83
|
timestampOffset: wantedSegment.timestampOffset,
|
|
84
|
-
|
|
84
|
+
url: null,
|
|
85
85
|
complete: true,
|
|
86
86
|
privateInfos: {
|
|
87
87
|
localManifestSegment: { load: this._index.loadSegment,
|
|
@@ -20,6 +20,7 @@ import Manifest, {
|
|
|
20
20
|
SUPPORTED_ADAPTATIONS_TYPE,
|
|
21
21
|
} from "../../../manifest";
|
|
22
22
|
import idGenerator from "../../../utils/id_generator";
|
|
23
|
+
import { getFilenameIndexInUrl } from "../../../utils/resolve_url";
|
|
23
24
|
import {
|
|
24
25
|
IParsedAdaptation,
|
|
25
26
|
IParsedAdaptations,
|
|
@@ -213,6 +214,7 @@ function createManifest(
|
|
|
213
214
|
representations.push({
|
|
214
215
|
bitrate: currentRepresentation.bitrate,
|
|
215
216
|
index: newIndex,
|
|
217
|
+
cdnMetadata: currentRepresentation.cdnMetadata,
|
|
216
218
|
id: currentRepresentation.id,
|
|
217
219
|
height: currentRepresentation.height,
|
|
218
220
|
width: currentRepresentation.width,
|
|
@@ -244,6 +246,9 @@ function createManifest(
|
|
|
244
246
|
const newTextAdaptations : IParsedAdaptation[] = textTracks.map((track) => {
|
|
245
247
|
const adaptationID = "gen-text-ada-" + generateAdaptationID();
|
|
246
248
|
const representationID = "gen-text-rep-" + generateRepresentationID();
|
|
249
|
+
const indexOfFilename = getFilenameIndexInUrl(track.url);
|
|
250
|
+
const cdnUrl = track.url.substring(0, indexOfFilename);
|
|
251
|
+
const filename = track.url.substring(indexOfFilename);
|
|
247
252
|
return {
|
|
248
253
|
id: adaptationID,
|
|
249
254
|
type: "text",
|
|
@@ -252,10 +257,11 @@ function createManifest(
|
|
|
252
257
|
manuallyAdded: true,
|
|
253
258
|
representations: [
|
|
254
259
|
{ bitrate: 0,
|
|
260
|
+
cdnMetadata: [{ baseUrl: cdnUrl }],
|
|
255
261
|
id: representationID,
|
|
256
262
|
mimeType: track.mimeType,
|
|
257
263
|
codecs: track.codecs,
|
|
258
|
-
index: new StaticRepresentationIndex({ media:
|
|
264
|
+
index: new StaticRepresentationIndex({ media: filename }),
|
|
259
265
|
},
|
|
260
266
|
],
|
|
261
267
|
};
|
|
@@ -24,9 +24,7 @@ import {
|
|
|
24
24
|
} from "../../../utils/byte_parsing";
|
|
25
25
|
import isNonEmptyString from "../../../utils/is_non_empty_string";
|
|
26
26
|
import objectAssign from "../../../utils/object_assign";
|
|
27
|
-
import
|
|
28
|
-
normalizeBaseURL,
|
|
29
|
-
} from "../../../utils/resolve_url";
|
|
27
|
+
import { getFilenameIndexInUrl } from "../../../utils/resolve_url";
|
|
30
28
|
import { hexToBytes } from "../../../utils/string_parsing";
|
|
31
29
|
import takeFirstSet from "../../../utils/take_first_set";
|
|
32
30
|
import { createBox } from "../../containers/isobmff";
|
|
@@ -60,7 +58,7 @@ import { replaceRepresentationSmoothTokens } from "./utils/tokens";
|
|
|
60
58
|
const DEFAULT_AGGRESSIVE_MODE = false;
|
|
61
59
|
|
|
62
60
|
interface IAdaptationParserArguments { root : Element;
|
|
63
|
-
|
|
61
|
+
baseUrl : string;
|
|
64
62
|
timescale : number;
|
|
65
63
|
protections : IContentProtectionSmooth[];
|
|
66
64
|
isLive : boolean;
|
|
@@ -280,7 +278,7 @@ function createSmoothStreamingParser(
|
|
|
280
278
|
function parseAdaptation(args: IAdaptationParserArguments) : IParsedAdaptation|null {
|
|
281
279
|
const { root,
|
|
282
280
|
timescale,
|
|
283
|
-
|
|
281
|
+
baseUrl,
|
|
284
282
|
protections,
|
|
285
283
|
timeShiftBufferDepth,
|
|
286
284
|
manifestReceivedTime,
|
|
@@ -301,11 +299,11 @@ function createSmoothStreamingParser(
|
|
|
301
299
|
|
|
302
300
|
const subType = root.getAttribute("Subtype");
|
|
303
301
|
const language = root.getAttribute("Language");
|
|
304
|
-
const
|
|
305
|
-
const
|
|
306
|
-
|
|
302
|
+
const UrlAttr = root.getAttribute("Url");
|
|
303
|
+
const UrlPathWithTokens = UrlAttr === null ? "" :
|
|
304
|
+
UrlAttr;
|
|
307
305
|
if (__ENVIRONMENT__.CURRENT_ENV === __ENVIRONMENT__.DEV as number) {
|
|
308
|
-
assert(
|
|
306
|
+
assert(UrlPathWithTokens !== "");
|
|
309
307
|
}
|
|
310
308
|
|
|
311
309
|
const { qualityLevels, cNodes } =
|
|
@@ -347,11 +345,10 @@ function createSmoothStreamingParser(
|
|
|
347
345
|
"");
|
|
348
346
|
|
|
349
347
|
const representations = qualityLevels.map((qualityLevel) => {
|
|
350
|
-
const path = resolveURL(rootURL, baseURL);
|
|
351
348
|
const repIndex = {
|
|
352
349
|
timeline: index.timeline,
|
|
353
350
|
timescale: index.timescale,
|
|
354
|
-
media: replaceRepresentationSmoothTokens(
|
|
351
|
+
media: replaceRepresentationSmoothTokens(UrlPathWithTokens,
|
|
355
352
|
qualityLevel.bitrate,
|
|
356
353
|
qualityLevel.customAttributes),
|
|
357
354
|
};
|
|
@@ -404,6 +401,9 @@ function createSmoothStreamingParser(
|
|
|
404
401
|
const representation : IParsedRepresentation = objectAssign({},
|
|
405
402
|
qualityLevel,
|
|
406
403
|
{ index: reprIndex,
|
|
404
|
+
cdnMetadata: [
|
|
405
|
+
{ baseUrl },
|
|
406
|
+
],
|
|
407
407
|
mimeType,
|
|
408
408
|
codecs,
|
|
409
409
|
id });
|
|
@@ -452,7 +452,11 @@ function createSmoothStreamingParser(
|
|
|
452
452
|
url? : string,
|
|
453
453
|
manifestReceivedTime? : number
|
|
454
454
|
) : IParsedManifest {
|
|
455
|
-
|
|
455
|
+
let baseUrl : string = "";
|
|
456
|
+
if (url !== undefined) {
|
|
457
|
+
const filenameIdx = getFilenameIndexInUrl(url);
|
|
458
|
+
baseUrl = url.substring(0, filenameIdx);
|
|
459
|
+
}
|
|
456
460
|
const root = doc.documentElement;
|
|
457
461
|
if (root == null || root.nodeName !== "SmoothStreamingMedia") {
|
|
458
462
|
throw new Error("document root should be SmoothStreamingMedia");
|
|
@@ -510,7 +514,7 @@ function createSmoothStreamingParser(
|
|
|
510
514
|
const adaptations: IParsedAdaptations = adaptationNodes
|
|
511
515
|
.reduce((acc: IParsedAdaptations, node : Element) => {
|
|
512
516
|
const adaptation = parseAdaptation({ root: node,
|
|
513
|
-
|
|
517
|
+
baseUrl,
|
|
514
518
|
timescale,
|
|
515
519
|
protections,
|
|
516
520
|
isLive,
|
|
@@ -307,7 +307,7 @@ export default class SmoothRepresentationIndex implements IRepresentationIndex {
|
|
|
307
307
|
return { id: "init",
|
|
308
308
|
isInit: true,
|
|
309
309
|
privateInfos: { smoothInitSegment: this._initSegmentInfos },
|
|
310
|
-
|
|
310
|
+
url: null,
|
|
311
311
|
time: 0,
|
|
312
312
|
end: 0,
|
|
313
313
|
duration: 0,
|
|
@@ -361,7 +361,7 @@ export default class SmoothRepresentationIndex implements IRepresentationIndex {
|
|
|
361
361
|
duration: duration / timescale,
|
|
362
362
|
timescale: 1 as const,
|
|
363
363
|
number,
|
|
364
|
-
|
|
364
|
+
url: replaceSegmentSmoothTokens(media, time),
|
|
365
365
|
complete: true,
|
|
366
366
|
privateInfos: { smoothMediaSegment: { time,
|
|
367
367
|
duration } } };
|