rx-player 4.0.0-dev.2024022000 → 4.0.0-dev.202402212
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/.vscode/settings.json +9 -0
- 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 +9 -8
- 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 +3 -8
- package/dist/commonjs/main_thread/api/public_api.js +7 -2
- package/dist/commonjs/multithread_types.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +3 -4
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +4 -11
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +1 -2
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +3 -12
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +2 -3
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +11 -22
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +2 -11
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +3 -74
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +1 -2
- package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +1 -3
- package/dist/commonjs/parsers/manifest/dash/node_parser_types.d.ts +3 -5
- package/dist/commonjs/public_types.d.ts +1 -1
- package/dist/commonjs/transports/dash/manifest_parser.js +4 -33
- 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 +9 -8
- 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 +3 -8
- package/dist/es2017/main_thread/api/public_api.js +7 -2
- package/dist/es2017/multithread_types.d.ts +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +3 -4
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +5 -12
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +1 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +4 -13
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +2 -3
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +11 -22
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +2 -11
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +2 -49
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +1 -2
- package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +1 -3
- package/dist/es2017/parsers/manifest/dash/node_parser_types.d.ts +3 -5
- package/dist/es2017/public_types.d.ts +1 -1
- package/dist/es2017/transports/dash/manifest_parser.js +4 -33
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +65 -141
- package/dist/rx-player.min.js +1 -1
- package/dist/worker.js +3 -8
- package/package.json +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.d.ts +0 -17
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.js +0 -19
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +0 -24
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +0 -400
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +0 -24
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +0 -33
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +0 -23
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +0 -70
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +0 -22
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +0 -118
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +0 -23
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +0 -154
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +0 -22
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +0 -70
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +0 -23
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +0 -221
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +0 -23
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +0 -179
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +0 -22
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +0 -256
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +0 -23
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +0 -152
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +0 -22
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +0 -60
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +0 -24
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +0 -125
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +0 -22
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +0 -36
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +0 -24
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +0 -82
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +0 -176
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +0 -382
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +0 -24
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +0 -142
- package/dist/commonjs/utils/xml-parser.d.ts +0 -70
- package/dist/commonjs/utils/xml-parser.js +0 -357
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.d.ts +0 -17
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.js +0 -17
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +0 -24
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +0 -358
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +0 -24
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +0 -30
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +0 -23
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +0 -45
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +0 -22
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +0 -77
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +0 -23
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +0 -101
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +0 -22
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +0 -45
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +0 -23
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +0 -179
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +0 -23
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +0 -137
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +0 -22
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +0 -214
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +0 -23
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +0 -111
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +0 -22
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +0 -41
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +0 -24
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +0 -84
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +0 -22
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +0 -33
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +0 -24
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +0 -57
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +0 -176
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +0 -310
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +0 -24
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +0 -114
- package/dist/es2017/utils/xml-parser.d.ts +0 -70
- package/dist/es2017/utils/xml-parser.js +0 -322
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/index.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/index.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/AdaptationSet.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/AdaptationSet.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/BaseURL.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/BaseURL.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentComponent.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentComponent.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentProtection.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentProtection.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/EventStream.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/EventStream.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Initialization.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Initialization.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/MPD.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/MPD.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Period.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Period.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Representation.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Representation.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentBase.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentBase.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentList.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentList.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTemplate.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTimeline.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentURL.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentURL.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/utils.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/utils.js +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/parse_from_document.d.ts +0 -0
- /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/parse_from_document.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/index.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/index.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/AdaptationSet.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/AdaptationSet.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/BaseURL.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/BaseURL.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentComponent.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentComponent.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentProtection.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentProtection.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/EventStream.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/EventStream.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Initialization.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Initialization.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/MPD.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/MPD.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Period.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Period.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Representation.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Representation.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentBase.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentBase.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentList.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentList.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTemplate.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTimeline.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentURL.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentURL.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/utils.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/utils.js +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/parse_from_document.d.ts +0 -0
- /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/parse_from_document.js +0 -0
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* This code is mainly a modified version of the tXml library.
|
|
4
|
-
*
|
|
5
|
-
* @author: Tobias Nickel
|
|
6
|
-
* created: 06.04.2015
|
|
7
|
-
* https://github.com/TobiasNickel/tXml
|
|
8
|
-
*/
|
|
9
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
10
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
11
|
-
if (!m) return o;
|
|
12
|
-
var i = m.call(o), r, ar = [], e;
|
|
13
|
-
try {
|
|
14
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
15
|
-
}
|
|
16
|
-
catch (error) { e = { error: error }; }
|
|
17
|
-
finally {
|
|
18
|
-
try {
|
|
19
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
20
|
-
}
|
|
21
|
-
finally { if (e) throw e.error; }
|
|
22
|
-
}
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
26
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
27
|
-
if (ar || !(i in from)) {
|
|
28
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
29
|
-
ar[i] = from[i];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.toContentString = exports.parseXml = exports.getElementsByClassName = exports.getElementById = exports.filter = void 0;
|
|
36
|
-
var openBracket = "<";
|
|
37
|
-
var openBracketCC = "<".charCodeAt(0);
|
|
38
|
-
var closeBracket = ">";
|
|
39
|
-
var closeBracketCC = ">".charCodeAt(0);
|
|
40
|
-
var minusCC = "-".charCodeAt(0);
|
|
41
|
-
var slashCC = "/".charCodeAt(0);
|
|
42
|
-
var exclamationCC = "!".charCodeAt(0);
|
|
43
|
-
var singleQuoteCC = "'".charCodeAt(0);
|
|
44
|
-
var doubleQuoteCC = '"'.charCodeAt(0);
|
|
45
|
-
var openCornerBracketCC = "[".charCodeAt(0);
|
|
46
|
-
var closeCornerBracketCC = "]".charCodeAt(0);
|
|
47
|
-
/** Character marking end of attribute and node name. */
|
|
48
|
-
var nameSpacer = "\r\n\t>/= ";
|
|
49
|
-
/**
|
|
50
|
-
* parseXML / html into a DOM Object. with no validation and some failur tolerance
|
|
51
|
-
* @param {string} src - Your XML to parse
|
|
52
|
-
* @param {Object} [options = {}] - all other options:
|
|
53
|
-
* @return {Array.<Object | string>}
|
|
54
|
-
*/
|
|
55
|
-
function parseXml(src, options) {
|
|
56
|
-
var _a, _b;
|
|
57
|
-
if (options === void 0) { options = {}; }
|
|
58
|
-
var pos = (_a = options.pos) !== null && _a !== void 0 ? _a : 0;
|
|
59
|
-
var keepComments = options.keepComments === true;
|
|
60
|
-
var keepWhitespace = options.keepWhitespace === true;
|
|
61
|
-
var out;
|
|
62
|
-
if (options.attrValue !== undefined) {
|
|
63
|
-
options.attrName = (_b = options.attrName) !== null && _b !== void 0 ? _b : "id";
|
|
64
|
-
out = [];
|
|
65
|
-
while ((pos = findElements()) !== -1) {
|
|
66
|
-
pos = src.lastIndexOf("<", pos);
|
|
67
|
-
if (pos !== -1) {
|
|
68
|
-
out.push(parseNode());
|
|
69
|
-
}
|
|
70
|
-
// eslint-disable-next-line no-param-reassign
|
|
71
|
-
src = src.substring(pos);
|
|
72
|
-
pos = 0;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
out = parseChildren("");
|
|
77
|
-
}
|
|
78
|
-
if (options.filter) {
|
|
79
|
-
out = filter(out, options.filter);
|
|
80
|
-
}
|
|
81
|
-
return out;
|
|
82
|
-
/**
|
|
83
|
-
* parsing a list of entries
|
|
84
|
-
* @param {string} tagName
|
|
85
|
-
* @returns {Array.<ITNode | string>}
|
|
86
|
-
*/
|
|
87
|
-
function parseChildren(tagName) {
|
|
88
|
-
var children = [];
|
|
89
|
-
while (src[pos]) {
|
|
90
|
-
if (src.charCodeAt(pos) === openBracketCC) {
|
|
91
|
-
if (src.charCodeAt(pos + 1) === slashCC) {
|
|
92
|
-
var closeStart = pos + 2;
|
|
93
|
-
pos = src.indexOf(closeBracket, pos);
|
|
94
|
-
var closeTag = src.substring(closeStart, pos);
|
|
95
|
-
if (closeTag.indexOf(tagName) === -1) {
|
|
96
|
-
var parsedText = src.substring(0, pos).split("\n");
|
|
97
|
-
throw new Error("Unexpected close tag\nLine: " +
|
|
98
|
-
(parsedText.length - 1) +
|
|
99
|
-
"\nColumn: " +
|
|
100
|
-
(parsedText[parsedText.length - 1].length + 1) +
|
|
101
|
-
"\nChar: " +
|
|
102
|
-
src[pos]);
|
|
103
|
-
}
|
|
104
|
-
if (pos !== -1) {
|
|
105
|
-
pos += 1;
|
|
106
|
-
}
|
|
107
|
-
return children;
|
|
108
|
-
}
|
|
109
|
-
else if (src.charCodeAt(pos + 1) === exclamationCC) {
|
|
110
|
-
if (src.charCodeAt(pos + 2) === minusCC) {
|
|
111
|
-
// comment support
|
|
112
|
-
var startCommentPos = pos;
|
|
113
|
-
while (pos !== -1 &&
|
|
114
|
-
!(src.charCodeAt(pos) === closeBracketCC &&
|
|
115
|
-
src.charCodeAt(pos - 1) === minusCC &&
|
|
116
|
-
src.charCodeAt(pos - 2) === minusCC)) {
|
|
117
|
-
pos = src.indexOf(closeBracket, pos + 1);
|
|
118
|
-
}
|
|
119
|
-
if (pos === -1) {
|
|
120
|
-
pos = src.length;
|
|
121
|
-
}
|
|
122
|
-
if (keepComments) {
|
|
123
|
-
children.push(src.substring(startCommentPos, pos + 1));
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else if (src.charCodeAt(pos + 2) === openCornerBracketCC &&
|
|
127
|
-
src.charCodeAt(pos + 8) === openCornerBracketCC &&
|
|
128
|
-
src.substring(pos + 3, pos + 8).toLowerCase() === "cdata") {
|
|
129
|
-
// cdata
|
|
130
|
-
var cdataEndIndex = src.indexOf("]]>", pos);
|
|
131
|
-
if (cdataEndIndex === -1) {
|
|
132
|
-
children.push(src.substring(pos + 9));
|
|
133
|
-
pos = src.length;
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
children.push(src.substring(pos + 9, cdataEndIndex));
|
|
137
|
-
pos = cdataEndIndex + 3;
|
|
138
|
-
}
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
// doctypesupport
|
|
143
|
-
var startDoctype = pos + 1;
|
|
144
|
-
pos += 2;
|
|
145
|
-
var encapsuled = false;
|
|
146
|
-
while ((src.charCodeAt(pos) !== closeBracketCC || encapsuled) && src[pos]) {
|
|
147
|
-
if (src.charCodeAt(pos) === openCornerBracketCC) {
|
|
148
|
-
encapsuled = true;
|
|
149
|
-
}
|
|
150
|
-
else if (encapsuled && src.charCodeAt(pos) === closeCornerBracketCC) {
|
|
151
|
-
encapsuled = false;
|
|
152
|
-
}
|
|
153
|
-
pos++;
|
|
154
|
-
}
|
|
155
|
-
children.push(src.substring(startDoctype, pos));
|
|
156
|
-
}
|
|
157
|
-
pos++;
|
|
158
|
-
continue;
|
|
159
|
-
}
|
|
160
|
-
var node = parseNode();
|
|
161
|
-
children.push(node);
|
|
162
|
-
if (node.tagName[0] === "?") {
|
|
163
|
-
children.push.apply(children, __spreadArray([], __read(node.children), false));
|
|
164
|
-
node.children = [];
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
var text = parseText();
|
|
169
|
-
if (keepWhitespace) {
|
|
170
|
-
if (text.length > 0) {
|
|
171
|
-
children.push(text);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
var trimmed = text.trim();
|
|
176
|
-
if (trimmed.length > 0) {
|
|
177
|
-
children.push(trimmed);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
pos++;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return children;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* returns the text outside of texts until the first '<'
|
|
187
|
-
*/
|
|
188
|
-
function parseText() {
|
|
189
|
-
var start = pos;
|
|
190
|
-
pos = src.indexOf(openBracket, pos) - 1;
|
|
191
|
-
if (pos === -2) {
|
|
192
|
-
pos = src.length;
|
|
193
|
-
}
|
|
194
|
-
return src.slice(start, pos + 1);
|
|
195
|
-
}
|
|
196
|
-
function parseName() {
|
|
197
|
-
var start = pos;
|
|
198
|
-
while (nameSpacer.indexOf(src[pos]) === -1 && src[pos]) {
|
|
199
|
-
pos++;
|
|
200
|
-
}
|
|
201
|
-
return src.slice(start, pos);
|
|
202
|
-
}
|
|
203
|
-
function parseNode() {
|
|
204
|
-
var posStart = pos;
|
|
205
|
-
pos++;
|
|
206
|
-
var tagName = parseName();
|
|
207
|
-
var attributes = {};
|
|
208
|
-
var children = [];
|
|
209
|
-
// parsing attributes
|
|
210
|
-
while (src.charCodeAt(pos) !== closeBracketCC && src[pos]) {
|
|
211
|
-
var c = src.charCodeAt(pos);
|
|
212
|
-
if ((c > 64 && c < 91) || (c > 96 && c < 123)) {
|
|
213
|
-
// if('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.indexOf(src[pos])!==-1 ){
|
|
214
|
-
var name_1 = parseName();
|
|
215
|
-
// search beginning of the string
|
|
216
|
-
var code = src.charCodeAt(pos);
|
|
217
|
-
while (code &&
|
|
218
|
-
code !== singleQuoteCC &&
|
|
219
|
-
code !== doubleQuoteCC &&
|
|
220
|
-
!((code > 64 && code < 91) || (code > 96 && code < 123)) &&
|
|
221
|
-
code !== closeBracketCC) {
|
|
222
|
-
pos++;
|
|
223
|
-
code = src.charCodeAt(pos);
|
|
224
|
-
}
|
|
225
|
-
var value = void 0;
|
|
226
|
-
if (code === singleQuoteCC || code === doubleQuoteCC) {
|
|
227
|
-
value = parseString();
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
value = null;
|
|
231
|
-
pos--;
|
|
232
|
-
}
|
|
233
|
-
attributes[name_1] = value === null ? null : translateEntities(value);
|
|
234
|
-
}
|
|
235
|
-
pos++;
|
|
236
|
-
}
|
|
237
|
-
// optional parsing of children
|
|
238
|
-
if (src.charCodeAt(pos - 1) !== slashCC) {
|
|
239
|
-
pos++;
|
|
240
|
-
children = parseChildren(tagName);
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
pos++;
|
|
244
|
-
}
|
|
245
|
-
return {
|
|
246
|
-
tagName: tagName,
|
|
247
|
-
attributes: attributes,
|
|
248
|
-
children: children,
|
|
249
|
-
posStart: posStart,
|
|
250
|
-
posEnd: pos,
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Parses a string, that starts with a char and with the same usually ' or "
|
|
255
|
-
* character starting at `pos`.
|
|
256
|
-
* @returns {string}
|
|
257
|
-
*/
|
|
258
|
-
function parseString() {
|
|
259
|
-
var startChar = src[pos];
|
|
260
|
-
var startpos = pos + 1;
|
|
261
|
-
pos = src.indexOf(startChar, startpos);
|
|
262
|
-
return src.slice(startpos, pos);
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
*
|
|
266
|
-
*/
|
|
267
|
-
function findElements() {
|
|
268
|
-
var r = new RegExp("\\s" + options.attrName + "\\s*=['\"]" + options.attrValue + "['\"]").exec(src);
|
|
269
|
-
if (r) {
|
|
270
|
-
return r.index;
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
return -1;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
exports.parseXml = parseXml;
|
|
278
|
-
/**
|
|
279
|
-
* behaves the same way as Array.filter, if the filter method return true, the element is in the resultList
|
|
280
|
-
* @params {Array} children - the children of a node
|
|
281
|
-
* @param {function} f - the filter method
|
|
282
|
-
*/
|
|
283
|
-
function filter(children, f, dept, path) {
|
|
284
|
-
if (dept === void 0) { dept = 0; }
|
|
285
|
-
if (path === void 0) { path = ""; }
|
|
286
|
-
var out = [];
|
|
287
|
-
children.forEach(function (child, i) {
|
|
288
|
-
if (typeof child === "object") {
|
|
289
|
-
if (f(child, i, dept, path)) {
|
|
290
|
-
out.push(child);
|
|
291
|
-
}
|
|
292
|
-
if (child.children.length > 0) {
|
|
293
|
-
var kids = filter(child.children, f, dept + 1, (path ? path + "." : "") + i + "." + child.tagName);
|
|
294
|
-
out = out.concat(kids);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
return out;
|
|
299
|
-
}
|
|
300
|
-
exports.filter = filter;
|
|
301
|
-
/**
|
|
302
|
-
* use this method to read the text content, of some node.
|
|
303
|
-
* It is great if you have mixed content like:
|
|
304
|
-
* this text has some <b>big</b> text and a <a href=''>link</a>
|
|
305
|
-
* @return {string}
|
|
306
|
-
*/
|
|
307
|
-
function toContentString(tDom) {
|
|
308
|
-
if (Array.isArray(tDom)) {
|
|
309
|
-
var out_1 = "";
|
|
310
|
-
tDom.forEach(function (e) {
|
|
311
|
-
out_1 += " " + toContentString(e);
|
|
312
|
-
out_1 = out_1.trim();
|
|
313
|
-
});
|
|
314
|
-
return out_1;
|
|
315
|
-
}
|
|
316
|
-
else if (typeof tDom === "object") {
|
|
317
|
-
return toContentString(tDom.children);
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
return " " + translateEntities(tDom);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
exports.toContentString = toContentString;
|
|
324
|
-
/**
|
|
325
|
-
* @param {string} str
|
|
326
|
-
* @returns {string}
|
|
327
|
-
*/
|
|
328
|
-
function translateEntities(str) {
|
|
329
|
-
if (str.indexOf("&") < 0) {
|
|
330
|
-
// Fast path for when there's no entity
|
|
331
|
-
return str;
|
|
332
|
-
}
|
|
333
|
-
return str
|
|
334
|
-
.replace(/</g, "<")
|
|
335
|
-
.replace(/>/g, ">")
|
|
336
|
-
.replace(/"/g, '"')
|
|
337
|
-
.replace(/'/g, "'")
|
|
338
|
-
.replace(/&#x([A-Fa-f0-9]+);/g, function (_, code) {
|
|
339
|
-
return String.fromCharCode(parseInt(code, 16));
|
|
340
|
-
})
|
|
341
|
-
.replace(/&/g, "&");
|
|
342
|
-
}
|
|
343
|
-
function getElementById(src, id) {
|
|
344
|
-
var out = parseXml(src, {
|
|
345
|
-
attrValue: id,
|
|
346
|
-
});
|
|
347
|
-
return out[0];
|
|
348
|
-
}
|
|
349
|
-
exports.getElementById = getElementById;
|
|
350
|
-
function getElementsByClassName(src, classname) {
|
|
351
|
-
var out = parseXml(src, {
|
|
352
|
-
attrName: "class",
|
|
353
|
-
attrValue: "[a-zA-Z0-9- ]*" + classname + "[a-zA-Z0-9- ]*",
|
|
354
|
-
});
|
|
355
|
-
return out;
|
|
356
|
-
}
|
|
357
|
-
exports.getElementsByClassName = getElementsByClassName;
|
|
@@ -1,17 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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;
|
|
@@ -1,24 +0,0 @@
|
|
|
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[]];
|