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
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2015 CANAL+ Group
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
18
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
|
+
if (!m) return o;
|
|
20
|
+
var i = m.call(o), r, ar = [], e;
|
|
21
|
+
try {
|
|
22
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
23
|
+
}
|
|
24
|
+
catch (error) { e = { error: error }; }
|
|
25
|
+
finally {
|
|
26
|
+
try {
|
|
27
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
28
|
+
}
|
|
29
|
+
finally { if (e) throw e.error; }
|
|
30
|
+
}
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
var __values = (this && this.__values) || function(o) {
|
|
34
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
35
|
+
if (m) return m.call(o);
|
|
36
|
+
if (o && typeof o.length === "number") return {
|
|
37
|
+
next: function () {
|
|
38
|
+
if (o && i >= o.length) o = void 0;
|
|
39
|
+
return { value: o && o[i++], done: !o };
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
var log_1 = require("../../../../../log");
|
|
46
|
+
var is_null_or_undefined_1 = require("../../../../../utils/is_null_or_undefined");
|
|
47
|
+
var string_parsing_1 = require("../../../../../utils/string_parsing");
|
|
48
|
+
var utils_1 = require("./utils");
|
|
49
|
+
/**
|
|
50
|
+
* @param {Array.<Object | string>} contentProtectionChildren
|
|
51
|
+
* @Returns {Object}
|
|
52
|
+
*/
|
|
53
|
+
function parseContentProtectionChildren(contentProtectionChildren) {
|
|
54
|
+
var warnings = [];
|
|
55
|
+
var cencPssh = [];
|
|
56
|
+
for (var i = 0; i < contentProtectionChildren.length; i++) {
|
|
57
|
+
var currentElement = contentProtectionChildren[i];
|
|
58
|
+
if (typeof currentElement !== "string" && currentElement.tagName === "cenc:pssh") {
|
|
59
|
+
var content = (0, utils_1.textContent)(currentElement.children);
|
|
60
|
+
if (content !== null && content.length > 0) {
|
|
61
|
+
var _a = __read((0, utils_1.parseBase64)(content, "cenc:pssh"), 2), toUint8Array = _a[0], error = _a[1];
|
|
62
|
+
if (error !== null) {
|
|
63
|
+
log_1.default.warn(error.message);
|
|
64
|
+
warnings.push(error);
|
|
65
|
+
}
|
|
66
|
+
if (toUint8Array !== null) {
|
|
67
|
+
cencPssh.push(toUint8Array);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return [{ cencPssh: cencPssh }, warnings];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @param {Object} root
|
|
76
|
+
* @returns {Object}
|
|
77
|
+
*/
|
|
78
|
+
function parseContentProtectionAttributes(root) {
|
|
79
|
+
var e_1, _a;
|
|
80
|
+
var ret = {};
|
|
81
|
+
try {
|
|
82
|
+
for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
83
|
+
var attributeName = _c.value;
|
|
84
|
+
var attributeVal = root.attributes[attributeName];
|
|
85
|
+
if ((0, is_null_or_undefined_1.default)(attributeVal)) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
switch (attributeName) {
|
|
89
|
+
case "schemeIdUri":
|
|
90
|
+
ret.schemeIdUri = attributeVal;
|
|
91
|
+
break;
|
|
92
|
+
case "value":
|
|
93
|
+
ret.value = attributeVal;
|
|
94
|
+
break;
|
|
95
|
+
case "cenc:default_KID":
|
|
96
|
+
ret.keyId = (0, string_parsing_1.hexToBytes)(attributeVal.replace(/-/g, ""));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
101
|
+
finally {
|
|
102
|
+
try {
|
|
103
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
104
|
+
}
|
|
105
|
+
finally { if (e_1) throw e_1.error; }
|
|
106
|
+
}
|
|
107
|
+
return ret;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @param {Object} contentProtectionElement
|
|
111
|
+
* @returns {Object}
|
|
112
|
+
*/
|
|
113
|
+
function parseContentProtection(contentProtectionElement) {
|
|
114
|
+
var _a = __read(parseContentProtectionChildren(contentProtectionElement.children), 2), children = _a[0], childrenWarnings = _a[1];
|
|
115
|
+
var attributes = parseContentProtectionAttributes(contentProtectionElement);
|
|
116
|
+
return [{ children: children, attributes: attributes }, childrenWarnings];
|
|
117
|
+
}
|
|
118
|
+
exports.default = parseContentProtection;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { IEventStreamIntermediateRepresentation } from "../../node_parser_types";
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} root
|
|
20
|
+
* @param {string} fullMpd
|
|
21
|
+
* @returns {Array}
|
|
22
|
+
*/
|
|
23
|
+
export declare function createEventStreamIntermediateRepresentation(root: ITNode, fullMpd: string): [IEventStreamIntermediateRepresentation, Error[]];
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2015 CANAL+ Group
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __values = (this && this.__values) || function(o) {
|
|
18
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
19
|
+
if (m) return m.call(o);
|
|
20
|
+
if (o && typeof o.length === "number") return {
|
|
21
|
+
next: function () {
|
|
22
|
+
if (o && i >= o.length) o = void 0;
|
|
23
|
+
return { value: o && o[i++], done: !o };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
27
|
+
};
|
|
28
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
29
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
30
|
+
if (!m) return o;
|
|
31
|
+
var i = m.call(o), r, ar = [], e;
|
|
32
|
+
try {
|
|
33
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
34
|
+
}
|
|
35
|
+
catch (error) { e = { error: error }; }
|
|
36
|
+
finally {
|
|
37
|
+
try {
|
|
38
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
39
|
+
}
|
|
40
|
+
finally { if (e) throw e.error; }
|
|
41
|
+
}
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.createEventStreamIntermediateRepresentation = void 0;
|
|
46
|
+
var is_null_or_undefined_1 = require("../../../../../utils/is_null_or_undefined");
|
|
47
|
+
var starts_with_1 = require("../../../../../utils/starts_with");
|
|
48
|
+
var utils_1 = require("./utils");
|
|
49
|
+
/**
|
|
50
|
+
* @param {Object} root
|
|
51
|
+
* @returns {Array}
|
|
52
|
+
*/
|
|
53
|
+
function parseEventStreamAttributes(root) {
|
|
54
|
+
var e_1, _a;
|
|
55
|
+
var res = {};
|
|
56
|
+
var warnings = [];
|
|
57
|
+
var parseValue = (0, utils_1.ValueParser)(res, warnings);
|
|
58
|
+
try {
|
|
59
|
+
for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
60
|
+
var attributeName = _c.value;
|
|
61
|
+
var attributeVal = root.attributes[attributeName];
|
|
62
|
+
if ((0, is_null_or_undefined_1.default)(attributeVal)) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
switch (attributeName) {
|
|
66
|
+
case "schemeIdUri":
|
|
67
|
+
res.schemeIdUri = attributeVal;
|
|
68
|
+
break;
|
|
69
|
+
case "value":
|
|
70
|
+
res.value = attributeVal;
|
|
71
|
+
break;
|
|
72
|
+
case "timescale":
|
|
73
|
+
parseValue(attributeVal, {
|
|
74
|
+
asKey: "timescale",
|
|
75
|
+
parser: utils_1.parseMPDInteger,
|
|
76
|
+
dashName: "timescale",
|
|
77
|
+
});
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
if ((0, starts_with_1.default)(attributeName, "xmlns:")) {
|
|
81
|
+
if (res.namespaces === undefined) {
|
|
82
|
+
res.namespaces = [];
|
|
83
|
+
}
|
|
84
|
+
res.namespaces.push({
|
|
85
|
+
key: attributeName.substring(6),
|
|
86
|
+
value: attributeVal,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
94
|
+
finally {
|
|
95
|
+
try {
|
|
96
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
97
|
+
}
|
|
98
|
+
finally { if (e_1) throw e_1.error; }
|
|
99
|
+
}
|
|
100
|
+
return [res, warnings];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @param {Object} root
|
|
104
|
+
* @param {string} fullMpd
|
|
105
|
+
* @returns {Array}
|
|
106
|
+
*/
|
|
107
|
+
function createEventStreamIntermediateRepresentation(root, fullMpd) {
|
|
108
|
+
var e_2, _a;
|
|
109
|
+
var _b = __read(parseEventStreamAttributes(root), 2), attributes = _b[0], warnings = _b[1];
|
|
110
|
+
var events = [];
|
|
111
|
+
try {
|
|
112
|
+
for (var _c = __values(root.children), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
113
|
+
var child = _d.value;
|
|
114
|
+
if (typeof child !== "string" && child.tagName === "Event") {
|
|
115
|
+
var data = {};
|
|
116
|
+
if (!(0, is_null_or_undefined_1.default)(child.attributes.id)) {
|
|
117
|
+
data.id = child.attributes.id;
|
|
118
|
+
}
|
|
119
|
+
if (!(0, is_null_or_undefined_1.default)(child.attributes.presentationTime)) {
|
|
120
|
+
var _e = __read((0, utils_1.parseMPDInteger)(child.attributes.presentationTime, "presentationTime"), 2), val = _e[0], parsedWarning = _e[1];
|
|
121
|
+
if (parsedWarning !== null) {
|
|
122
|
+
warnings.push(parsedWarning);
|
|
123
|
+
}
|
|
124
|
+
if (val !== null) {
|
|
125
|
+
data.presentationTime = val;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (!(0, is_null_or_undefined_1.default)(child.attributes.duration)) {
|
|
129
|
+
var _f = __read((0, utils_1.parseMPDInteger)(child.attributes.duration, "duration"), 2), val = _f[0], parsedWarning = _f[1];
|
|
130
|
+
if (parsedWarning !== null) {
|
|
131
|
+
warnings.push(parsedWarning);
|
|
132
|
+
}
|
|
133
|
+
if (val !== null) {
|
|
134
|
+
data.duration = val;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (child.posStart < child.posEnd) {
|
|
138
|
+
var eventStr = fullMpd.substring(child.posStart, child.posEnd);
|
|
139
|
+
data.eventStreamData = eventStr;
|
|
140
|
+
}
|
|
141
|
+
events.push(data);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
146
|
+
finally {
|
|
147
|
+
try {
|
|
148
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
149
|
+
}
|
|
150
|
+
finally { if (e_2) throw e_2.error; }
|
|
151
|
+
}
|
|
152
|
+
return [{ children: { events: events }, attributes: attributes }, warnings];
|
|
153
|
+
}
|
|
154
|
+
exports.createEventStreamIntermediateRepresentation = createEventStreamIntermediateRepresentation;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { IInitializationAttributes } from "../../node_parser_types";
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} root
|
|
20
|
+
* @returns {Array.<Object>}
|
|
21
|
+
*/
|
|
22
|
+
export default function parseInitialization(root: ITNode): [IInitializationAttributes, Error[]];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2015 CANAL+ Group
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __values = (this && this.__values) || function(o) {
|
|
18
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
19
|
+
if (m) return m.call(o);
|
|
20
|
+
if (o && typeof o.length === "number") return {
|
|
21
|
+
next: function () {
|
|
22
|
+
if (o && i >= o.length) o = void 0;
|
|
23
|
+
return { value: o && o[i++], done: !o };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var is_null_or_undefined_1 = require("../../../../../utils/is_null_or_undefined");
|
|
30
|
+
var utils_1 = require("./utils");
|
|
31
|
+
/**
|
|
32
|
+
* @param {Object} root
|
|
33
|
+
* @returns {Array.<Object>}
|
|
34
|
+
*/
|
|
35
|
+
function parseInitialization(root) {
|
|
36
|
+
var e_1, _a;
|
|
37
|
+
var parsedInitialization = {};
|
|
38
|
+
var warnings = [];
|
|
39
|
+
var parseValue = (0, utils_1.ValueParser)(parsedInitialization, warnings);
|
|
40
|
+
try {
|
|
41
|
+
for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
42
|
+
var attributeName = _c.value;
|
|
43
|
+
var attributeVal = root.attributes[attributeName];
|
|
44
|
+
if ((0, is_null_or_undefined_1.default)(attributeVal)) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
switch (attributeName) {
|
|
48
|
+
case "range":
|
|
49
|
+
parseValue(attributeVal, {
|
|
50
|
+
asKey: "range",
|
|
51
|
+
parser: utils_1.parseByteRange,
|
|
52
|
+
dashName: "range",
|
|
53
|
+
});
|
|
54
|
+
break;
|
|
55
|
+
case "sourceURL":
|
|
56
|
+
parsedInitialization.media = attributeVal;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
62
|
+
finally {
|
|
63
|
+
try {
|
|
64
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
65
|
+
}
|
|
66
|
+
finally { if (e_1) throw e_1.error; }
|
|
67
|
+
}
|
|
68
|
+
return [parsedInitialization, warnings];
|
|
69
|
+
}
|
|
70
|
+
exports.default = parseInitialization;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { IMPDIntermediateRepresentation } from "../../node_parser_types";
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} root
|
|
20
|
+
* @param {string} fullMpd
|
|
21
|
+
* @returns {Array.<Object>}
|
|
22
|
+
*/
|
|
23
|
+
export declare function createMPDIntermediateRepresentation(root: ITNode, fullMpd: string): [IMPDIntermediateRepresentation, Error[]];
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2015 CANAL+ Group
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
18
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
|
+
if (!m) return o;
|
|
20
|
+
var i = m.call(o), r, ar = [], e;
|
|
21
|
+
try {
|
|
22
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
23
|
+
}
|
|
24
|
+
catch (error) { e = { error: error }; }
|
|
25
|
+
finally {
|
|
26
|
+
try {
|
|
27
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
28
|
+
}
|
|
29
|
+
finally { if (e) throw e.error; }
|
|
30
|
+
}
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
var __values = (this && this.__values) || function(o) {
|
|
34
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
35
|
+
if (m) return m.call(o);
|
|
36
|
+
if (o && typeof o.length === "number") return {
|
|
37
|
+
next: function () {
|
|
38
|
+
if (o && i >= o.length) o = void 0;
|
|
39
|
+
return { value: o && o[i++], done: !o };
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.createMPDIntermediateRepresentation = void 0;
|
|
46
|
+
var is_null_or_undefined_1 = require("../../../../../utils/is_null_or_undefined");
|
|
47
|
+
var starts_with_1 = require("../../../../../utils/starts_with");
|
|
48
|
+
var BaseURL_1 = require("./BaseURL");
|
|
49
|
+
var Period_1 = require("./Period");
|
|
50
|
+
var utils_1 = require("./utils");
|
|
51
|
+
/**
|
|
52
|
+
* Parse children of the MPD's root into a simple object.
|
|
53
|
+
* @param {Array.<Object | string>} mpdChildren
|
|
54
|
+
* @returns {Array.<Object>}
|
|
55
|
+
*/
|
|
56
|
+
function parseMPDChildren(mpdChildren, fullMpd) {
|
|
57
|
+
var baseURLs = [];
|
|
58
|
+
var locations = [];
|
|
59
|
+
var periods = [];
|
|
60
|
+
var utcTimings = [];
|
|
61
|
+
var warnings = [];
|
|
62
|
+
for (var i = 0; i < mpdChildren.length; i++) {
|
|
63
|
+
var currentNode = mpdChildren[i];
|
|
64
|
+
if (typeof currentNode === "string") {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
switch (currentNode.tagName) {
|
|
68
|
+
case "BaseURL":
|
|
69
|
+
var _a = __read((0, BaseURL_1.default)(currentNode), 2), baseURLObj = _a[0], baseURLWarnings = _a[1];
|
|
70
|
+
if (baseURLObj !== undefined) {
|
|
71
|
+
baseURLs.push(baseURLObj);
|
|
72
|
+
}
|
|
73
|
+
warnings = warnings.concat(baseURLWarnings);
|
|
74
|
+
break;
|
|
75
|
+
case "Location":
|
|
76
|
+
locations.push((0, utils_1.textContent)(currentNode.children));
|
|
77
|
+
break;
|
|
78
|
+
case "Period":
|
|
79
|
+
var _b = __read((0, Period_1.createPeriodIntermediateRepresentation)(currentNode, fullMpd), 2), period = _b[0], periodWarnings = _b[1];
|
|
80
|
+
periods.push(period);
|
|
81
|
+
warnings = warnings.concat(periodWarnings);
|
|
82
|
+
break;
|
|
83
|
+
case "UTCTiming":
|
|
84
|
+
var utcTiming = (0, utils_1.parseScheme)(currentNode);
|
|
85
|
+
utcTimings.push(utcTiming);
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return [{ baseURLs: baseURLs, locations: locations, periods: periods, utcTimings: utcTimings }, warnings];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @param {Object} root
|
|
93
|
+
* @returns {Array.<Object>}
|
|
94
|
+
*/
|
|
95
|
+
function parseMPDAttributes(root) {
|
|
96
|
+
var e_1, _a;
|
|
97
|
+
var res = {};
|
|
98
|
+
var warnings = [];
|
|
99
|
+
var parseValue = (0, utils_1.ValueParser)(res, warnings);
|
|
100
|
+
try {
|
|
101
|
+
for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
102
|
+
var attributeName = _c.value;
|
|
103
|
+
var attributeVal = root.attributes[attributeName];
|
|
104
|
+
if ((0, is_null_or_undefined_1.default)(attributeVal)) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
switch (attributeName) {
|
|
108
|
+
case "id":
|
|
109
|
+
res.id = attributeVal;
|
|
110
|
+
break;
|
|
111
|
+
case "profiles":
|
|
112
|
+
res.profiles = attributeVal;
|
|
113
|
+
break;
|
|
114
|
+
case "type":
|
|
115
|
+
res.type = attributeVal;
|
|
116
|
+
break;
|
|
117
|
+
case "availabilityStartTime":
|
|
118
|
+
parseValue(attributeVal, {
|
|
119
|
+
asKey: "availabilityStartTime",
|
|
120
|
+
parser: utils_1.parseDateTime,
|
|
121
|
+
dashName: "availabilityStartTime",
|
|
122
|
+
});
|
|
123
|
+
break;
|
|
124
|
+
case "availabilityEndTime":
|
|
125
|
+
parseValue(attributeVal, {
|
|
126
|
+
asKey: "availabilityEndTime",
|
|
127
|
+
parser: utils_1.parseDateTime,
|
|
128
|
+
dashName: "availabilityEndTime",
|
|
129
|
+
});
|
|
130
|
+
break;
|
|
131
|
+
case "publishTime":
|
|
132
|
+
parseValue(attributeVal, {
|
|
133
|
+
asKey: "publishTime",
|
|
134
|
+
parser: utils_1.parseDateTime,
|
|
135
|
+
dashName: "publishTime",
|
|
136
|
+
});
|
|
137
|
+
break;
|
|
138
|
+
case "mediaPresentationDuration":
|
|
139
|
+
parseValue(attributeVal, {
|
|
140
|
+
asKey: "duration",
|
|
141
|
+
parser: utils_1.parseDuration,
|
|
142
|
+
dashName: "mediaPresentationDuration",
|
|
143
|
+
});
|
|
144
|
+
break;
|
|
145
|
+
case "minimumUpdatePeriod":
|
|
146
|
+
parseValue(attributeVal, {
|
|
147
|
+
asKey: "minimumUpdatePeriod",
|
|
148
|
+
parser: utils_1.parseDuration,
|
|
149
|
+
dashName: "minimumUpdatePeriod",
|
|
150
|
+
});
|
|
151
|
+
break;
|
|
152
|
+
case "minBufferTime":
|
|
153
|
+
parseValue(attributeVal, {
|
|
154
|
+
asKey: "minBufferTime",
|
|
155
|
+
parser: utils_1.parseDuration,
|
|
156
|
+
dashName: "minBufferTime",
|
|
157
|
+
});
|
|
158
|
+
break;
|
|
159
|
+
case "timeShiftBufferDepth":
|
|
160
|
+
parseValue(attributeVal, {
|
|
161
|
+
asKey: "timeShiftBufferDepth",
|
|
162
|
+
parser: utils_1.parseDuration,
|
|
163
|
+
dashName: "timeShiftBufferDepth",
|
|
164
|
+
});
|
|
165
|
+
break;
|
|
166
|
+
case "suggestedPresentationDelay":
|
|
167
|
+
parseValue(attributeVal, {
|
|
168
|
+
asKey: "suggestedPresentationDelay",
|
|
169
|
+
parser: utils_1.parseDuration,
|
|
170
|
+
dashName: "suggestedPresentationDelay",
|
|
171
|
+
});
|
|
172
|
+
break;
|
|
173
|
+
case "maxSegmentDuration":
|
|
174
|
+
parseValue(attributeVal, {
|
|
175
|
+
asKey: "maxSegmentDuration",
|
|
176
|
+
parser: utils_1.parseDuration,
|
|
177
|
+
dashName: "maxSegmentDuration",
|
|
178
|
+
});
|
|
179
|
+
break;
|
|
180
|
+
case "maxSubsegmentDuration":
|
|
181
|
+
parseValue(attributeVal, {
|
|
182
|
+
asKey: "maxSubsegmentDuration",
|
|
183
|
+
parser: utils_1.parseDuration,
|
|
184
|
+
dashName: "maxSubsegmentDuration",
|
|
185
|
+
});
|
|
186
|
+
break;
|
|
187
|
+
default:
|
|
188
|
+
if ((0, starts_with_1.default)(attributeName, "xmlns:")) {
|
|
189
|
+
if (res.namespaces === undefined) {
|
|
190
|
+
res.namespaces = [];
|
|
191
|
+
}
|
|
192
|
+
res.namespaces.push({
|
|
193
|
+
key: attributeName.substring(6),
|
|
194
|
+
value: attributeVal,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
202
|
+
finally {
|
|
203
|
+
try {
|
|
204
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
205
|
+
}
|
|
206
|
+
finally { if (e_1) throw e_1.error; }
|
|
207
|
+
}
|
|
208
|
+
return [res, warnings];
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* @param {Object} root
|
|
212
|
+
* @param {string} fullMpd
|
|
213
|
+
* @returns {Array.<Object>}
|
|
214
|
+
*/
|
|
215
|
+
function createMPDIntermediateRepresentation(root, fullMpd) {
|
|
216
|
+
var _a = __read(parseMPDChildren(root.children, fullMpd), 2), children = _a[0], childrenWarnings = _a[1];
|
|
217
|
+
var _b = __read(parseMPDAttributes(root), 2), attributes = _b[0], attrsWarnings = _b[1];
|
|
218
|
+
var warnings = childrenWarnings.concat(attrsWarnings);
|
|
219
|
+
return [{ children: children, attributes: attributes }, warnings];
|
|
220
|
+
}
|
|
221
|
+
exports.createMPDIntermediateRepresentation = createMPDIntermediateRepresentation;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { IPeriodIntermediateRepresentation } from "../../node_parser_types";
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} periodElement
|
|
20
|
+
* @param {string} fullMpd
|
|
21
|
+
* @returns {Array}
|
|
22
|
+
*/
|
|
23
|
+
export declare function createPeriodIntermediateRepresentation(periodElement: ITNode, fullMpd: string): [IPeriodIntermediateRepresentation, Error[]];
|