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.
Files changed (189) hide show
  1. package/VERSION +1 -1
  2. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  3. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
  4. package/dist/commonjs/core/main/worker/worker_main.js +8 -9
  5. package/dist/commonjs/features/features_object.js +1 -1
  6. package/dist/commonjs/features/list/dash.js +2 -2
  7. package/dist/commonjs/features/types.d.ts +8 -3
  8. package/dist/commonjs/main_thread/api/public_api.js +2 -7
  9. package/dist/commonjs/multithread_types.d.ts +1 -1
  10. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +4 -3
  11. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +11 -4
  12. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +2 -1
  13. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +12 -3
  14. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +3 -2
  15. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +22 -11
  16. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +11 -2
  17. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +74 -3
  18. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +2 -1
  19. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +3 -1
  20. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.d.ts +17 -0
  21. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.js +19 -0
  22. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +24 -0
  23. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +400 -0
  24. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +24 -0
  25. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +33 -0
  26. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +23 -0
  27. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +70 -0
  28. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +22 -0
  29. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +118 -0
  30. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +23 -0
  31. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +154 -0
  32. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +22 -0
  33. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +70 -0
  34. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +23 -0
  35. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +221 -0
  36. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +23 -0
  37. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +179 -0
  38. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +22 -0
  39. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +256 -0
  40. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +23 -0
  41. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +152 -0
  42. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +22 -0
  43. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +60 -0
  44. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +24 -0
  45. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +125 -0
  46. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +22 -0
  47. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +36 -0
  48. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +24 -0
  49. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +82 -0
  50. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +176 -0
  51. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +382 -0
  52. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +24 -0
  53. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +142 -0
  54. package/dist/commonjs/parsers/manifest/dash/node_parser_types.d.ts +5 -3
  55. package/dist/commonjs/public_types.d.ts +1 -1
  56. package/dist/commonjs/transports/dash/manifest_parser.js +33 -4
  57. package/dist/commonjs/utils/xml-parser.d.ts +70 -0
  58. package/dist/commonjs/utils/xml-parser.js +357 -0
  59. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  60. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  61. package/dist/es2017/core/main/worker/worker_main.js +8 -9
  62. package/dist/es2017/features/features_object.js +1 -1
  63. package/dist/es2017/features/list/dash.js +2 -2
  64. package/dist/es2017/features/types.d.ts +8 -3
  65. package/dist/es2017/main_thread/api/public_api.js +2 -7
  66. package/dist/es2017/multithread_types.d.ts +1 -1
  67. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +4 -3
  68. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +12 -5
  69. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +2 -1
  70. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +13 -4
  71. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +3 -2
  72. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +22 -11
  73. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +11 -2
  74. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +49 -2
  75. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +2 -1
  76. package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +3 -1
  77. package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.d.ts +17 -0
  78. package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.js +17 -0
  79. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +24 -0
  80. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +358 -0
  81. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +24 -0
  82. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +30 -0
  83. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +23 -0
  84. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +45 -0
  85. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +22 -0
  86. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +77 -0
  87. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +23 -0
  88. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +101 -0
  89. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +22 -0
  90. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +45 -0
  91. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +23 -0
  92. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +179 -0
  93. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +23 -0
  94. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +137 -0
  95. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +22 -0
  96. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +214 -0
  97. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +23 -0
  98. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +111 -0
  99. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +22 -0
  100. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +41 -0
  101. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +24 -0
  102. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +84 -0
  103. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +22 -0
  104. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +33 -0
  105. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +24 -0
  106. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +57 -0
  107. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +176 -0
  108. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +310 -0
  109. package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +24 -0
  110. package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +114 -0
  111. package/dist/es2017/parsers/manifest/dash/node_parser_types.d.ts +5 -3
  112. package/dist/es2017/public_types.d.ts +1 -1
  113. package/dist/es2017/transports/dash/manifest_parser.js +33 -4
  114. package/dist/es2017/utils/xml-parser.d.ts +70 -0
  115. package/dist/es2017/utils/xml-parser.js +322 -0
  116. package/dist/mpd-parser.wasm +0 -0
  117. package/dist/rx-player.js +141 -65
  118. package/dist/rx-player.min.js +1 -1
  119. package/dist/worker.js +8 -3
  120. package/package.json +1 -1
  121. package/.vscode/settings.json +0 -9
  122. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/index.d.ts +0 -0
  123. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/index.js +0 -0
  124. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.d.ts +0 -0
  125. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.js +0 -0
  126. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.d.ts +0 -0
  127. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.js +0 -0
  128. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.d.ts +0 -0
  129. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.js +0 -0
  130. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.d.ts +0 -0
  131. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.js +0 -0
  132. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.d.ts +0 -0
  133. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.js +0 -0
  134. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.d.ts +0 -0
  135. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.js +0 -0
  136. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.d.ts +0 -0
  137. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.js +0 -0
  138. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.d.ts +0 -0
  139. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.js +0 -0
  140. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.d.ts +0 -0
  141. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.js +0 -0
  142. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.d.ts +0 -0
  143. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.js +0 -0
  144. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.d.ts +0 -0
  145. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.js +0 -0
  146. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
  147. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.js +0 -0
  148. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
  149. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.js +0 -0
  150. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.d.ts +0 -0
  151. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.js +0 -0
  152. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.d.ts +0 -0
  153. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.js +0 -0
  154. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.d.ts +0 -0
  155. /package/dist/commonjs/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.js +0 -0
  156. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/index.d.ts +0 -0
  157. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/index.js +0 -0
  158. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.d.ts +0 -0
  159. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/AdaptationSet.js +0 -0
  160. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.d.ts +0 -0
  161. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/BaseURL.js +0 -0
  162. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.d.ts +0 -0
  163. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentComponent.js +0 -0
  164. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.d.ts +0 -0
  165. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/ContentProtection.js +0 -0
  166. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.d.ts +0 -0
  167. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/EventStream.js +0 -0
  168. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.d.ts +0 -0
  169. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Initialization.js +0 -0
  170. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.d.ts +0 -0
  171. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/MPD.js +0 -0
  172. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.d.ts +0 -0
  173. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Period.js +0 -0
  174. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.d.ts +0 -0
  175. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/Representation.js +0 -0
  176. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.d.ts +0 -0
  177. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentBase.js +0 -0
  178. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.d.ts +0 -0
  179. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentList.js +0 -0
  180. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
  181. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTemplate.js +0 -0
  182. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
  183. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentTimeline.js +0 -0
  184. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.d.ts +0 -0
  185. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/SegmentURL.js +0 -0
  186. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.d.ts +0 -0
  187. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/node_parsers/utils.js +0 -0
  188. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.d.ts +0 -0
  189. /package/dist/es2017/parsers/manifest/dash/{js-parser → native-parser}/parse_from_document.js +0 -0
@@ -0,0 +1,60 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ var object_assign_1 = require("../../../../../utils/object_assign");
35
+ var SegmentBase_1 = require("./SegmentBase");
36
+ var SegmentURL_1 = require("./SegmentURL");
37
+ /**
38
+ * @param {Object} root
39
+ * @returns {Array}
40
+ */
41
+ function parseSegmentList(root) {
42
+ var _a = __read((0, SegmentBase_1.default)(root), 2), base = _a[0], baseWarnings = _a[1];
43
+ var warnings = baseWarnings;
44
+ var list = [];
45
+ var segmentListChildren = root.children;
46
+ for (var i = 0; i < segmentListChildren.length; i++) {
47
+ var currentNode = segmentListChildren[i];
48
+ if (typeof currentNode === "string") {
49
+ continue;
50
+ }
51
+ if (currentNode.tagName === "SegmentURL") {
52
+ var _b = __read((0, SegmentURL_1.default)(currentNode), 2), segmentURL = _b[0], segmentURLWarnings = _b[1];
53
+ list.push(segmentURL);
54
+ warnings = warnings.concat(segmentURLWarnings);
55
+ }
56
+ }
57
+ var ret = (0, object_assign_1.default)(base, { list: list });
58
+ return [ret, warnings];
59
+ }
60
+ exports.default = parseSegmentList;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright 2015 CANAL+ Group
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { ITNode } from "../../../../../utils/xml-parser";
17
+ import type { ISegmentTemplateIntermediateRepresentation } from "../../node_parser_types";
18
+ /**
19
+ * Parse a SegmentTemplate element into a SegmentTemplate intermediate
20
+ * representation.
21
+ * @param {Object} root - The SegmentTemplate root element.
22
+ * @returns {Array}
23
+ */
24
+ export default function parseSegmentTemplate(root: ITNode): [ISegmentTemplateIntermediateRepresentation, Error[]];
@@ -0,0 +1,125 @@
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 object_assign_1 = require("../../../../../utils/object_assign");
47
+ var SegmentBase_1 = require("./SegmentBase");
48
+ var SegmentTimeline_1 = require("./SegmentTimeline");
49
+ var utils_1 = require("./utils");
50
+ /**
51
+ * Parse a SegmentTemplate element into a SegmentTemplate intermediate
52
+ * representation.
53
+ * @param {Object} root - The SegmentTemplate root element.
54
+ * @returns {Array}
55
+ */
56
+ function parseSegmentTemplate(root) {
57
+ var e_1, _a;
58
+ var _b = __read((0, SegmentBase_1.default)(root), 2), base = _b[0], segmentBaseWarnings = _b[1];
59
+ var warnings = segmentBaseWarnings;
60
+ var timelineParser;
61
+ // First look for a possible SegmentTimeline
62
+ for (var i = 0; i < root.children.length; i++) {
63
+ var currentNode = root.children[i];
64
+ if (typeof currentNode !== "string" && currentNode.tagName === "SegmentTimeline") {
65
+ timelineParser = (0, SegmentTimeline_1.default)(currentNode);
66
+ }
67
+ }
68
+ var ret = (0, object_assign_1.default)({}, base, {
69
+ duration: base.duration,
70
+ timelineParser: timelineParser,
71
+ });
72
+ var parseValue = (0, utils_1.ValueParser)(ret, warnings);
73
+ try {
74
+ for (var _c = __values(Object.keys(root.attributes)), _d = _c.next(); !_d.done; _d = _c.next()) {
75
+ var attributeName = _d.value;
76
+ var attributeVal = root.attributes[attributeName];
77
+ if ((0, is_null_or_undefined_1.default)(attributeVal)) {
78
+ continue;
79
+ }
80
+ switch (attributeName) {
81
+ case "initialization":
82
+ if ((0, is_null_or_undefined_1.default)(ret.initialization)) {
83
+ ret.initialization = { media: attributeVal };
84
+ }
85
+ break;
86
+ case "index":
87
+ ret.index = attributeVal;
88
+ break;
89
+ case "availabilityTimeOffset":
90
+ parseValue(attributeVal, {
91
+ asKey: "availabilityTimeOffset",
92
+ parser: utils_1.parseMPDFloat,
93
+ dashName: "availabilityTimeOffset",
94
+ });
95
+ break;
96
+ case "availabilityTimeComplete":
97
+ parseValue(attributeVal, {
98
+ asKey: "availabilityTimeComplete",
99
+ parser: utils_1.parseBoolean,
100
+ dashName: "availabilityTimeComplete",
101
+ });
102
+ break;
103
+ case "media":
104
+ ret.media = attributeVal;
105
+ break;
106
+ case "bitstreamSwitching":
107
+ parseValue(attributeVal, {
108
+ asKey: "bitstreamSwitching",
109
+ parser: utils_1.parseBoolean,
110
+ dashName: "bitstreamSwitching",
111
+ });
112
+ break;
113
+ }
114
+ }
115
+ }
116
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
117
+ finally {
118
+ try {
119
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
120
+ }
121
+ finally { if (e_1) throw e_1.error; }
122
+ }
123
+ return [ret, warnings];
124
+ }
125
+ exports.default = parseSegmentTemplate;
@@ -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 { ITimelineParser } from "../../node_parser_types";
18
+ /**
19
+ * @param {Object} root
20
+ * @returns {Function}
21
+ */
22
+ export default function createSegmentTimelineParser(root: ITNode): ITimelineParser;
@@ -0,0 +1,36 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ /**
19
+ * @param {Object} root
20
+ * @returns {Function}
21
+ */
22
+ function createSegmentTimelineParser(root) {
23
+ var result = root.children;
24
+ return function () {
25
+ // In the great majority of cases, there's only `S` elements inside.
26
+ // However still clean-up just in rare occasions when that's not the case.
27
+ for (var i = result.length - 1; i >= 0; i--) {
28
+ var item = result[i];
29
+ if (typeof item === "string" || item.tagName !== "S") {
30
+ result.splice(i, 1);
31
+ }
32
+ }
33
+ return result;
34
+ };
35
+ }
36
+ exports.default = createSegmentTimelineParser;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright 2015 CANAL+ Group
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { ITNode } from "../../../../../utils/xml-parser";
17
+ import type { ISegmentUrlIntermediateRepresentation } from "../../node_parser_types";
18
+ /**
19
+ * Parse a SegmentURL element into a SegmentURL intermediate
20
+ * representation.
21
+ * @param {Object} root - The SegmentURL root element.
22
+ * @returns {Array}
23
+ */
24
+ export default function parseSegmentURL(root: ITNode): [ISegmentUrlIntermediateRepresentation, Error[]];
@@ -0,0 +1,82 @@
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
+ * Parse a SegmentURL element into a SegmentURL intermediate
33
+ * representation.
34
+ * @param {Object} root - The SegmentURL root element.
35
+ * @returns {Array}
36
+ */
37
+ function parseSegmentURL(root) {
38
+ var e_1, _a;
39
+ var parsedSegmentURL = {};
40
+ var warnings = [];
41
+ var parseValue = (0, utils_1.ValueParser)(parsedSegmentURL, warnings);
42
+ try {
43
+ for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
44
+ var attributeName = _c.value;
45
+ var attributeVal = root.attributes[attributeName];
46
+ if ((0, is_null_or_undefined_1.default)(attributeVal)) {
47
+ continue;
48
+ }
49
+ switch (attributeName) {
50
+ case "media":
51
+ parsedSegmentURL.media = attributeVal;
52
+ break;
53
+ case "indexRange":
54
+ parseValue(attributeVal, {
55
+ asKey: "indexRange",
56
+ parser: utils_1.parseByteRange,
57
+ dashName: "indexRange",
58
+ });
59
+ break;
60
+ case "index":
61
+ parsedSegmentURL.index = attributeVal;
62
+ break;
63
+ case "mediaRange":
64
+ parseValue(attributeVal, {
65
+ asKey: "mediaRange",
66
+ parser: utils_1.parseByteRange,
67
+ dashName: "mediaRange",
68
+ });
69
+ break;
70
+ }
71
+ }
72
+ }
73
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
74
+ finally {
75
+ try {
76
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
77
+ }
78
+ finally { if (e_1) throw e_1.error; }
79
+ }
80
+ return [parsedSegmentURL, warnings];
81
+ }
82
+ exports.default = parseSegmentURL;
@@ -0,0 +1,176 @@
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 { IScheme } from "../../node_parser_types";
18
+ /**
19
+ * Parse MPD boolean attributes.
20
+ *
21
+ * The returned value is a tuple of two elements where:
22
+ * 1. the first value is the parsed boolean - or `null` if we could not parse
23
+ * it
24
+ * 2. the second value is a possible error encountered while parsing this
25
+ * value - set to `null` if no error was encountered.
26
+ * @param {string} val - The value to parse
27
+ * @param {string} displayName - The name of the property. Used for error
28
+ * formatting.
29
+ * @returns {Array.<Boolean | Error | null>}
30
+ */
31
+ declare function parseBoolean(val: string, displayName: string): [boolean, MPDError | null];
32
+ /**
33
+ * Parse MPD integer attributes.
34
+ *
35
+ * The returned value is a tuple of two elements where:
36
+ * 1. the first value is the parsed boolean - or `null` if we could not parse
37
+ * it
38
+ * 2. the second value is a possible error encountered while parsing this
39
+ * value - set to `null` if no error was encountered.
40
+ * @param {string} val - The value to parse
41
+ * @param {string} displayName - The name of the property. Used for error
42
+ * formatting.
43
+ * @returns {Array.<number | Error | null>}
44
+ */
45
+ declare function parseMPDInteger(val: string, displayName: string): [number | null, MPDError | null];
46
+ /**
47
+ * Parse MPD float attributes.
48
+ *
49
+ * The returned value is a tuple of two elements where:
50
+ * 1. the first value is the parsed boolean - or `null` if we could not parse
51
+ * it
52
+ * 2. the second value is a possible error encountered while parsing this
53
+ * value - set to `null` if no error was encountered.
54
+ * @param {string} val - The value to parse
55
+ * @param {string} displayName - The name of the property. Used for error
56
+ * formatting.
57
+ * @returns {Array.<number | Error | null>}
58
+ */
59
+ declare function parseMPDFloat(val: string, displayName: string): [number | null, MPDError | null];
60
+ /**
61
+ * Parse MPD attributes which are either integer or boolean values.
62
+ *
63
+ * The returned value is a tuple of two elements where:
64
+ * 1. the first value is the parsed value - or `null` if we could not parse
65
+ * it
66
+ * 2. the second value is a possible error encountered while parsing this
67
+ * value - set to `null` if no error was encountered.
68
+ * @param {string} val - The value to parse
69
+ * @param {string} displayName - The name of the property. Used for error
70
+ * formatting.
71
+ * @returns {Array.<Boolean | number | Error | null>}
72
+ */
73
+ declare function parseIntOrBoolean(val: string, displayName: string): [boolean | number | null, MPDError | null];
74
+ /**
75
+ * Parse MPD date attributes.
76
+ *
77
+ * The returned value is a tuple of two elements where:
78
+ * 1. the first value is the parsed value - or `null` if we could not parse
79
+ * it
80
+ * 2. the second value is a possible error encountered while parsing this
81
+ * value - set to `null` if no error was encountered.
82
+ * @param {string} val - The value to parse
83
+ * @param {string} displayName - The name of the property. Used for error
84
+ * formatting.
85
+ * @returns {Array.<Date | null | Error>}
86
+ */
87
+ declare function parseDateTime(val: string, displayName: string): [number | null, MPDError | null];
88
+ /**
89
+ * Parse MPD ISO8601 duration attributes into seconds.
90
+ *
91
+ * The returned value is a tuple of two elements where:
92
+ * 1. the first value is the parsed value - or `null` if we could not parse
93
+ * it
94
+ * 2. the second value is a possible error encountered while parsing this
95
+ * value - set to `null` if no error was encountered.
96
+ * @param {string} val - The value to parse
97
+ * @param {string} displayName - The name of the property. Used for error
98
+ * formatting.
99
+ * @returns {Array.<number | Error | null>}
100
+ */
101
+ declare function parseDuration(val: string, displayName: string): [number | null, MPDError | null];
102
+ /**
103
+ * Parse MPD byterange attributes into arrays of two elements: the start and
104
+ * the end.
105
+ *
106
+ * The returned value is a tuple of two elements where:
107
+ * 1. the first value is the parsed value - or `null` if we could not parse
108
+ * it
109
+ * 2. the second value is a possible error encountered while parsing this
110
+ * value - set to `null` if no error was encountered.
111
+ * @param {string} val
112
+ * @param {string} displayName
113
+ * @returns {Array.<Array.<number> | Error | null>}
114
+ */
115
+ declare function parseByteRange(val: string, displayName: string): [[number, number] | null, MPDError | null];
116
+ /**
117
+ * Parse MPD base64 attribute into an Uint8Array.
118
+ * the end.
119
+ *
120
+ * The returned value is a tuple of two elements where:
121
+ * 1. the first value is the parsed value - or `null` if we could not parse
122
+ * it
123
+ * 2. the second value is a possible error encountered while parsing this
124
+ * value - set to `null` if no error was encountered.
125
+ * @param {string} val
126
+ * @param {string} displayName
127
+ * @returns {Uint8Array | Error | null>}
128
+ */
129
+ declare function parseBase64(val: string, displayName: string): [Uint8Array | null, MPDError | null];
130
+ /**
131
+ * Some values in the MPD can be expressed as divisions of integers (e.g. frame
132
+ * rates).
133
+ * This function tries to convert it to a floating point value.
134
+ * @param {string} val
135
+ * @param {string} displayName
136
+ * @returns {Array.<number | Error | null>}
137
+ */
138
+ declare function parseMaybeDividedNumber(val: string, displayName: string): [number | null, MPDError | null];
139
+ /**
140
+ * @param {Object} root
141
+ * @returns {Object}
142
+ */
143
+ declare function parseScheme(root: ITNode): IScheme;
144
+ /**
145
+ * Create a function to factorize the MPD parsing logic.
146
+ * @param {Object} dest - The destination object which will contain the parsed
147
+ * values.
148
+ * @param {Array.<Error>} warnings - An array which will contain every parsing
149
+ * error encountered.
150
+ * @return {Function}
151
+ */
152
+ declare function ValueParser<T>(dest: T, warnings: Error[]): (val: string, { asKey, parser, dashName, }: {
153
+ asKey: keyof T;
154
+ parser: (value: string, displayName: string) => [T[keyof T] | null, MPDError | null];
155
+ dashName: string;
156
+ }) => void;
157
+ /**
158
+ * Error arising when parsing the MPD.
159
+ * @class MPDError
160
+ * @extends Error
161
+ */
162
+ declare class MPDError extends Error {
163
+ readonly name: "MPDError";
164
+ readonly message: string;
165
+ /**
166
+ * @param {string} message
167
+ */
168
+ constructor(message: string);
169
+ }
170
+ /**
171
+ * Obtain the equivalent of the `textContent` HTMLElement call for that node.
172
+ * @param {Array} children
173
+ * @returns {string}
174
+ */
175
+ export declare function textContent(children: Array<ITNode | string>): string;
176
+ export { MPDError, ValueParser, parseBase64, parseBoolean, parseByteRange, parseDateTime, parseDuration, parseIntOrBoolean, parseMaybeDividedNumber, parseMPDFloat, parseMPDInteger, parseScheme, };