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,179 @@
|
|
|
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.createPeriodIntermediateRepresentation = 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 AdaptationSet_1 = require("./AdaptationSet");
|
|
49
|
+
var BaseURL_1 = require("./BaseURL");
|
|
50
|
+
var EventStream_1 = require("./EventStream");
|
|
51
|
+
var SegmentTemplate_1 = require("./SegmentTemplate");
|
|
52
|
+
var utils_1 = require("./utils");
|
|
53
|
+
/**
|
|
54
|
+
* @param {Array.<Object | string>} periodChildren
|
|
55
|
+
* @param {string} fullMpd
|
|
56
|
+
* @returns {Array}
|
|
57
|
+
*/
|
|
58
|
+
function parsePeriodChildren(periodChildren, fullMpd) {
|
|
59
|
+
var baseURLs = [];
|
|
60
|
+
var adaptations = [];
|
|
61
|
+
var segmentTemplate;
|
|
62
|
+
var warnings = [];
|
|
63
|
+
var eventStreams = [];
|
|
64
|
+
for (var i = 0; i < periodChildren.length; i++) {
|
|
65
|
+
var currentElement = periodChildren[i];
|
|
66
|
+
if (typeof currentElement === "string") {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
switch (currentElement.tagName) {
|
|
70
|
+
case "BaseURL":
|
|
71
|
+
var _a = __read((0, BaseURL_1.default)(currentElement), 2), baseURLObj = _a[0], baseURLWarnings = _a[1];
|
|
72
|
+
if (baseURLObj !== undefined) {
|
|
73
|
+
baseURLs.push(baseURLObj);
|
|
74
|
+
}
|
|
75
|
+
warnings = warnings.concat(baseURLWarnings);
|
|
76
|
+
break;
|
|
77
|
+
case "AdaptationSet":
|
|
78
|
+
var _b = __read((0, AdaptationSet_1.createAdaptationSetIntermediateRepresentation)(currentElement), 2), adaptation = _b[0], adaptationWarnings = _b[1];
|
|
79
|
+
adaptations.push(adaptation);
|
|
80
|
+
warnings = warnings.concat(adaptationWarnings);
|
|
81
|
+
break;
|
|
82
|
+
case "EventStream":
|
|
83
|
+
var _c = __read((0, EventStream_1.createEventStreamIntermediateRepresentation)(currentElement, fullMpd), 2), eventStream = _c[0], eventStreamWarnings = _c[1];
|
|
84
|
+
eventStreams.push(eventStream);
|
|
85
|
+
warnings = warnings.concat(eventStreamWarnings);
|
|
86
|
+
break;
|
|
87
|
+
case "SegmentTemplate":
|
|
88
|
+
var _d = __read((0, SegmentTemplate_1.default)(currentElement), 2), parsedSegmentTemplate = _d[0], segmentTemplateWarnings = _d[1];
|
|
89
|
+
segmentTemplate = parsedSegmentTemplate;
|
|
90
|
+
if (segmentTemplateWarnings.length > 0) {
|
|
91
|
+
warnings = warnings.concat(segmentTemplateWarnings);
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return [{ baseURLs: baseURLs, adaptations: adaptations, eventStreams: eventStreams, segmentTemplate: segmentTemplate }, warnings];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @param {Object} root
|
|
100
|
+
* @returns {Array}
|
|
101
|
+
*/
|
|
102
|
+
function parsePeriodAttributes(root) {
|
|
103
|
+
var e_1, _a;
|
|
104
|
+
var res = {};
|
|
105
|
+
var warnings = [];
|
|
106
|
+
var parseValue = (0, utils_1.ValueParser)(res, warnings);
|
|
107
|
+
try {
|
|
108
|
+
for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
109
|
+
var attributeName = _c.value;
|
|
110
|
+
var attributeVal = root.attributes[attributeName];
|
|
111
|
+
if ((0, is_null_or_undefined_1.default)(attributeVal)) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
switch (attributeName) {
|
|
115
|
+
case "id":
|
|
116
|
+
res.id = attributeVal;
|
|
117
|
+
break;
|
|
118
|
+
case "start":
|
|
119
|
+
parseValue(attributeVal, {
|
|
120
|
+
asKey: "start",
|
|
121
|
+
parser: utils_1.parseDuration,
|
|
122
|
+
dashName: "start",
|
|
123
|
+
});
|
|
124
|
+
break;
|
|
125
|
+
case "duration":
|
|
126
|
+
parseValue(attributeVal, {
|
|
127
|
+
asKey: "duration",
|
|
128
|
+
parser: utils_1.parseDuration,
|
|
129
|
+
dashName: "duration",
|
|
130
|
+
});
|
|
131
|
+
break;
|
|
132
|
+
case "bitstreamSwitching":
|
|
133
|
+
parseValue(attributeVal, {
|
|
134
|
+
asKey: "bitstreamSwitching",
|
|
135
|
+
parser: utils_1.parseBoolean,
|
|
136
|
+
dashName: "bitstreamSwitching",
|
|
137
|
+
});
|
|
138
|
+
break;
|
|
139
|
+
case "xlink:href":
|
|
140
|
+
res.xlinkHref = attributeVal;
|
|
141
|
+
break;
|
|
142
|
+
case "xlink:actuate":
|
|
143
|
+
res.xlinkActuate = attributeVal;
|
|
144
|
+
break;
|
|
145
|
+
default:
|
|
146
|
+
if ((0, starts_with_1.default)(attributeName, "xmlns:")) {
|
|
147
|
+
if (res.namespaces === undefined) {
|
|
148
|
+
res.namespaces = [];
|
|
149
|
+
}
|
|
150
|
+
res.namespaces.push({
|
|
151
|
+
key: attributeName.substring(6),
|
|
152
|
+
value: attributeVal,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
160
|
+
finally {
|
|
161
|
+
try {
|
|
162
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
163
|
+
}
|
|
164
|
+
finally { if (e_1) throw e_1.error; }
|
|
165
|
+
}
|
|
166
|
+
return [res, warnings];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* @param {Object} periodElement
|
|
170
|
+
* @param {string} fullMpd
|
|
171
|
+
* @returns {Array}
|
|
172
|
+
*/
|
|
173
|
+
function createPeriodIntermediateRepresentation(periodElement, fullMpd) {
|
|
174
|
+
var _a = __read(parsePeriodChildren(periodElement.children, fullMpd), 2), children = _a[0], childrenWarnings = _a[1];
|
|
175
|
+
var _b = __read(parsePeriodAttributes(periodElement), 2), attributes = _b[0], attrsWarnings = _b[1];
|
|
176
|
+
var warnings = childrenWarnings.concat(attrsWarnings);
|
|
177
|
+
return [{ children: children, attributes: attributes }, warnings];
|
|
178
|
+
}
|
|
179
|
+
exports.createPeriodIntermediateRepresentation = createPeriodIntermediateRepresentation;
|
|
@@ -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 { IRepresentationIntermediateRepresentation } from "../../node_parser_types";
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} representationElement
|
|
20
|
+
* @returns {Array}
|
|
21
|
+
*/
|
|
22
|
+
export declare function createRepresentationIntermediateRepresentation(representationElement: ITNode): [IRepresentationIntermediateRepresentation, Error[]];
|
|
@@ -0,0 +1,256 @@
|
|
|
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.createRepresentationIntermediateRepresentation = void 0;
|
|
46
|
+
var is_null_or_undefined_1 = require("../../../../../utils/is_null_or_undefined");
|
|
47
|
+
var BaseURL_1 = require("./BaseURL");
|
|
48
|
+
var ContentProtection_1 = require("./ContentProtection");
|
|
49
|
+
var SegmentBase_1 = require("./SegmentBase");
|
|
50
|
+
var SegmentList_1 = require("./SegmentList");
|
|
51
|
+
var SegmentTemplate_1 = require("./SegmentTemplate");
|
|
52
|
+
var utils_1 = require("./utils");
|
|
53
|
+
/**
|
|
54
|
+
* @param {Array.<Object | string>} representationChildren
|
|
55
|
+
* @returns {Object}
|
|
56
|
+
*/
|
|
57
|
+
function parseRepresentationChildren(representationChildren) {
|
|
58
|
+
var children = {
|
|
59
|
+
baseURLs: [],
|
|
60
|
+
};
|
|
61
|
+
var contentProtections = [];
|
|
62
|
+
var warnings = [];
|
|
63
|
+
for (var i = 0; i < representationChildren.length; i++) {
|
|
64
|
+
var currentElement = representationChildren[i];
|
|
65
|
+
if (typeof currentElement === "string") {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
switch (currentElement.tagName) {
|
|
69
|
+
case "BaseURL":
|
|
70
|
+
var _a = __read((0, BaseURL_1.default)(currentElement), 2), baseURLObj = _a[0], baseURLWarnings = _a[1];
|
|
71
|
+
if (baseURLObj !== undefined) {
|
|
72
|
+
children.baseURLs.push(baseURLObj);
|
|
73
|
+
}
|
|
74
|
+
warnings = warnings.concat(baseURLWarnings);
|
|
75
|
+
break;
|
|
76
|
+
case "InbandEventStream":
|
|
77
|
+
if (children.inbandEventStreams === undefined) {
|
|
78
|
+
children.inbandEventStreams = [];
|
|
79
|
+
}
|
|
80
|
+
children.inbandEventStreams.push((0, utils_1.parseScheme)(currentElement));
|
|
81
|
+
break;
|
|
82
|
+
case "SegmentBase":
|
|
83
|
+
var _b = __read((0, SegmentBase_1.default)(currentElement), 2), segmentBase = _b[0], segmentBaseWarnings = _b[1];
|
|
84
|
+
children.segmentBase = segmentBase;
|
|
85
|
+
if (segmentBaseWarnings.length > 0) {
|
|
86
|
+
warnings = warnings.concat(segmentBaseWarnings);
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
case "SegmentList":
|
|
90
|
+
var _c = __read((0, SegmentList_1.default)(currentElement), 2), segmentList = _c[0], segmentListWarnings = _c[1];
|
|
91
|
+
warnings = warnings.concat(segmentListWarnings);
|
|
92
|
+
children.segmentList = segmentList;
|
|
93
|
+
break;
|
|
94
|
+
case "SegmentTemplate":
|
|
95
|
+
var _d = __read((0, SegmentTemplate_1.default)(currentElement), 2), segmentTemplate = _d[0], segmentTemplateWarnings = _d[1];
|
|
96
|
+
warnings = warnings.concat(segmentTemplateWarnings);
|
|
97
|
+
children.segmentTemplate = segmentTemplate;
|
|
98
|
+
break;
|
|
99
|
+
case "ContentProtection":
|
|
100
|
+
var _e = __read((0, ContentProtection_1.default)(currentElement), 2), contentProtection = _e[0], contentProtectionWarnings = _e[1];
|
|
101
|
+
if (contentProtectionWarnings.length > 0) {
|
|
102
|
+
warnings = warnings.concat(contentProtectionWarnings);
|
|
103
|
+
}
|
|
104
|
+
if (contentProtection !== undefined) {
|
|
105
|
+
contentProtections.push(contentProtection);
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
case "SupplementalProperty":
|
|
109
|
+
if ((0, is_null_or_undefined_1.default)(children.supplementalProperties)) {
|
|
110
|
+
children.supplementalProperties = [(0, utils_1.parseScheme)(currentElement)];
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
children.supplementalProperties.push((0, utils_1.parseScheme)(currentElement));
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (contentProtections.length > 0) {
|
|
119
|
+
children.contentProtections = contentProtections;
|
|
120
|
+
}
|
|
121
|
+
return [children, warnings];
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @param {Object} root
|
|
125
|
+
* @returns {Array}
|
|
126
|
+
*/
|
|
127
|
+
function parseRepresentationAttributes(root) {
|
|
128
|
+
var e_1, _a;
|
|
129
|
+
var attributes = {};
|
|
130
|
+
var warnings = [];
|
|
131
|
+
var parseValue = (0, utils_1.ValueParser)(attributes, warnings);
|
|
132
|
+
try {
|
|
133
|
+
for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
134
|
+
var attributeName = _c.value;
|
|
135
|
+
var attributeVal = root.attributes[attributeName];
|
|
136
|
+
if ((0, is_null_or_undefined_1.default)(attributeVal)) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
switch (attributeName) {
|
|
140
|
+
case "audioSamplingRate":
|
|
141
|
+
attributes.audioSamplingRate = attributeVal;
|
|
142
|
+
break;
|
|
143
|
+
case "bandwidth":
|
|
144
|
+
parseValue(attributeVal, {
|
|
145
|
+
asKey: "bitrate",
|
|
146
|
+
parser: utils_1.parseMPDInteger,
|
|
147
|
+
dashName: "bandwidth",
|
|
148
|
+
});
|
|
149
|
+
break;
|
|
150
|
+
case "codecs":
|
|
151
|
+
attributes.codecs = attributeVal;
|
|
152
|
+
break;
|
|
153
|
+
case "codingDependency":
|
|
154
|
+
parseValue(attributeVal, {
|
|
155
|
+
asKey: "codingDependency",
|
|
156
|
+
parser: utils_1.parseBoolean,
|
|
157
|
+
dashName: "codingDependency",
|
|
158
|
+
});
|
|
159
|
+
break;
|
|
160
|
+
case "frameRate":
|
|
161
|
+
parseValue(attributeVal, {
|
|
162
|
+
asKey: "frameRate",
|
|
163
|
+
parser: utils_1.parseMaybeDividedNumber,
|
|
164
|
+
dashName: "frameRate",
|
|
165
|
+
});
|
|
166
|
+
break;
|
|
167
|
+
case "height":
|
|
168
|
+
parseValue(attributeVal, {
|
|
169
|
+
asKey: "height",
|
|
170
|
+
parser: utils_1.parseMPDInteger,
|
|
171
|
+
dashName: "height",
|
|
172
|
+
});
|
|
173
|
+
break;
|
|
174
|
+
case "id":
|
|
175
|
+
attributes.id = attributeVal;
|
|
176
|
+
break;
|
|
177
|
+
case "maxPlayoutRate":
|
|
178
|
+
parseValue(attributeVal, {
|
|
179
|
+
asKey: "maxPlayoutRate",
|
|
180
|
+
parser: utils_1.parseMPDFloat,
|
|
181
|
+
dashName: "maxPlayoutRate",
|
|
182
|
+
});
|
|
183
|
+
break;
|
|
184
|
+
case "maximumSAPPeriod":
|
|
185
|
+
parseValue(attributeVal, {
|
|
186
|
+
asKey: "maximumSAPPeriod",
|
|
187
|
+
parser: utils_1.parseMPDFloat,
|
|
188
|
+
dashName: "maximumSAPPeriod",
|
|
189
|
+
});
|
|
190
|
+
break;
|
|
191
|
+
case "mimeType":
|
|
192
|
+
attributes.mimeType = attributeVal;
|
|
193
|
+
break;
|
|
194
|
+
case "profiles":
|
|
195
|
+
attributes.profiles = attributeVal;
|
|
196
|
+
break;
|
|
197
|
+
case "qualityRanking":
|
|
198
|
+
parseValue(attributeVal, {
|
|
199
|
+
asKey: "qualityRanking",
|
|
200
|
+
parser: utils_1.parseMPDInteger,
|
|
201
|
+
dashName: "qualityRanking",
|
|
202
|
+
});
|
|
203
|
+
break;
|
|
204
|
+
case "scte214:supplementalCodecs":
|
|
205
|
+
attributes.supplementalCodecs = attributeVal;
|
|
206
|
+
break;
|
|
207
|
+
case "segmentProfiles":
|
|
208
|
+
attributes.segmentProfiles = attributeVal;
|
|
209
|
+
break;
|
|
210
|
+
case "width":
|
|
211
|
+
parseValue(attributeVal, {
|
|
212
|
+
asKey: "width",
|
|
213
|
+
parser: utils_1.parseMPDInteger,
|
|
214
|
+
dashName: "width",
|
|
215
|
+
});
|
|
216
|
+
break;
|
|
217
|
+
case "availabilityTimeOffset":
|
|
218
|
+
parseValue(attributeVal, {
|
|
219
|
+
asKey: "availabilityTimeOffset",
|
|
220
|
+
parser: utils_1.parseMPDFloat,
|
|
221
|
+
dashName: "availabilityTimeOffset",
|
|
222
|
+
});
|
|
223
|
+
break;
|
|
224
|
+
case "availabilityTimeComplete":
|
|
225
|
+
parseValue(attributeVal, {
|
|
226
|
+
asKey: "availabilityTimeComplete",
|
|
227
|
+
parser: utils_1.parseBoolean,
|
|
228
|
+
dashName: "availabilityTimeComplete",
|
|
229
|
+
});
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
235
|
+
finally {
|
|
236
|
+
try {
|
|
237
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
238
|
+
}
|
|
239
|
+
finally { if (e_1) throw e_1.error; }
|
|
240
|
+
}
|
|
241
|
+
if (attributes.bitrate === undefined) {
|
|
242
|
+
warnings.push(new utils_1.MPDError("No bitrate found on a Representation"));
|
|
243
|
+
}
|
|
244
|
+
return [attributes, warnings];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* @param {Object} representationElement
|
|
248
|
+
* @returns {Array}
|
|
249
|
+
*/
|
|
250
|
+
function createRepresentationIntermediateRepresentation(representationElement) {
|
|
251
|
+
var _a = __read(parseRepresentationChildren(representationElement.children), 2), children = _a[0], childrenWarnings = _a[1];
|
|
252
|
+
var _b = __read(parseRepresentationAttributes(representationElement), 2), attributes = _b[0], attrsWarnings = _b[1];
|
|
253
|
+
var warnings = childrenWarnings.concat(attrsWarnings);
|
|
254
|
+
return [{ children: children, attributes: attributes }, warnings];
|
|
255
|
+
}
|
|
256
|
+
exports.createRepresentationIntermediateRepresentation = createRepresentationIntermediateRepresentation;
|
|
@@ -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 { ISegmentBaseIntermediateRepresentation } from "../../node_parser_types";
|
|
18
|
+
/**
|
|
19
|
+
* Parse a SegmentBase element into a SegmentBase intermediate representation.
|
|
20
|
+
* @param {Object} root - The SegmentBase root element.
|
|
21
|
+
* @returns {Array}
|
|
22
|
+
*/
|
|
23
|
+
export default function parseSegmentBase(root: ITNode): [ISegmentBaseIntermediateRepresentation, Error[]];
|
|
@@ -0,0 +1,152 @@
|
|
|
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 is_null_or_undefined_1 = require("../../../../../utils/is_null_or_undefined");
|
|
46
|
+
var Initialization_1 = require("./Initialization");
|
|
47
|
+
var utils_1 = require("./utils");
|
|
48
|
+
/**
|
|
49
|
+
* Parse a SegmentBase element into a SegmentBase intermediate representation.
|
|
50
|
+
* @param {Object} root - The SegmentBase root element.
|
|
51
|
+
* @returns {Array}
|
|
52
|
+
*/
|
|
53
|
+
function parseSegmentBase(root) {
|
|
54
|
+
var e_1, _a;
|
|
55
|
+
var attributes = {};
|
|
56
|
+
var warnings = [];
|
|
57
|
+
var parseValue = (0, utils_1.ValueParser)(attributes, warnings);
|
|
58
|
+
var segmentBaseChildren = root.children;
|
|
59
|
+
for (var i = 0; i < segmentBaseChildren.length; i++) {
|
|
60
|
+
var currentNode = segmentBaseChildren[i];
|
|
61
|
+
if (typeof currentNode !== "string") {
|
|
62
|
+
if (currentNode.tagName === "Initialization") {
|
|
63
|
+
var _b = __read((0, Initialization_1.default)(currentNode), 2), initialization = _b[0], initializationWarnings = _b[1];
|
|
64
|
+
attributes.initialization = initialization;
|
|
65
|
+
warnings = warnings.concat(initializationWarnings);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
for (var _c = __values(Object.keys(root.attributes)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
71
|
+
var attributeName = _d.value;
|
|
72
|
+
var attributeVal = root.attributes[attributeName];
|
|
73
|
+
if ((0, is_null_or_undefined_1.default)(attributeVal)) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
switch (attributeName) {
|
|
77
|
+
case "timescale":
|
|
78
|
+
parseValue(attributeVal, {
|
|
79
|
+
asKey: "timescale",
|
|
80
|
+
parser: utils_1.parseMPDInteger,
|
|
81
|
+
dashName: "timescale",
|
|
82
|
+
});
|
|
83
|
+
break;
|
|
84
|
+
case "presentationTimeOffset":
|
|
85
|
+
parseValue(attributeVal, {
|
|
86
|
+
asKey: "presentationTimeOffset",
|
|
87
|
+
parser: utils_1.parseMPDFloat,
|
|
88
|
+
dashName: "presentationTimeOffset",
|
|
89
|
+
});
|
|
90
|
+
break;
|
|
91
|
+
case "indexRange":
|
|
92
|
+
parseValue(attributeVal, {
|
|
93
|
+
asKey: "indexRange",
|
|
94
|
+
parser: utils_1.parseByteRange,
|
|
95
|
+
dashName: "indexRange",
|
|
96
|
+
});
|
|
97
|
+
break;
|
|
98
|
+
case "indexRangeExact":
|
|
99
|
+
parseValue(attributeVal, {
|
|
100
|
+
asKey: "indexRangeExact",
|
|
101
|
+
parser: utils_1.parseBoolean,
|
|
102
|
+
dashName: "indexRangeExact",
|
|
103
|
+
});
|
|
104
|
+
break;
|
|
105
|
+
case "availabilityTimeOffset":
|
|
106
|
+
parseValue(attributeVal, {
|
|
107
|
+
asKey: "availabilityTimeOffset",
|
|
108
|
+
parser: utils_1.parseMPDFloat,
|
|
109
|
+
dashName: "availabilityTimeOffset",
|
|
110
|
+
});
|
|
111
|
+
break;
|
|
112
|
+
case "availabilityTimeComplete":
|
|
113
|
+
parseValue(attributeVal, {
|
|
114
|
+
asKey: "availabilityTimeComplete",
|
|
115
|
+
parser: utils_1.parseBoolean,
|
|
116
|
+
dashName: "availabilityTimeComplete",
|
|
117
|
+
});
|
|
118
|
+
break;
|
|
119
|
+
case "duration":
|
|
120
|
+
parseValue(attributeVal, {
|
|
121
|
+
asKey: "duration",
|
|
122
|
+
parser: utils_1.parseMPDInteger,
|
|
123
|
+
dashName: "duration",
|
|
124
|
+
});
|
|
125
|
+
break;
|
|
126
|
+
case "startNumber":
|
|
127
|
+
parseValue(attributeVal, {
|
|
128
|
+
asKey: "startNumber",
|
|
129
|
+
parser: utils_1.parseMPDInteger,
|
|
130
|
+
dashName: "startNumber",
|
|
131
|
+
});
|
|
132
|
+
break;
|
|
133
|
+
case "endNumber":
|
|
134
|
+
parseValue(attributeVal, {
|
|
135
|
+
asKey: "endNumber",
|
|
136
|
+
parser: utils_1.parseMPDInteger,
|
|
137
|
+
dashName: "endNumber",
|
|
138
|
+
});
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
144
|
+
finally {
|
|
145
|
+
try {
|
|
146
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
147
|
+
}
|
|
148
|
+
finally { if (e_1) throw e_1.error; }
|
|
149
|
+
}
|
|
150
|
+
return [attributes, warnings];
|
|
151
|
+
}
|
|
152
|
+
exports.default = parseSegmentBase;
|
|
@@ -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 { ISegmentListIntermediateRepresentation } from "../../node_parser_types";
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} root
|
|
20
|
+
* @returns {Array}
|
|
21
|
+
*/
|
|
22
|
+
export default function parseSegmentList(root: ITNode): [ISegmentListIntermediateRepresentation, Error[]];
|