rx-player 4.0.0-dev.202402213 → 4.0.0-dev.2024022300
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/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +8 -9
- package/dist/commonjs/features/features_object.js +1 -1
- package/dist/commonjs/features/list/dash.js +2 -2
- package/dist/commonjs/features/types.d.ts +8 -3
- package/dist/commonjs/main_thread/api/public_api.js +2 -7
- package/dist/commonjs/multithread_types.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +4 -3
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +11 -4
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +2 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +12 -3
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +3 -2
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +22 -11
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +11 -2
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +74 -3
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +2 -1
- package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +3 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.d.ts +17 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.js +19 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +400 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +33 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +70 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +118 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +154 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +70 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +221 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +179 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +256 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +23 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +152 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +60 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +125 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +22 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +36 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +82 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +176 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +382 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +24 -0
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +142 -0
- package/dist/commonjs/parsers/manifest/dash/node_parser_types.d.ts +5 -3
- package/dist/commonjs/public_types.d.ts +1 -1
- package/dist/commonjs/transports/dash/manifest_parser.js +33 -4
- package/dist/commonjs/utils/xml-parser.d.ts +70 -0
- package/dist/commonjs/utils/xml-parser.js +357 -0
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +8 -9
- package/dist/es2017/features/features_object.js +1 -1
- package/dist/es2017/features/list/dash.js +2 -2
- package/dist/es2017/features/types.d.ts +8 -3
- package/dist/es2017/main_thread/api/public_api.js +2 -7
- package/dist/es2017/multithread_types.d.ts +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +4 -3
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +12 -5
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +2 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +13 -4
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +3 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +22 -11
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +11 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +49 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +2 -1
- package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +3 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.d.ts +17 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.js +17 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +358 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +30 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +45 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +77 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +101 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +45 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +179 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +137 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +214 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +23 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +111 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +41 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +84 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +22 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +33 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +57 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +176 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +310 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +24 -0
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +114 -0
- package/dist/es2017/parsers/manifest/dash/node_parser_types.d.ts +5 -3
- package/dist/es2017/public_types.d.ts +1 -1
- package/dist/es2017/transports/dash/manifest_parser.js +33 -4
- package/dist/es2017/utils/xml-parser.d.ts +70 -0
- package/dist/es2017/utils/xml-parser.js +322 -0
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +141 -65
- package/dist/rx-player.min.js +1 -1
- package/dist/worker.js +8 -3
- package/package.json +1 -1
- package/.vscode/settings.json +0 -9
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/index.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/index.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/index.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/index.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.js +0 -0
|
@@ -5,6 +5,7 @@ import log from "../../../log";
|
|
|
5
5
|
import Manifest, { Adaptation, Period, Representation } from "../../../manifest/classes";
|
|
6
6
|
import MainCodecSupportProber from "../../../mse/main_codec_support_prober";
|
|
7
7
|
import WorkerCodecSupportProber from "../../../mse/worker_codec_support_prober";
|
|
8
|
+
import DashFastJsParser from "../../../parsers/manifest/dash/fast-js-parser";
|
|
8
9
|
import DashWasmParser from "../../../parsers/manifest/dash/wasm-parser";
|
|
9
10
|
import { ObservationPosition } from "../../../playback_observer";
|
|
10
11
|
import WorkerPlaybackObserver from "../../../playback_observer/worker_playback_observer";
|
|
@@ -46,6 +47,7 @@ export default function initializeWorkerMain() {
|
|
|
46
47
|
// TODO allow worker-side feature-switching? Not sure how
|
|
47
48
|
const dashWasmParser = new DashWasmParser();
|
|
48
49
|
features.dashParsers.wasm = dashWasmParser;
|
|
50
|
+
features.dashParsers.fastJs = DashFastJsParser;
|
|
49
51
|
features.transports.dash = createDashPipelines;
|
|
50
52
|
/**
|
|
51
53
|
* When set, emit playback observation made on the main thread.
|
|
@@ -64,16 +66,12 @@ export default function initializeWorkerMain() {
|
|
|
64
66
|
const diffWorker = Date.now() - performance.now();
|
|
65
67
|
mainThreadTimestampDiff.setValueIfChanged(diffWorker - diffMain);
|
|
66
68
|
updateLoggerLevel(msg.value.logLevel, msg.value.sendBackLogs);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
log.error("Worker: Could not initialize DASH_WASM parser", error);
|
|
72
|
-
sendMessage({
|
|
73
|
-
type: "init-error" /* WorkerMessageType.InitError */,
|
|
74
|
-
value: { errorMessage: error, kind: "dashWasmInitialization" },
|
|
69
|
+
if (msg.value.dashWasmUrl !== undefined && dashWasmParser.isCompatible()) {
|
|
70
|
+
dashWasmParser.initialize({ wasmUrl: msg.value.dashWasmUrl }).catch((err) => {
|
|
71
|
+
const error = err instanceof Error ? err.toString() : "Unknown Error";
|
|
72
|
+
log.error("Worker: Could not initialize DASH_WASM parser", error);
|
|
75
73
|
});
|
|
76
|
-
}
|
|
74
|
+
}
|
|
77
75
|
if (!msg.value.hasVideo || msg.value.hasMseInWorker) {
|
|
78
76
|
contentPreparer.disposeCurrentContent();
|
|
79
77
|
contentPreparer = new ContentPreparer({
|
|
@@ -84,6 +82,7 @@ export default function initializeWorkerMain() {
|
|
|
84
82
|
features.codecSupportProber = msg.value.hasMseInWorker
|
|
85
83
|
? MainCodecSupportProber
|
|
86
84
|
: WorkerCodecSupportProber;
|
|
85
|
+
sendMessage({ type: "init-success" /* WorkerMessageType.InitSuccess */, value: null });
|
|
87
86
|
break;
|
|
88
87
|
case "log-level-update" /* MainThreadMessageType.LogLevelUpdate */:
|
|
89
88
|
updateLoggerLevel(msg.value.logLevel, msg.value.sendBackLogs);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import MediaSourceContentInitializer from "../../main_thread/init/media_source_content_initializer";
|
|
17
17
|
import mainCodecSupportProber from "../../mse/main_codec_support_prober";
|
|
18
|
-
import dashJsParser from "../../parsers/manifest/dash/
|
|
18
|
+
import dashJsParser from "../../parsers/manifest/dash/native-parser";
|
|
19
19
|
import dash from "../../transports/dash";
|
|
20
20
|
/**
|
|
21
21
|
* Add ability to play DASH contents.
|
|
@@ -25,7 +25,7 @@ function addDASHFeature(features) {
|
|
|
25
25
|
if (features.transports.dash === undefined) {
|
|
26
26
|
features.transports.dash = dash;
|
|
27
27
|
}
|
|
28
|
-
features.dashParsers.
|
|
28
|
+
features.dashParsers.native = dashJsParser;
|
|
29
29
|
features.mainThreadMediaSourceInit = MediaSourceContentInitializer;
|
|
30
30
|
features.codecSupportProber = mainCodecSupportProber;
|
|
31
31
|
}
|
|
@@ -48,7 +48,8 @@ export type IHTMLTextTracksBuffer = new (mediaElement: HTMLMediaElement, textTra
|
|
|
48
48
|
* @returns {Object} - `SegmentSink` implementation.
|
|
49
49
|
*/
|
|
50
50
|
export type INativeTextTracksBuffer = new (mediaElement: HTMLMediaElement) => SegmentSink;
|
|
51
|
-
export type
|
|
51
|
+
export type IDashNativeParser = (dom: Document, args: IMPDParserArguments) => IDashParserResponse<string>;
|
|
52
|
+
export type IDashFastJsParser = (xml: string, args: IMPDParserArguments) => IDashParserResponse<string>;
|
|
52
53
|
/**
|
|
53
54
|
* Function implementing the optional RxPlayer debug UI element.
|
|
54
55
|
* @param {HTMLElement} parentElt - `HTMLElement` in which the debug UI
|
|
@@ -121,9 +122,13 @@ export interface IFeaturesObject {
|
|
|
121
122
|
*/
|
|
122
123
|
wasm: DashWasmParser | null;
|
|
123
124
|
/**
|
|
124
|
-
* JavaScript-based Manifest DASH parser.
|
|
125
|
+
* Entirely JavaScript-based Manifest DASH parser.
|
|
125
126
|
*/
|
|
126
|
-
|
|
127
|
+
fastJs: IDashFastJsParser | null;
|
|
128
|
+
/**
|
|
129
|
+
* JavaScript+Browser's DOMParser-based Manifest DASH parser.
|
|
130
|
+
*/
|
|
131
|
+
native: IDashNativeParser | null;
|
|
127
132
|
};
|
|
128
133
|
/** Implement text track rendering through `<track>` HTML elements. */
|
|
129
134
|
nativeTextDisplayer: typeof NativeTextDisplayer | null;
|
|
@@ -21,7 +21,6 @@ import canRelyOnVideoVisibilityAndSize from "../../compat/can_rely_on_video_visi
|
|
|
21
21
|
import { getPictureOnPictureStateRef, getVideoVisibilityRef, getElementResolutionRef, getScreenResolutionRef, } from "../../compat/event_listeners";
|
|
22
22
|
import getStartDate from "../../compat/get_start_date";
|
|
23
23
|
import hasMseInWorker from "../../compat/has_mse_in_worker";
|
|
24
|
-
import hasWebassembly from "../../compat/has_webassembly";
|
|
25
24
|
import isDebugModeEnabled from "../../compat/is_debug_mode_enabled";
|
|
26
25
|
import { ErrorCodes, ErrorTypes, formatError, MediaError } from "../../errors";
|
|
27
26
|
import WorkerInitializationError from "../../errors/worker_initialization_error";
|
|
@@ -103,7 +102,7 @@ class Player extends EventEmitter {
|
|
|
103
102
|
// Workaround to support Firefox autoplay on FF 42.
|
|
104
103
|
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
|
|
105
104
|
videoElement.preload = "auto";
|
|
106
|
-
this.version = /* PLAYER_VERSION */ "4.0.0-dev.
|
|
105
|
+
this.version = /* PLAYER_VERSION */ "4.0.0-dev.2024022300";
|
|
107
106
|
this.log = log;
|
|
108
107
|
this.state = "STOPPED";
|
|
109
108
|
this.videoElement = videoElement;
|
|
@@ -152,10 +151,6 @@ class Player extends EventEmitter {
|
|
|
152
151
|
log.warn("API: Cannot rely on a WebWorker: Worker API unavailable");
|
|
153
152
|
return rej(new WorkerInitializationError("INCOMPATIBLE_ERROR", "Worker unavailable"));
|
|
154
153
|
}
|
|
155
|
-
if (!hasWebassembly) {
|
|
156
|
-
log.warn("API: Cannot rely on a WebWorker: WebAssembly unavailable");
|
|
157
|
-
return rej(new WorkerInitializationError("INCOMPATIBLE_ERROR", "WebAssembly unavailable"));
|
|
158
|
-
}
|
|
159
154
|
if (typeof workerSettings.workerUrl === "string") {
|
|
160
155
|
this._priv_worker = new Worker(workerSettings.workerUrl);
|
|
161
156
|
}
|
|
@@ -2348,5 +2343,5 @@ class Player extends EventEmitter {
|
|
|
2348
2343
|
}
|
|
2349
2344
|
}
|
|
2350
2345
|
}
|
|
2351
|
-
Player.version = /* PLAYER_VERSION */ "4.0.0-dev.
|
|
2346
|
+
Player.version = /* PLAYER_VERSION */ "4.0.0-dev.2024022300";
|
|
2352
2347
|
export default Player;
|
|
@@ -25,7 +25,7 @@ export interface IInitMessage {
|
|
|
25
25
|
type: MainThreadMessageType.Init;
|
|
26
26
|
value: {
|
|
27
27
|
/** Link to the DASH_WASM's feature WebAssembly file to parse DASH MPDs. */
|
|
28
|
-
dashWasmUrl: string;
|
|
28
|
+
dashWasmUrl: string | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* If `true` the final element on the current page displaying the content
|
|
31
31
|
* can display video content.
|
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
16
17
|
import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
17
18
|
/**
|
|
18
19
|
* Allows to generate the "timeline" for the "Timeline" RepresentationIndex.
|
|
19
20
|
* Call this function when the timeline is unknown.
|
|
20
21
|
* This function was added to only perform that task lazily, i.e. only when
|
|
21
22
|
* first needed.
|
|
22
|
-
* @param {HTMLCollection} elements - All S nodes constituting
|
|
23
|
-
* SegmentTimeline node.
|
|
23
|
+
* @param {Array.<Object>|HTMLCollection} elements - All S nodes constituting
|
|
24
|
+
* the corresponding SegmentTimeline node.
|
|
24
25
|
* @returns {Array.<Object>}
|
|
25
26
|
*/
|
|
26
|
-
export default function constructTimelineFromElements(elements: HTMLCollection): IIndexSegment[];
|
|
27
|
+
export default function constructTimelineFromElements(elements: ITNode[] | HTMLCollection): IIndexSegment[];
|
|
@@ -14,20 +14,27 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import convertElementsToIndexSegment from "./convert_element_to_index_segment";
|
|
17
|
-
import
|
|
17
|
+
import { parseSElementNode, parseSHTMLElement } from "./parse_s_element";
|
|
18
18
|
/**
|
|
19
19
|
* Allows to generate the "timeline" for the "Timeline" RepresentationIndex.
|
|
20
20
|
* Call this function when the timeline is unknown.
|
|
21
21
|
* This function was added to only perform that task lazily, i.e. only when
|
|
22
22
|
* first needed.
|
|
23
|
-
* @param {HTMLCollection} elements - All S nodes constituting
|
|
24
|
-
* SegmentTimeline node.
|
|
23
|
+
* @param {Array.<Object>|HTMLCollection} elements - All S nodes constituting
|
|
24
|
+
* the corresponding SegmentTimeline node.
|
|
25
25
|
* @returns {Array.<Object>}
|
|
26
26
|
*/
|
|
27
27
|
export default function constructTimelineFromElements(elements) {
|
|
28
28
|
const initialTimeline = [];
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (Array.isArray(elements)) {
|
|
30
|
+
for (let i = 0; i < elements.length; i++) {
|
|
31
|
+
initialTimeline.push(parseSElementNode(elements[i]));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
for (let i = 0; i < elements.length; i++) {
|
|
36
|
+
initialTimeline.push(parseSHTMLElement(elements[i]));
|
|
37
|
+
}
|
|
31
38
|
}
|
|
32
39
|
const timeline = [];
|
|
33
40
|
for (let i = 0; i < initialTimeline.length; i++) {
|
|
@@ -13,5 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
16
17
|
import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
17
|
-
export default function constructTimelineFromPreviousTimeline(newElements: HTMLCollection, prevTimeline: IIndexSegment[]): IIndexSegment[];
|
|
18
|
+
export default function constructTimelineFromPreviousTimeline(newElements: ITNode[] | HTMLCollection, prevTimeline: IIndexSegment[]): IIndexSegment[];
|
|
@@ -17,7 +17,7 @@ import log from "../../../../../../log";
|
|
|
17
17
|
import constructTimelineFromElements from "./construct_timeline_from_elements";
|
|
18
18
|
import convertElementToIndexSegment from "./convert_element_to_index_segment";
|
|
19
19
|
import findFirstCommonStartTime from "./find_first_common_start_time";
|
|
20
|
-
import
|
|
20
|
+
import { parseSElementNode, parseSHTMLElement } from "./parse_s_element";
|
|
21
21
|
export default function constructTimelineFromPreviousTimeline(newElements, prevTimeline) {
|
|
22
22
|
var _a;
|
|
23
23
|
// Find first index in both timeline where a common segment is found.
|
|
@@ -47,7 +47,9 @@ export default function constructTimelineFromPreviousTimeline(newElements, prevT
|
|
|
47
47
|
return constructTimelineFromElements(newElements);
|
|
48
48
|
}
|
|
49
49
|
const prevLastElement = newTimeline[newTimeline.length - 1];
|
|
50
|
-
const newCommonElt =
|
|
50
|
+
const newCommonElt = Array.isArray(newElements)
|
|
51
|
+
? parseSElementNode(newElements[lastCommonEltNewEltsIdx])
|
|
52
|
+
: parseSHTMLElement(newElements[lastCommonEltNewEltsIdx]);
|
|
51
53
|
const newRepeatCountOffseted = ((_a = newCommonElt.repeatCount) !== null && _a !== void 0 ? _a : 0) - repeatNumberInNewElements;
|
|
52
54
|
if (newCommonElt.duration !== prevLastElement.duration ||
|
|
53
55
|
prevLastElement.repeatCount > newRepeatCountOffseted) {
|
|
@@ -61,8 +63,15 @@ export default function constructTimelineFromPreviousTimeline(newElements, prevT
|
|
|
61
63
|
}
|
|
62
64
|
const newEltsToPush = [];
|
|
63
65
|
const items = [];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
if (Array.isArray(newElements)) {
|
|
67
|
+
for (let i = lastCommonEltNewEltsIdx + 1; i < newElements.length; i++) {
|
|
68
|
+
items.push(parseSElementNode(newElements[i]));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
for (let i = lastCommonEltNewEltsIdx + 1; i < newElements.length; i++) {
|
|
73
|
+
items.push(parseSHTMLElement(newElements[i]));
|
|
74
|
+
}
|
|
66
75
|
}
|
|
67
76
|
for (let i = 0; i < items.length; i++) {
|
|
68
77
|
const item = items[i];
|
package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
16
17
|
import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
17
18
|
/**
|
|
18
19
|
* By comparing two timelines for the same content at different points in time,
|
|
@@ -20,10 +21,10 @@ import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
|
20
21
|
* starting time.
|
|
21
22
|
* Returns `null` if not found.
|
|
22
23
|
* @param {Array.<Object>} prevTimeline
|
|
23
|
-
* @param {
|
|
24
|
+
* @param {Array.<Object>} newElements
|
|
24
25
|
* @returns {Object|null}
|
|
25
26
|
*/
|
|
26
|
-
export default function findFirstCommonStartTime(prevTimeline: IIndexSegment[], newElements: HTMLCollection): {
|
|
27
|
+
export default function findFirstCommonStartTime(prevTimeline: IIndexSegment[], newElements: ITNode[] | HTMLCollection): {
|
|
27
28
|
/** Index in `prevSegments` where the first common segment start is found. */
|
|
28
29
|
prevSegmentsIdx: number;
|
|
29
30
|
/** Index in `newElements` where the first common segment start is found. */
|
package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js
CHANGED
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import isNullOrUndefined from "../../../../../../utils/is_null_or_undefined";
|
|
16
17
|
/**
|
|
17
18
|
* By comparing two timelines for the same content at different points in time,
|
|
18
19
|
* retrieve the index in both timelines of the first segment having the same
|
|
19
20
|
* starting time.
|
|
20
21
|
* Returns `null` if not found.
|
|
21
22
|
* @param {Array.<Object>} prevTimeline
|
|
22
|
-
* @param {
|
|
23
|
+
* @param {Array.<Object>} newElements
|
|
23
24
|
* @returns {Object|null}
|
|
24
25
|
*/
|
|
25
26
|
export default function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
@@ -27,8 +28,12 @@ export default function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
29
30
|
const prevInitialStart = prevTimeline[0].start;
|
|
30
|
-
const newFirstTAttr =
|
|
31
|
-
|
|
31
|
+
const newFirstTAttr = Array.isArray(newElements)
|
|
32
|
+
? newElements[0].attributes.t
|
|
33
|
+
: newElements[0].getAttribute("t");
|
|
34
|
+
const newInitialStart = isNullOrUndefined(newFirstTAttr)
|
|
35
|
+
? null
|
|
36
|
+
: parseInt(newFirstTAttr, 10);
|
|
32
37
|
if (newInitialStart === null || Number.isNaN(newInitialStart)) {
|
|
33
38
|
return null;
|
|
34
39
|
}
|
|
@@ -77,16 +82,17 @@ export default function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
|
77
82
|
}
|
|
78
83
|
else {
|
|
79
84
|
let newElementsIdx = 0;
|
|
80
|
-
let
|
|
85
|
+
let newNodeElt = Array.isArray(newElements) ? newElements[0] : null;
|
|
86
|
+
let newDomElt = Array.isArray(newElements) ? null : newElements[0];
|
|
81
87
|
let currentTimeOffset = newInitialStart;
|
|
82
88
|
while (true) {
|
|
83
|
-
const dAttr =
|
|
84
|
-
const duration = dAttr
|
|
89
|
+
const dAttr = newNodeElt !== null ? newNodeElt.attributes.d : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("d");
|
|
90
|
+
const duration = isNullOrUndefined(dAttr) ? null : parseInt(dAttr, 10);
|
|
85
91
|
if (duration === null || Number.isNaN(duration)) {
|
|
86
92
|
return null;
|
|
87
93
|
}
|
|
88
|
-
const rAttr =
|
|
89
|
-
const repeatCount = rAttr
|
|
94
|
+
const rAttr = newNodeElt !== null ? newNodeElt.attributes.r : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("r");
|
|
95
|
+
const repeatCount = isNullOrUndefined(rAttr) ? null : parseInt(rAttr, 10);
|
|
90
96
|
if (repeatCount !== null) {
|
|
91
97
|
if (Number.isNaN(repeatCount) || repeatCount < 0) {
|
|
92
98
|
return null;
|
|
@@ -112,9 +118,14 @@ export default function findFirstCommonStartTime(prevTimeline, newElements) {
|
|
|
112
118
|
if (newElementsIdx >= newElements.length) {
|
|
113
119
|
return null;
|
|
114
120
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
if (Array.isArray(newElements)) {
|
|
122
|
+
newNodeElt = newElements[newElementsIdx];
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
newDomElt = newElements[newElementsIdx];
|
|
126
|
+
}
|
|
127
|
+
const tAttr = newNodeElt !== null ? newNodeElt.attributes.t : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("t");
|
|
128
|
+
const time = isNullOrUndefined(tAttr) ? null : parseInt(tAttr, 10);
|
|
118
129
|
if (time !== null) {
|
|
119
130
|
if (Number.isNaN(time)) {
|
|
120
131
|
return null;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
16
17
|
/** SegmentTimeline `S` element once parsed. */
|
|
17
18
|
export interface IParsedS {
|
|
18
19
|
/** Start time in a previously-given timescaled unit. */
|
|
@@ -27,8 +28,16 @@ export interface IParsedS {
|
|
|
27
28
|
duration?: number;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
* Parse a given <S> element in the MPD into a JS
|
|
31
|
+
* Parse a given <S> element in the MPD under a parsed Node form into a JS
|
|
32
|
+
* Object.
|
|
33
|
+
* @param {Object} root
|
|
34
|
+
* @returns {Object}
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseSElementNode(root: ITNode): IParsedS;
|
|
37
|
+
/**
|
|
38
|
+
* Parse a given <S> element in the MPD under an `Element` form into a JS
|
|
39
|
+
* Object.
|
|
31
40
|
* @param {Element} root
|
|
32
41
|
* @returns {Object}
|
|
33
42
|
*/
|
|
34
|
-
export
|
|
43
|
+
export declare function parseSHTMLElement(root: Element): IParsedS;
|
|
@@ -14,12 +14,59 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import log from "../../../../../../log";
|
|
17
|
+
import isNullOrUndefined from "../../../../../../utils/is_null_or_undefined";
|
|
17
18
|
/**
|
|
18
|
-
* Parse a given <S> element in the MPD into a JS
|
|
19
|
+
* Parse a given <S> element in the MPD under a parsed Node form into a JS
|
|
20
|
+
* Object.
|
|
21
|
+
* @param {Object} root
|
|
22
|
+
* @returns {Object}
|
|
23
|
+
*/
|
|
24
|
+
export function parseSElementNode(root) {
|
|
25
|
+
const parsedS = {};
|
|
26
|
+
for (const attributeName of Object.keys(root.attributes)) {
|
|
27
|
+
const attributeVal = root.attributes[attributeName];
|
|
28
|
+
if (isNullOrUndefined(attributeVal)) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
switch (attributeName) {
|
|
32
|
+
case "t":
|
|
33
|
+
const start = parseInt(attributeVal, 10);
|
|
34
|
+
if (isNaN(start)) {
|
|
35
|
+
log.warn(`DASH: invalid t ("${attributeVal}")`);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
parsedS.start = start;
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
case "d":
|
|
42
|
+
const duration = parseInt(attributeVal, 10);
|
|
43
|
+
if (isNaN(duration)) {
|
|
44
|
+
log.warn(`DASH: invalid d ("${attributeVal}")`);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
parsedS.duration = duration;
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
case "r":
|
|
51
|
+
const repeatCount = parseInt(attributeVal, 10);
|
|
52
|
+
if (isNaN(repeatCount)) {
|
|
53
|
+
log.warn(`DASH: invalid r ("${attributeVal}")`);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
parsedS.repeatCount = repeatCount;
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return parsedS;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Parse a given <S> element in the MPD under an `Element` form into a JS
|
|
65
|
+
* Object.
|
|
19
66
|
* @param {Element} root
|
|
20
67
|
* @returns {Object}
|
|
21
68
|
*/
|
|
22
|
-
export
|
|
69
|
+
export function parseSHTMLElement(root) {
|
|
23
70
|
const parsedS = {};
|
|
24
71
|
for (let j = 0; j < root.attributes.length; j++) {
|
|
25
72
|
const attribute = root.attributes[j];
|
package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IRepresentationIndex, ISegment, IRepresentation } from "../../../../../../manifest";
|
|
17
17
|
import type { IPlayerError } from "../../../../../../public_types";
|
|
18
|
+
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
18
19
|
import type { IEMSG } from "../../../../../containers/isobmff";
|
|
19
20
|
import type { IIndexSegment } from "../../../../utils/index_helpers";
|
|
20
21
|
import type { ISegmentTimelineElement } from "../../../node_parser_types";
|
|
@@ -120,7 +121,7 @@ export interface ITimelineIndexIndexArgument {
|
|
|
120
121
|
* timescale (see timescale)
|
|
121
122
|
*/
|
|
122
123
|
presentationTimeOffset?: number | undefined;
|
|
123
|
-
timelineParser?: (() => HTMLCollection) | undefined;
|
|
124
|
+
timelineParser?: (() => ITNode[] | HTMLCollection) | undefined;
|
|
124
125
|
timeline?: ISegmentTimelineElement[] | undefined;
|
|
125
126
|
}
|
|
126
127
|
/** Aditional context needed by a SegmentTimeline RepresentationIndex. */
|
|
@@ -243,7 +243,9 @@ function generateStreamEvents(baseIr, periodStart, xmlNamespaces) {
|
|
|
243
243
|
try {
|
|
244
244
|
xmlData = {
|
|
245
245
|
namespaces: allNamespaces,
|
|
246
|
-
data:
|
|
246
|
+
data: typeof eventIr.eventStreamData === "string"
|
|
247
|
+
? eventIr.eventStreamData
|
|
248
|
+
: utf8ToStr(new Uint8Array(eventIr.eventStreamData)),
|
|
247
249
|
};
|
|
248
250
|
}
|
|
249
251
|
catch (err) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2015 CANAL+ Group
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import parseFromString from "./parse_from_xml_string";
|
|
17
|
+
export default parseFromString;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2015 CANAL+ Group
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import parseFromString from "./parse_from_xml_string";
|
|
17
|
+
export default parseFromString;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2015 CANAL+ Group
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { ITNode } from "../../../../../utils/xml-parser";
|
|
17
|
+
import type { IAdaptationSetIntermediateRepresentation } from "../../node_parser_types";
|
|
18
|
+
/**
|
|
19
|
+
* Parse an AdaptationSet element into an AdaptationSet intermediate
|
|
20
|
+
* representation.
|
|
21
|
+
* @param {Object} adaptationSetElement - The AdaptationSet root element.
|
|
22
|
+
* @returns {Array.<Object>}
|
|
23
|
+
*/
|
|
24
|
+
export declare function createAdaptationSetIntermediateRepresentation(adaptationSetElement: ITNode): [IAdaptationSetIntermediateRepresentation, Error[]];
|