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,400 @@
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.createAdaptationSetIntermediateRepresentation = void 0;
46
+ var is_null_or_undefined_1 = require("../../../../../utils/is_null_or_undefined");
47
+ var BaseURL_1 = require("./BaseURL");
48
+ var ContentComponent_1 = require("./ContentComponent");
49
+ var ContentProtection_1 = require("./ContentProtection");
50
+ var Representation_1 = require("./Representation");
51
+ var SegmentBase_1 = require("./SegmentBase");
52
+ var SegmentList_1 = require("./SegmentList");
53
+ var SegmentTemplate_1 = require("./SegmentTemplate");
54
+ var utils_1 = require("./utils");
55
+ /**
56
+ * Parse child nodes from an AdaptationSet.
57
+ * @param {Array.<ITNode | string>} adaptationSetChildren - The AdaptationSet child nodes.
58
+ * @returns {Array.<Object>}
59
+ */
60
+ function parseAdaptationSetChildren(adaptationSetChildren) {
61
+ var children = {
62
+ baseURLs: [],
63
+ representations: [],
64
+ };
65
+ var contentProtections = [];
66
+ var warnings = [];
67
+ for (var i = 0; i < adaptationSetChildren.length; i++) {
68
+ var currentNode = adaptationSetChildren[i];
69
+ if (typeof currentNode === "string") {
70
+ continue;
71
+ }
72
+ switch (currentNode.tagName) {
73
+ case "Accessibility":
74
+ if (children.accessibilities === undefined) {
75
+ children.accessibilities = [(0, utils_1.parseScheme)(currentNode)];
76
+ }
77
+ else {
78
+ children.accessibilities.push((0, utils_1.parseScheme)(currentNode));
79
+ }
80
+ break;
81
+ case "BaseURL":
82
+ var _a = __read((0, BaseURL_1.default)(currentNode), 2), baseURLObj = _a[0], baseURLWarnings = _a[1];
83
+ if (baseURLObj !== undefined) {
84
+ children.baseURLs.push(baseURLObj);
85
+ }
86
+ if (baseURLWarnings.length > 0) {
87
+ warnings = warnings.concat(baseURLWarnings);
88
+ }
89
+ break;
90
+ case "ContentComponent":
91
+ children.contentComponent = (0, ContentComponent_1.default)(currentNode);
92
+ break;
93
+ case "EssentialProperty":
94
+ if ((0, is_null_or_undefined_1.default)(children.essentialProperties)) {
95
+ children.essentialProperties = [(0, utils_1.parseScheme)(currentNode)];
96
+ }
97
+ else {
98
+ children.essentialProperties.push((0, utils_1.parseScheme)(currentNode));
99
+ }
100
+ break;
101
+ case "InbandEventStream":
102
+ if (children.inbandEventStreams === undefined) {
103
+ children.inbandEventStreams = [];
104
+ }
105
+ children.inbandEventStreams.push((0, utils_1.parseScheme)(currentNode));
106
+ break;
107
+ case "Label":
108
+ var label = (0, utils_1.textContent)(currentNode.children);
109
+ if (label !== null && label !== undefined) {
110
+ children.label = label;
111
+ }
112
+ break;
113
+ case "Representation":
114
+ var _b = __read((0, Representation_1.createRepresentationIntermediateRepresentation)(currentNode), 2), representation = _b[0], representationWarnings = _b[1];
115
+ children.representations.push(representation);
116
+ if (representationWarnings.length > 0) {
117
+ warnings = warnings.concat(representationWarnings);
118
+ }
119
+ break;
120
+ case "Role":
121
+ if ((0, is_null_or_undefined_1.default)(children.roles)) {
122
+ children.roles = [(0, utils_1.parseScheme)(currentNode)];
123
+ }
124
+ else {
125
+ children.roles.push((0, utils_1.parseScheme)(currentNode));
126
+ }
127
+ break;
128
+ case "SupplementalProperty":
129
+ if ((0, is_null_or_undefined_1.default)(children.supplementalProperties)) {
130
+ children.supplementalProperties = [(0, utils_1.parseScheme)(currentNode)];
131
+ }
132
+ else {
133
+ children.supplementalProperties.push((0, utils_1.parseScheme)(currentNode));
134
+ }
135
+ break;
136
+ case "SegmentBase":
137
+ var _c = __read((0, SegmentBase_1.default)(currentNode), 2), segmentBase = _c[0], segmentBaseWarnings = _c[1];
138
+ children.segmentBase = segmentBase;
139
+ if (segmentBaseWarnings.length > 0) {
140
+ warnings = warnings.concat(segmentBaseWarnings);
141
+ }
142
+ break;
143
+ case "SegmentList":
144
+ var _d = __read((0, SegmentList_1.default)(currentNode), 2), segmentList = _d[0], segmentListWarnings = _d[1];
145
+ children.segmentList = segmentList;
146
+ if (segmentListWarnings.length > 0) {
147
+ warnings = warnings.concat(segmentListWarnings);
148
+ }
149
+ break;
150
+ case "SegmentTemplate":
151
+ var _e = __read((0, SegmentTemplate_1.default)(currentNode), 2), segmentTemplate = _e[0], segmentTemplateWarnings = _e[1];
152
+ children.segmentTemplate = segmentTemplate;
153
+ if (segmentTemplateWarnings.length > 0) {
154
+ warnings = warnings.concat(segmentTemplateWarnings);
155
+ }
156
+ break;
157
+ case "ContentProtection":
158
+ var _f = __read((0, ContentProtection_1.default)(currentNode), 2), contentProtection = _f[0], contentProtectionWarnings = _f[1];
159
+ if (contentProtectionWarnings.length > 0) {
160
+ warnings = warnings.concat(contentProtectionWarnings);
161
+ }
162
+ if (contentProtection !== undefined) {
163
+ contentProtections.push(contentProtection);
164
+ }
165
+ break;
166
+ // case "Rating":
167
+ // children.rating = currentNode;
168
+ // break;
169
+ // case "Viewpoint":
170
+ // children.viewpoint = currentNode;
171
+ // break;
172
+ }
173
+ }
174
+ if (contentProtections.length > 0) {
175
+ children.contentProtections = contentProtections;
176
+ }
177
+ return [children, warnings];
178
+ }
179
+ /**
180
+ * Parse every attributes from an AdaptationSet root element into a simple JS
181
+ * object.
182
+ * @param {Object} root - The AdaptationSet root element.
183
+ * @returns {Array.<Object>}
184
+ */
185
+ function parseAdaptationSetAttributes(root) {
186
+ var e_1, _a;
187
+ var parsedAdaptation = {};
188
+ var warnings = [];
189
+ var parseValue = (0, utils_1.ValueParser)(parsedAdaptation, warnings);
190
+ try {
191
+ for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
192
+ var attributeName = _c.value;
193
+ var attributeVal = root.attributes[attributeName];
194
+ if ((0, is_null_or_undefined_1.default)(attributeVal)) {
195
+ continue;
196
+ }
197
+ switch (attributeName) {
198
+ case "id":
199
+ parsedAdaptation.id = attributeVal;
200
+ break;
201
+ case "group":
202
+ parseValue(attributeVal, {
203
+ asKey: "group",
204
+ parser: utils_1.parseMPDInteger,
205
+ dashName: "group",
206
+ });
207
+ break;
208
+ case "lang":
209
+ parsedAdaptation.language = attributeVal;
210
+ break;
211
+ case "contentType":
212
+ parsedAdaptation.contentType = attributeVal;
213
+ break;
214
+ case "par":
215
+ parsedAdaptation.par = attributeVal;
216
+ break;
217
+ case "minBandwidth":
218
+ parseValue(attributeVal, {
219
+ asKey: "minBitrate",
220
+ parser: utils_1.parseMPDInteger,
221
+ dashName: "minBandwidth",
222
+ });
223
+ break;
224
+ case "maxBandwidth":
225
+ parseValue(attributeVal, {
226
+ asKey: "maxBitrate",
227
+ parser: utils_1.parseMPDInteger,
228
+ dashName: "maxBandwidth",
229
+ });
230
+ break;
231
+ case "minWidth":
232
+ parseValue(attributeVal, {
233
+ asKey: "minWidth",
234
+ parser: utils_1.parseMPDInteger,
235
+ dashName: "minWidth",
236
+ });
237
+ break;
238
+ case "maxWidth":
239
+ parseValue(attributeVal, {
240
+ asKey: "maxWidth",
241
+ parser: utils_1.parseMPDInteger,
242
+ dashName: "maxWidth",
243
+ });
244
+ break;
245
+ case "minHeight":
246
+ parseValue(attributeVal, {
247
+ asKey: "minHeight",
248
+ parser: utils_1.parseMPDInteger,
249
+ dashName: "minHeight",
250
+ });
251
+ break;
252
+ case "maxHeight":
253
+ parseValue(attributeVal, {
254
+ asKey: "maxHeight",
255
+ parser: utils_1.parseMPDInteger,
256
+ dashName: "maxHeight",
257
+ });
258
+ break;
259
+ case "minFrameRate":
260
+ parseValue(attributeVal, {
261
+ asKey: "minFrameRate",
262
+ parser: utils_1.parseMaybeDividedNumber,
263
+ dashName: "minFrameRate",
264
+ });
265
+ break;
266
+ case "maxFrameRate":
267
+ parseValue(attributeVal, {
268
+ asKey: "maxFrameRate",
269
+ parser: utils_1.parseMaybeDividedNumber,
270
+ dashName: "maxFrameRate",
271
+ });
272
+ break;
273
+ case "selectionPriority":
274
+ parseValue(attributeVal, {
275
+ asKey: "selectionPriority",
276
+ parser: utils_1.parseMPDInteger,
277
+ dashName: "selectionPriority",
278
+ });
279
+ break;
280
+ case "segmentAlignment":
281
+ parseValue(attributeVal, {
282
+ asKey: "segmentAlignment",
283
+ parser: utils_1.parseIntOrBoolean,
284
+ dashName: "segmentAlignment",
285
+ });
286
+ break;
287
+ case "subsegmentAlignment":
288
+ parseValue(attributeVal, {
289
+ asKey: "subsegmentAlignment",
290
+ parser: utils_1.parseIntOrBoolean,
291
+ dashName: "subsegmentAlignment",
292
+ });
293
+ break;
294
+ case "bitstreamSwitching":
295
+ parseValue(attributeVal, {
296
+ asKey: "bitstreamSwitching",
297
+ parser: utils_1.parseBoolean,
298
+ dashName: "bitstreamSwitching",
299
+ });
300
+ break;
301
+ case "audioSamplingRate":
302
+ parsedAdaptation.audioSamplingRate = attributeVal;
303
+ break;
304
+ case "codecs":
305
+ parsedAdaptation.codecs = attributeVal;
306
+ break;
307
+ case "scte214:supplementalCodecs":
308
+ parsedAdaptation.supplementalCodecs = attributeVal;
309
+ break;
310
+ case "codingDependency":
311
+ parseValue(attributeVal, {
312
+ asKey: "codingDependency",
313
+ parser: utils_1.parseBoolean,
314
+ dashName: "codingDependency",
315
+ });
316
+ break;
317
+ case "frameRate":
318
+ parseValue(attributeVal, {
319
+ asKey: "frameRate",
320
+ parser: utils_1.parseMaybeDividedNumber,
321
+ dashName: "frameRate",
322
+ });
323
+ break;
324
+ case "height":
325
+ parseValue(attributeVal, {
326
+ asKey: "height",
327
+ parser: utils_1.parseMPDInteger,
328
+ dashName: "height",
329
+ });
330
+ break;
331
+ case "maxPlayoutRate":
332
+ parseValue(attributeVal, {
333
+ asKey: "maxPlayoutRate",
334
+ parser: utils_1.parseMPDFloat,
335
+ dashName: "maxPlayoutRate",
336
+ });
337
+ break;
338
+ case "maximumSAPPeriod":
339
+ parseValue(attributeVal, {
340
+ asKey: "maximumSAPPeriod",
341
+ parser: utils_1.parseMPDFloat,
342
+ dashName: "maximumSAPPeriod",
343
+ });
344
+ break;
345
+ case "mimeType":
346
+ parsedAdaptation.mimeType = attributeVal;
347
+ break;
348
+ case "profiles":
349
+ parsedAdaptation.profiles = attributeVal;
350
+ break;
351
+ case "segmentProfiles":
352
+ parsedAdaptation.segmentProfiles = attributeVal;
353
+ break;
354
+ case "width":
355
+ parseValue(attributeVal, {
356
+ asKey: "width",
357
+ parser: utils_1.parseMPDInteger,
358
+ dashName: "width",
359
+ });
360
+ break;
361
+ case "availabilityTimeOffset":
362
+ parseValue(attributeVal, {
363
+ asKey: "availabilityTimeOffset",
364
+ parser: utils_1.parseMPDFloat,
365
+ dashName: "availabilityTimeOffset",
366
+ });
367
+ break;
368
+ case "availabilityTimeComplete":
369
+ parseValue(attributeVal, {
370
+ asKey: "availabilityTimeComplete",
371
+ parser: utils_1.parseBoolean,
372
+ dashName: "availabilityTimeComplete",
373
+ });
374
+ break;
375
+ }
376
+ }
377
+ }
378
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
379
+ finally {
380
+ try {
381
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
382
+ }
383
+ finally { if (e_1) throw e_1.error; }
384
+ }
385
+ return [parsedAdaptation, warnings];
386
+ }
387
+ /**
388
+ * Parse an AdaptationSet element into an AdaptationSet intermediate
389
+ * representation.
390
+ * @param {Object} adaptationSetElement - The AdaptationSet root element.
391
+ * @returns {Array.<Object>}
392
+ */
393
+ function createAdaptationSetIntermediateRepresentation(adaptationSetElement) {
394
+ var childNodes = adaptationSetElement.children;
395
+ var _a = __read(parseAdaptationSetChildren(childNodes), 2), children = _a[0], childrenWarnings = _a[1];
396
+ var _b = __read(parseAdaptationSetAttributes(adaptationSetElement), 2), attributes = _b[0], attrsWarnings = _b[1];
397
+ var warnings = childrenWarnings.concat(attrsWarnings);
398
+ return [{ children: children, attributes: attributes }, warnings];
399
+ }
400
+ exports.createAdaptationSetIntermediateRepresentation = createAdaptationSetIntermediateRepresentation;
@@ -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 { IBaseUrlIntermediateRepresentation } from "../../node_parser_types";
18
+ /**
19
+ * Parse an BaseURL element into an BaseURL intermediate
20
+ * representation.
21
+ * @param {Object | string} root - The BaseURL root element.
22
+ * @returns {Array.<Object|undefined>}
23
+ */
24
+ export default function parseBaseURL(root: ITNode | string): [IBaseUrlIntermediateRepresentation | undefined, Error[]];
@@ -0,0 +1,33 @@
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
+ var utils_1 = require("./utils");
19
+ /**
20
+ * Parse an BaseURL element into an BaseURL intermediate
21
+ * representation.
22
+ * @param {Object | string} root - The BaseURL root element.
23
+ * @returns {Array.<Object|undefined>}
24
+ */
25
+ function parseBaseURL(root) {
26
+ var value = typeof root === "string" ? root : (0, utils_1.textContent)(root.children);
27
+ var warnings = [];
28
+ if (value === null || value.length === 0) {
29
+ return [undefined, warnings];
30
+ }
31
+ return [{ value: value }, warnings];
32
+ }
33
+ exports.default = parseBaseURL;
@@ -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 { IContentComponentAttributes } from "../../node_parser_types";
18
+ /**
19
+ * Parse a "ContentComponent" Element in a DASH MPD.
20
+ * @param {Object} root
21
+ * @returns {Object}
22
+ */
23
+ export default function parseContentComponent(root: ITNode): IContentComponentAttributes;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright 2015 CANAL+ Group
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __values = (this && this.__values) || function(o) {
18
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
19
+ if (m) return m.call(o);
20
+ if (o && typeof o.length === "number") return {
21
+ next: function () {
22
+ if (o && i >= o.length) o = void 0;
23
+ return { value: o && o[i++], done: !o };
24
+ }
25
+ };
26
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ var is_null_or_undefined_1 = require("../../../../../utils/is_null_or_undefined");
30
+ /**
31
+ * Parse a "ContentComponent" Element in a DASH MPD.
32
+ * @param {Object} root
33
+ * @returns {Object}
34
+ */
35
+ function parseContentComponent(root) {
36
+ var e_1, _a;
37
+ var ret = {};
38
+ try {
39
+ for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
40
+ var attributeName = _c.value;
41
+ var attributeVal = root.attributes[attributeName];
42
+ if ((0, is_null_or_undefined_1.default)(attributeVal)) {
43
+ continue;
44
+ }
45
+ switch (attributeName) {
46
+ case "id":
47
+ ret.id = attributeVal;
48
+ break;
49
+ case "lang":
50
+ ret.language = attributeVal;
51
+ break;
52
+ case "contentType":
53
+ ret.contentType = attributeVal;
54
+ break;
55
+ case "par":
56
+ ret.par = attributeVal;
57
+ break;
58
+ }
59
+ }
60
+ }
61
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
62
+ finally {
63
+ try {
64
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
65
+ }
66
+ finally { if (e_1) throw e_1.error; }
67
+ }
68
+ return ret;
69
+ }
70
+ exports.default = parseContentComponent;
@@ -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 { IContentProtectionIntermediateRepresentation } from "../../node_parser_types";
18
+ /**
19
+ * @param {Object} contentProtectionElement
20
+ * @returns {Object}
21
+ */
22
+ export default function parseContentProtection(contentProtectionElement: ITNode): [IContentProtectionIntermediateRepresentation, Error[]];