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.
Files changed (189) hide show
  1. package/.vscode/settings.json +9 -0
  2. package/VERSION +1 -1
  3. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  4. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
  5. package/dist/commonjs/core/main/worker/worker_main.js +9 -8
  6. package/dist/commonjs/features/features_object.js +1 -1
  7. package/dist/commonjs/features/list/dash.js +2 -2
  8. package/dist/commonjs/features/types.d.ts +3 -8
  9. package/dist/commonjs/main_thread/api/public_api.js +7 -2
  10. package/dist/commonjs/multithread_types.d.ts +1 -1
  11. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +3 -4
  12. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +4 -11
  13. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +1 -2
  14. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +3 -12
  15. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +2 -3
  16. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +11 -22
  17. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +2 -11
  18. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +3 -74
  19. package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +1 -2
  20. package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +1 -3
  21. package/dist/commonjs/parsers/manifest/dash/node_parser_types.d.ts +3 -5
  22. package/dist/commonjs/public_types.d.ts +1 -1
  23. package/dist/commonjs/transports/dash/manifest_parser.js +4 -33
  24. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  25. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  26. package/dist/es2017/core/main/worker/worker_main.js +9 -8
  27. package/dist/es2017/features/features_object.js +1 -1
  28. package/dist/es2017/features/list/dash.js +2 -2
  29. package/dist/es2017/features/types.d.ts +3 -8
  30. package/dist/es2017/main_thread/api/public_api.js +7 -2
  31. package/dist/es2017/multithread_types.d.ts +1 -1
  32. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +3 -4
  33. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +5 -12
  34. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +1 -2
  35. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +4 -13
  36. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +2 -3
  37. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +11 -22
  38. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts +2 -11
  39. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +2 -49
  40. package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +1 -2
  41. package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +1 -3
  42. package/dist/es2017/parsers/manifest/dash/node_parser_types.d.ts +3 -5
  43. package/dist/es2017/public_types.d.ts +1 -1
  44. package/dist/es2017/transports/dash/manifest_parser.js +4 -33
  45. package/dist/mpd-parser.wasm +0 -0
  46. package/dist/rx-player.js +65 -141
  47. package/dist/rx-player.min.js +1 -1
  48. package/dist/worker.js +3 -8
  49. package/package.json +1 -1
  50. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.d.ts +0 -17
  51. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/index.js +0 -19
  52. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +0 -24
  53. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +0 -400
  54. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +0 -24
  55. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +0 -33
  56. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +0 -23
  57. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +0 -70
  58. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +0 -22
  59. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +0 -118
  60. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +0 -23
  61. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +0 -154
  62. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +0 -22
  63. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +0 -70
  64. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +0 -23
  65. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +0 -221
  66. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +0 -23
  67. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +0 -179
  68. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +0 -22
  69. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +0 -256
  70. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +0 -23
  71. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +0 -152
  72. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +0 -22
  73. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +0 -60
  74. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +0 -24
  75. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +0 -125
  76. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +0 -22
  77. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +0 -36
  78. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +0 -24
  79. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +0 -82
  80. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +0 -176
  81. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +0 -382
  82. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +0 -24
  83. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +0 -142
  84. package/dist/commonjs/utils/xml-parser.d.ts +0 -70
  85. package/dist/commonjs/utils/xml-parser.js +0 -357
  86. package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.d.ts +0 -17
  87. package/dist/es2017/parsers/manifest/dash/fast-js-parser/index.js +0 -17
  88. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts +0 -24
  89. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +0 -358
  90. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.d.ts +0 -24
  91. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/BaseURL.js +0 -30
  92. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.d.ts +0 -23
  93. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentComponent.js +0 -45
  94. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.d.ts +0 -22
  95. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/ContentProtection.js +0 -77
  96. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.d.ts +0 -23
  97. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/EventStream.js +0 -101
  98. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.d.ts +0 -22
  99. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Initialization.js +0 -45
  100. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts +0 -23
  101. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +0 -179
  102. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts +0 -23
  103. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +0 -137
  104. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts +0 -22
  105. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +0 -214
  106. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.d.ts +0 -23
  107. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentBase.js +0 -111
  108. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.d.ts +0 -22
  109. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentList.js +0 -41
  110. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.d.ts +0 -24
  111. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTemplate.js +0 -84
  112. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.d.ts +0 -22
  113. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentTimeline.js +0 -33
  114. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.d.ts +0 -24
  115. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/SegmentURL.js +0 -57
  116. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts +0 -176
  117. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.js +0 -310
  118. package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.d.ts +0 -24
  119. package/dist/es2017/parsers/manifest/dash/fast-js-parser/parse_from_xml_string.js +0 -114
  120. package/dist/es2017/utils/xml-parser.d.ts +0 -70
  121. package/dist/es2017/utils/xml-parser.js +0 -322
  122. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/index.d.ts +0 -0
  123. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/index.js +0 -0
  124. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/AdaptationSet.d.ts +0 -0
  125. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/AdaptationSet.js +0 -0
  126. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/BaseURL.d.ts +0 -0
  127. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/BaseURL.js +0 -0
  128. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentComponent.d.ts +0 -0
  129. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentComponent.js +0 -0
  130. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentProtection.d.ts +0 -0
  131. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentProtection.js +0 -0
  132. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/EventStream.d.ts +0 -0
  133. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/EventStream.js +0 -0
  134. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Initialization.d.ts +0 -0
  135. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Initialization.js +0 -0
  136. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/MPD.d.ts +0 -0
  137. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/MPD.js +0 -0
  138. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Period.d.ts +0 -0
  139. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Period.js +0 -0
  140. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Representation.d.ts +0 -0
  141. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Representation.js +0 -0
  142. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentBase.d.ts +0 -0
  143. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentBase.js +0 -0
  144. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentList.d.ts +0 -0
  145. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentList.js +0 -0
  146. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
  147. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTemplate.js +0 -0
  148. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
  149. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTimeline.js +0 -0
  150. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentURL.d.ts +0 -0
  151. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentURL.js +0 -0
  152. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/utils.d.ts +0 -0
  153. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/utils.js +0 -0
  154. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/parse_from_document.d.ts +0 -0
  155. /package/dist/commonjs/parsers/manifest/dash/{native-parser → js-parser}/parse_from_document.js +0 -0
  156. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/index.d.ts +0 -0
  157. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/index.js +0 -0
  158. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/AdaptationSet.d.ts +0 -0
  159. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/AdaptationSet.js +0 -0
  160. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/BaseURL.d.ts +0 -0
  161. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/BaseURL.js +0 -0
  162. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentComponent.d.ts +0 -0
  163. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentComponent.js +0 -0
  164. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentProtection.d.ts +0 -0
  165. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/ContentProtection.js +0 -0
  166. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/EventStream.d.ts +0 -0
  167. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/EventStream.js +0 -0
  168. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Initialization.d.ts +0 -0
  169. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Initialization.js +0 -0
  170. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/MPD.d.ts +0 -0
  171. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/MPD.js +0 -0
  172. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Period.d.ts +0 -0
  173. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Period.js +0 -0
  174. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Representation.d.ts +0 -0
  175. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/Representation.js +0 -0
  176. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentBase.d.ts +0 -0
  177. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentBase.js +0 -0
  178. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentList.d.ts +0 -0
  179. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentList.js +0 -0
  180. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTemplate.d.ts +0 -0
  181. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTemplate.js +0 -0
  182. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTimeline.d.ts +0 -0
  183. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentTimeline.js +0 -0
  184. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentURL.d.ts +0 -0
  185. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/SegmentURL.js +0 -0
  186. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/utils.d.ts +0 -0
  187. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/node_parsers/utils.js +0 -0
  188. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/parse_from_document.d.ts +0 -0
  189. /package/dist/es2017/parsers/manifest/dash/{native-parser → js-parser}/parse_from_document.js +0 -0
@@ -54,7 +54,6 @@ var log_1 = require("../../../log");
54
54
  var classes_1 = require("../../../manifest/classes");
55
55
  var main_codec_support_prober_1 = require("../../../mse/main_codec_support_prober");
56
56
  var worker_codec_support_prober_1 = require("../../../mse/worker_codec_support_prober");
57
- var fast_js_parser_1 = require("../../../parsers/manifest/dash/fast-js-parser");
58
57
  var wasm_parser_1 = require("../../../parsers/manifest/dash/wasm-parser");
59
58
  var playback_observer_1 = require("../../../playback_observer");
60
59
  var worker_playback_observer_1 = require("../../../playback_observer/worker_playback_observer");
@@ -96,7 +95,6 @@ function initializeWorkerMain() {
96
95
  // TODO allow worker-side feature-switching? Not sure how
97
96
  var dashWasmParser = new wasm_parser_1.default();
98
97
  features_1.default.dashParsers.wasm = dashWasmParser;
99
- features_1.default.dashParsers.fastJs = fast_js_parser_1.default;
100
98
  features_1.default.transports.dash = dash_1.default;
101
99
  /**
102
100
  * When set, emit playback observation made on the main thread.
@@ -116,12 +114,16 @@ function initializeWorkerMain() {
116
114
  var diffWorker = Date.now() - performance.now();
117
115
  monotonic_timestamp_1.mainThreadTimestampDiff.setValueIfChanged(diffWorker - diffMain);
118
116
  updateLoggerLevel(msg.value.logLevel, msg.value.sendBackLogs);
119
- if (msg.value.dashWasmUrl !== undefined && dashWasmParser.isCompatible()) {
120
- dashWasmParser.initialize({ wasmUrl: msg.value.dashWasmUrl }).catch(function (err) {
121
- var error = err instanceof Error ? err.toString() : "Unknown Error";
122
- log_1.default.error("Worker: Could not initialize DASH_WASM parser", error);
117
+ dashWasmParser.initialize({ wasmUrl: msg.value.dashWasmUrl }).then(function () {
118
+ (0, send_message_1.default)({ type: "init-success" /* WorkerMessageType.InitSuccess */, value: null });
119
+ }, function (err) {
120
+ var error = err instanceof Error ? err.toString() : "Unknown Error";
121
+ log_1.default.error("Worker: Could not initialize DASH_WASM parser", error);
122
+ (0, send_message_1.default)({
123
+ type: "init-error" /* WorkerMessageType.InitError */,
124
+ value: { errorMessage: error, kind: "dashWasmInitialization" },
123
125
  });
124
- }
126
+ });
125
127
  if (!msg.value.hasVideo || msg.value.hasMseInWorker) {
126
128
  contentPreparer.disposeCurrentContent();
127
129
  contentPreparer = new content_preparer_1.default({
@@ -132,7 +134,6 @@ function initializeWorkerMain() {
132
134
  features_1.default.codecSupportProber = msg.value.hasMseInWorker
133
135
  ? main_codec_support_prober_1.default
134
136
  : worker_codec_support_prober_1.default;
135
- (0, send_message_1.default)({ type: "init-success" /* WorkerMessageType.InitSuccess */, value: null });
136
137
  break;
137
138
  case "log-level-update" /* MainThreadMessageType.LogLevelUpdate */:
138
139
  updateLoggerLevel(msg.value.logLevel, msg.value.sendBackLogs);
@@ -20,7 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  * @type {Object}
21
21
  */
22
22
  var features = {
23
- dashParsers: { wasm: null, native: null, fastJs: null },
23
+ dashParsers: { wasm: null, js: null },
24
24
  codecSupportProber: null,
25
25
  createDebugElement: null,
26
26
  directfile: null,
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.DASH = void 0;
19
19
  var media_source_content_initializer_1 = require("../../main_thread/init/media_source_content_initializer");
20
20
  var main_codec_support_prober_1 = require("../../mse/main_codec_support_prober");
21
- var native_parser_1 = require("../../parsers/manifest/dash/native-parser");
21
+ var js_parser_1 = require("../../parsers/manifest/dash/js-parser");
22
22
  var dash_1 = require("../../transports/dash");
23
23
  /**
24
24
  * Add ability to play DASH contents.
@@ -28,7 +28,7 @@ function addDASHFeature(features) {
28
28
  if (features.transports.dash === undefined) {
29
29
  features.transports.dash = dash_1.default;
30
30
  }
31
- features.dashParsers.native = native_parser_1.default;
31
+ features.dashParsers.js = js_parser_1.default;
32
32
  features.mainThreadMediaSourceInit = media_source_content_initializer_1.default;
33
33
  features.codecSupportProber = main_codec_support_prober_1.default;
34
34
  }
@@ -48,8 +48,7 @@ export type IHTMLTextTracksBuffer = new (mediaElement: HTMLMediaElement, textTra
48
48
  * @returns {Object} - `SegmentSink` implementation.
49
49
  */
50
50
  export type INativeTextTracksBuffer = new (mediaElement: HTMLMediaElement) => SegmentSink;
51
- export type IDashNativeParser = (dom: Document, args: IMPDParserArguments) => IDashParserResponse<string>;
52
- export type IDashFastJsParser = (xml: string, args: IMPDParserArguments) => IDashParserResponse<string>;
51
+ export type IDashJsParser = (document: Document, args: IMPDParserArguments) => IDashParserResponse<string>;
53
52
  /**
54
53
  * Function implementing the optional RxPlayer debug UI element.
55
54
  * @param {HTMLElement} parentElt - `HTMLElement` in which the debug UI
@@ -122,13 +121,9 @@ export interface IFeaturesObject {
122
121
  */
123
122
  wasm: DashWasmParser | null;
124
123
  /**
125
- * Entirely JavaScript-based Manifest DASH parser.
124
+ * JavaScript-based Manifest DASH parser.
126
125
  */
127
- fastJs: IDashFastJsParser | null;
128
- /**
129
- * JavaScript+Browser's DOMParser-based Manifest DASH parser.
130
- */
131
- native: IDashNativeParser | null;
126
+ js: IDashJsParser | null;
132
127
  };
133
128
  /** Implement text track rendering through `<track>` HTML elements. */
134
129
  nativeTextDisplayer: typeof NativeTextDisplayer | null;
@@ -76,6 +76,7 @@ var can_rely_on_video_visibility_and_size_1 = require("../../compat/can_rely_on_
76
76
  var event_listeners_1 = require("../../compat/event_listeners");
77
77
  var get_start_date_1 = require("../../compat/get_start_date");
78
78
  var has_mse_in_worker_1 = require("../../compat/has_mse_in_worker");
79
+ var has_webassembly_1 = require("../../compat/has_webassembly");
79
80
  var is_debug_mode_enabled_1 = require("../../compat/is_debug_mode_enabled");
80
81
  var errors_1 = require("../../errors");
81
82
  var worker_initialization_error_1 = require("../../errors/worker_initialization_error");
@@ -127,7 +128,7 @@ var Player = /** @class */ (function (_super) {
127
128
  // Workaround to support Firefox autoplay on FF 42.
128
129
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
129
130
  videoElement.preload = "auto";
130
- _this.version = /* PLAYER_VERSION */ "4.0.0-rc.2";
131
+ _this.version = /* PLAYER_VERSION */ "4.0.0-dev.202402212";
131
132
  _this.log = log_1.default;
132
133
  _this.state = "STOPPED";
133
134
  _this.videoElement = videoElement;
@@ -222,6 +223,10 @@ var Player = /** @class */ (function (_super) {
222
223
  log_1.default.warn("API: Cannot rely on a WebWorker: Worker API unavailable");
223
224
  return rej(new worker_initialization_error_1.default("INCOMPATIBLE_ERROR", "Worker unavailable"));
224
225
  }
226
+ if (!has_webassembly_1.default) {
227
+ log_1.default.warn("API: Cannot rely on a WebWorker: WebAssembly unavailable");
228
+ return rej(new worker_initialization_error_1.default("INCOMPATIBLE_ERROR", "WebAssembly unavailable"));
229
+ }
225
230
  if (typeof workerSettings.workerUrl === "string") {
226
231
  _this._priv_worker = new Worker(workerSettings.workerUrl);
227
232
  }
@@ -2514,5 +2519,5 @@ var Player = /** @class */ (function (_super) {
2514
2519
  };
2515
2520
  return Player;
2516
2521
  }(event_emitter_1.default));
2517
- Player.version = /* PLAYER_VERSION */ "4.0.0-rc.2";
2522
+ Player.version = /* PLAYER_VERSION */ "4.0.0-dev.202402212";
2518
2523
  exports.default = Player;
@@ -25,7 +25,7 @@ export interface IInitMessage {
25
25
  type: MainThreadMessageType.Init;
26
26
  value: {
27
27
  /** Link to the DASH_WASM's feature WebAssembly file to parse DASH MPDs. */
28
- dashWasmUrl: string | undefined;
28
+ dashWasmUrl: string;
29
29
  /**
30
30
  * If `true` the final element on the current page displaying the content
31
31
  * can display video content.
@@ -13,15 +13,14 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ITNode } from "../../../../../../utils/xml-parser";
17
16
  import type { IIndexSegment } from "../../../../utils/index_helpers";
18
17
  /**
19
18
  * Allows to generate the "timeline" for the "Timeline" RepresentationIndex.
20
19
  * Call this function when the timeline is unknown.
21
20
  * This function was added to only perform that task lazily, i.e. only when
22
21
  * first needed.
23
- * @param {Array.<Object>|HTMLCollection} elements - All S nodes constituting
24
- * the corresponding SegmentTimeline node.
22
+ * @param {HTMLCollection} elements - All S nodes constituting the corresponding
23
+ * SegmentTimeline node.
25
24
  * @returns {Array.<Object>}
26
25
  */
27
- export default function constructTimelineFromElements(elements: ITNode[] | HTMLCollection): IIndexSegment[];
26
+ export default function constructTimelineFromElements(elements: HTMLCollection): IIndexSegment[];
@@ -22,21 +22,14 @@ var parse_s_element_1 = require("./parse_s_element");
22
22
  * Call this function when the timeline is unknown.
23
23
  * This function was added to only perform that task lazily, i.e. only when
24
24
  * first needed.
25
- * @param {Array.<Object>|HTMLCollection} elements - All S nodes constituting
26
- * the corresponding SegmentTimeline node.
25
+ * @param {HTMLCollection} elements - All S nodes constituting the corresponding
26
+ * SegmentTimeline node.
27
27
  * @returns {Array.<Object>}
28
28
  */
29
29
  function constructTimelineFromElements(elements) {
30
30
  var initialTimeline = [];
31
- if (Array.isArray(elements)) {
32
- for (var i = 0; i < elements.length; i++) {
33
- initialTimeline.push((0, parse_s_element_1.parseSElementNode)(elements[i]));
34
- }
35
- }
36
- else {
37
- for (var i = 0; i < elements.length; i++) {
38
- initialTimeline.push((0, parse_s_element_1.parseSHTMLElement)(elements[i]));
39
- }
31
+ for (var i = 0; i < elements.length; i++) {
32
+ initialTimeline.push((0, parse_s_element_1.default)(elements[i]));
40
33
  }
41
34
  var timeline = [];
42
35
  for (var i = 0; i < initialTimeline.length; i++) {
@@ -13,6 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ITNode } from "../../../../../../utils/xml-parser";
17
16
  import type { IIndexSegment } from "../../../../utils/index_helpers";
18
- export default function constructTimelineFromPreviousTimeline(newElements: ITNode[] | HTMLCollection, prevTimeline: IIndexSegment[]): IIndexSegment[];
17
+ export default function constructTimelineFromPreviousTimeline(newElements: HTMLCollection, prevTimeline: IIndexSegment[]): IIndexSegment[];
@@ -49,9 +49,7 @@ function constructTimelineFromPreviousTimeline(newElements, prevTimeline) {
49
49
  return (0, construct_timeline_from_elements_1.default)(newElements);
50
50
  }
51
51
  var prevLastElement = newTimeline[newTimeline.length - 1];
52
- var newCommonElt = Array.isArray(newElements)
53
- ? (0, parse_s_element_1.parseSElementNode)(newElements[lastCommonEltNewEltsIdx])
54
- : (0, parse_s_element_1.parseSHTMLElement)(newElements[lastCommonEltNewEltsIdx]);
52
+ var newCommonElt = (0, parse_s_element_1.default)(newElements[lastCommonEltNewEltsIdx]);
55
53
  var newRepeatCountOffseted = ((_a = newCommonElt.repeatCount) !== null && _a !== void 0 ? _a : 0) - repeatNumberInNewElements;
56
54
  if (newCommonElt.duration !== prevLastElement.duration ||
57
55
  prevLastElement.repeatCount > newRepeatCountOffseted) {
@@ -65,15 +63,8 @@ function constructTimelineFromPreviousTimeline(newElements, prevTimeline) {
65
63
  }
66
64
  var newEltsToPush = [];
67
65
  var items = [];
68
- if (Array.isArray(newElements)) {
69
- for (var i = lastCommonEltNewEltsIdx + 1; i < newElements.length; i++) {
70
- items.push((0, parse_s_element_1.parseSElementNode)(newElements[i]));
71
- }
72
- }
73
- else {
74
- for (var i = lastCommonEltNewEltsIdx + 1; i < newElements.length; i++) {
75
- items.push((0, parse_s_element_1.parseSHTMLElement)(newElements[i]));
76
- }
66
+ for (var i = lastCommonEltNewEltsIdx + 1; i < newElements.length; i++) {
67
+ items.push((0, parse_s_element_1.default)(newElements[i]));
77
68
  }
78
69
  for (var i = 0; i < items.length; i++) {
79
70
  var item = items[i];
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ITNode } from "../../../../../../utils/xml-parser";
17
16
  import type { IIndexSegment } from "../../../../utils/index_helpers";
18
17
  /**
19
18
  * By comparing two timelines for the same content at different points in time,
@@ -21,10 +20,10 @@ import type { IIndexSegment } from "../../../../utils/index_helpers";
21
20
  * starting time.
22
21
  * Returns `null` if not found.
23
22
  * @param {Array.<Object>} prevTimeline
24
- * @param {Array.<Object>} newElements
23
+ * @param {HTMLCollection} newElements
25
24
  * @returns {Object|null}
26
25
  */
27
- export default function findFirstCommonStartTime(prevTimeline: IIndexSegment[], newElements: ITNode[] | HTMLCollection): {
26
+ export default function findFirstCommonStartTime(prevTimeline: IIndexSegment[], newElements: HTMLCollection): {
28
27
  /** Index in `prevSegments` where the first common segment start is found. */
29
28
  prevSegmentsIdx: number;
30
29
  /** Index in `newElements` where the first common segment start is found. */
@@ -15,14 +15,13 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- var is_null_or_undefined_1 = require("../../../../../../utils/is_null_or_undefined");
19
18
  /**
20
19
  * By comparing two timelines for the same content at different points in time,
21
20
  * retrieve the index in both timelines of the first segment having the same
22
21
  * starting time.
23
22
  * Returns `null` if not found.
24
23
  * @param {Array.<Object>} prevTimeline
25
- * @param {Array.<Object>} newElements
24
+ * @param {HTMLCollection} newElements
26
25
  * @returns {Object|null}
27
26
  */
28
27
  function findFirstCommonStartTime(prevTimeline, newElements) {
@@ -30,12 +29,8 @@ function findFirstCommonStartTime(prevTimeline, newElements) {
30
29
  return null;
31
30
  }
32
31
  var prevInitialStart = prevTimeline[0].start;
33
- var newFirstTAttr = Array.isArray(newElements)
34
- ? newElements[0].attributes.t
35
- : newElements[0].getAttribute("t");
36
- var newInitialStart = (0, is_null_or_undefined_1.default)(newFirstTAttr)
37
- ? null
38
- : parseInt(newFirstTAttr, 10);
32
+ var newFirstTAttr = newElements[0].getAttribute("t");
33
+ var newInitialStart = newFirstTAttr === null ? null : parseInt(newFirstTAttr, 10);
39
34
  if (newInitialStart === null || Number.isNaN(newInitialStart)) {
40
35
  return null;
41
36
  }
@@ -84,17 +79,16 @@ function findFirstCommonStartTime(prevTimeline, newElements) {
84
79
  }
85
80
  else {
86
81
  var newElementsIdx = 0;
87
- var newNodeElt = Array.isArray(newElements) ? newElements[0] : null;
88
- var newDomElt = Array.isArray(newElements) ? null : newElements[0];
82
+ var newElt = newElements[0];
89
83
  var currentTimeOffset = newInitialStart;
90
84
  while (true) {
91
- var dAttr = newNodeElt !== null ? newNodeElt.attributes.d : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("d");
92
- var duration = (0, is_null_or_undefined_1.default)(dAttr) ? null : parseInt(dAttr, 10);
85
+ var dAttr = newElt.getAttribute("d");
86
+ var duration = dAttr === null ? null : parseInt(dAttr, 10);
93
87
  if (duration === null || Number.isNaN(duration)) {
94
88
  return null;
95
89
  }
96
- var rAttr = newNodeElt !== null ? newNodeElt.attributes.r : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("r");
97
- var repeatCount = (0, is_null_or_undefined_1.default)(rAttr) ? null : parseInt(rAttr, 10);
90
+ var rAttr = newElt.getAttribute("r");
91
+ var repeatCount = rAttr === null ? null : parseInt(rAttr, 10);
98
92
  if (repeatCount !== null) {
99
93
  if (Number.isNaN(repeatCount) || repeatCount < 0) {
100
94
  return null;
@@ -120,14 +114,9 @@ function findFirstCommonStartTime(prevTimeline, newElements) {
120
114
  if (newElementsIdx >= newElements.length) {
121
115
  return null;
122
116
  }
123
- if (Array.isArray(newElements)) {
124
- newNodeElt = newElements[newElementsIdx];
125
- }
126
- else {
127
- newDomElt = newElements[newElementsIdx];
128
- }
129
- var tAttr = newNodeElt !== null ? newNodeElt.attributes.t : newDomElt === null || newDomElt === void 0 ? void 0 : newDomElt.getAttribute("t");
130
- var time = (0, is_null_or_undefined_1.default)(tAttr) ? null : parseInt(tAttr, 10);
117
+ newElt = newElements[newElementsIdx];
118
+ var tAttr = newElt.getAttribute("t");
119
+ var time = tAttr === null ? null : parseInt(tAttr, 10);
131
120
  if (time !== null) {
132
121
  if (Number.isNaN(time)) {
133
122
  return null;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ITNode } from "../../../../../../utils/xml-parser";
17
16
  /** SegmentTimeline `S` element once parsed. */
18
17
  export interface IParsedS {
19
18
  /** Start time in a previously-given timescaled unit. */
@@ -28,16 +27,8 @@ export interface IParsedS {
28
27
  duration?: number;
29
28
  }
30
29
  /**
31
- * Parse a given <S> element in the MPD under a parsed Node form into a JS
32
- * Object.
33
- * @param {Object} root
34
- * @returns {Object}
35
- */
36
- export declare function parseSElementNode(root: ITNode): IParsedS;
37
- /**
38
- * Parse a given <S> element in the MPD under an `Element` form into a JS
39
- * Object.
30
+ * Parse a given <S> element in the MPD into a JS Object.
40
31
  * @param {Element} root
41
32
  * @returns {Object}
42
33
  */
43
- export declare function parseSHTMLElement(root: Element): IParsedS;
34
+ export default function parseSElement(root: Element): IParsedS;
@@ -14,85 +14,14 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
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
17
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.parseSHTMLElement = exports.parseSElementNode = void 0;
30
18
  var log_1 = require("../../../../../../log");
31
- var is_null_or_undefined_1 = require("../../../../../../utils/is_null_or_undefined");
32
- /**
33
- * Parse a given <S> element in the MPD under a parsed Node form into a JS
34
- * Object.
35
- * @param {Object} root
36
- * @returns {Object}
37
- */
38
- function parseSElementNode(root) {
39
- var e_1, _a;
40
- var parsedS = {};
41
- try {
42
- for (var _b = __values(Object.keys(root.attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
43
- var attributeName = _c.value;
44
- var attributeVal = root.attributes[attributeName];
45
- if ((0, is_null_or_undefined_1.default)(attributeVal)) {
46
- continue;
47
- }
48
- switch (attributeName) {
49
- case "t":
50
- var start = parseInt(attributeVal, 10);
51
- if (isNaN(start)) {
52
- log_1.default.warn("DASH: invalid t (\"".concat(attributeVal, "\")"));
53
- }
54
- else {
55
- parsedS.start = start;
56
- }
57
- break;
58
- case "d":
59
- var duration = parseInt(attributeVal, 10);
60
- if (isNaN(duration)) {
61
- log_1.default.warn("DASH: invalid d (\"".concat(attributeVal, "\")"));
62
- }
63
- else {
64
- parsedS.duration = duration;
65
- }
66
- break;
67
- case "r":
68
- var repeatCount = parseInt(attributeVal, 10);
69
- if (isNaN(repeatCount)) {
70
- log_1.default.warn("DASH: invalid r (\"".concat(attributeVal, "\")"));
71
- }
72
- else {
73
- parsedS.repeatCount = repeatCount;
74
- }
75
- break;
76
- }
77
- }
78
- }
79
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
80
- finally {
81
- try {
82
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
83
- }
84
- finally { if (e_1) throw e_1.error; }
85
- }
86
- return parsedS;
87
- }
88
- exports.parseSElementNode = parseSElementNode;
89
19
  /**
90
- * Parse a given <S> element in the MPD under an `Element` form into a JS
91
- * Object.
20
+ * Parse a given <S> element in the MPD into a JS Object.
92
21
  * @param {Element} root
93
22
  * @returns {Object}
94
23
  */
95
- function parseSHTMLElement(root) {
24
+ function parseSElement(root) {
96
25
  var parsedS = {};
97
26
  for (var j = 0; j < root.attributes.length; j++) {
98
27
  var attribute = root.attributes[j];
@@ -128,4 +57,4 @@ function parseSHTMLElement(root) {
128
57
  }
129
58
  return parsedS;
130
59
  }
131
- exports.parseSHTMLElement = parseSHTMLElement;
60
+ exports.default = parseSElement;
@@ -15,7 +15,6 @@
15
15
  */
16
16
  import type { IRepresentationIndex, ISegment, IRepresentation } from "../../../../../../manifest";
17
17
  import type { IPlayerError } from "../../../../../../public_types";
18
- import type { ITNode } from "../../../../../../utils/xml-parser";
19
18
  import type { IEMSG } from "../../../../../containers/isobmff";
20
19
  import type { IIndexSegment } from "../../../../utils/index_helpers";
21
20
  import type { ISegmentTimelineElement } from "../../../node_parser_types";
@@ -121,7 +120,7 @@ export interface ITimelineIndexIndexArgument {
121
120
  * timescale (see timescale)
122
121
  */
123
122
  presentationTimeOffset?: number | undefined;
124
- timelineParser?: (() => ITNode[] | HTMLCollection) | undefined;
123
+ timelineParser?: (() => HTMLCollection) | undefined;
125
124
  timeline?: ISegmentTimelineElement[] | undefined;
126
125
  }
127
126
  /** Aditional context needed by a SegmentTimeline RepresentationIndex. */
@@ -302,9 +302,7 @@ function generateStreamEvents(baseIr, periodStart, xmlNamespaces) {
302
302
  try {
303
303
  xmlData = {
304
304
  namespaces: allNamespaces,
305
- data: typeof eventIr.eventStreamData === "string"
306
- ? eventIr.eventStreamData
307
- : (0, string_parsing_1.utf8ToStr)(new Uint8Array(eventIr.eventStreamData)),
305
+ data: (0, string_parsing_1.utf8ToStr)(new Uint8Array(eventIr.eventStreamData)),
308
306
  };
309
307
  }
310
308
  catch (err) {
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ITNode } from "../../../utils/xml-parser";
17
16
  /**
18
17
  * Those are types used when generating the MPD "Intermediate Representation"
19
18
  * which is an intermediate step between parsing the MPD (in XML) and generating
@@ -387,11 +386,10 @@ export interface IEventStreamEventIntermediateRepresentation {
387
386
  duration?: number;
388
387
  /**
389
388
  * The `<Event>` element itself.
390
- * Can be under any of those forms:
389
+ * Can be in two forms:
391
390
  * - Either as an Element instance directly
392
391
  * - Either as the Element's UTF-8 textual representation.
393
- * - Either as the Element's string representation.
394
392
  */
395
- eventStreamData?: Element | ArrayBuffer | string;
393
+ eventStreamData?: Element | ArrayBuffer;
396
394
  }
397
- export type ITimelineParser = () => ITNode[] | HTMLCollection;
395
+ export type ITimelineParser = () => HTMLCollection;
@@ -15,7 +15,7 @@ export type IRxPlayerMode = "auto" | "main" | "multithread";
15
15
  /** Argument of the `attachWorker` method. */
16
16
  export interface IWorkerSettings {
17
17
  workerUrl: string | Blob;
18
- dashWasmUrl?: string | ArrayBuffer | undefined;
18
+ dashWasmUrl: string | ArrayBuffer;
19
19
  }
20
20
  /** Every options that can be given to the RxPlayer's constructor. */
21
21
  export interface IConstructorOptions {
@@ -86,19 +86,12 @@ function generateManifestParser(options) {
86
86
  * @returns {Object|Promise.<Object>}
87
87
  */
88
88
  function runDefaultJsParser() {
89
- if (parsers.fastJs !== null) {
90
- var manifestStr = getManifestAsString(responseData);
91
- var parsedManifest = parsers.fastJs(manifestStr, dashParserOpts);
92
- return processMpdParserResponse(parsedManifest);
93
- }
94
- else if (parsers.native !== null) {
95
- var manifestDocument = getManifestAsDocument(responseData);
96
- var parsedManifest = parsers.native(manifestDocument, dashParserOpts);
97
- return processMpdParserResponse(parsedManifest);
98
- }
99
- else {
89
+ if (parsers.js === null) {
100
90
  throw new Error("No MPD parser is imported");
101
91
  }
92
+ var manifestDoc = getManifestAsDocument(responseData);
93
+ var parsedManifest = parsers.js(manifestDoc, dashParserOpts);
94
+ return processMpdParserResponse(parsedManifest);
102
95
  }
103
96
  /**
104
97
  * Process return of one of the MPD parser.
@@ -236,28 +229,6 @@ function assertLoadedResourcesFormatArrayBuffer(loadedResources) {
236
229
  throw new Error("Invalid data given to the LoadedRessource");
237
230
  });
238
231
  }
239
- /**
240
- * Try to convert a Manifest from an unknown format to an array of nodes as
241
- * parsed by our XML DOM parser.
242
- *
243
- * Throws if the format cannot be converted.
244
- * @param {*} manifestSrc
245
- * @returns {Array.<Object | string>}
246
- */
247
- function getManifestAsString(manifestSrc) {
248
- if (manifestSrc instanceof ArrayBuffer) {
249
- return (0, string_parsing_1.utf8ToStr)(new Uint8Array(manifestSrc));
250
- }
251
- else if (typeof manifestSrc === "string") {
252
- return manifestSrc;
253
- }
254
- else if (manifestSrc instanceof Document) {
255
- return manifestSrc.documentElement.outerHTML;
256
- }
257
- else {
258
- throw new Error("DASH Manifest Parser: Unrecognized Manifest format");
259
- }
260
- }
261
232
  /**
262
233
  * Try to convert a Manifest from an unknown format to a `Document` format.
263
234
  * Useful to exploit DOM-parsing APIs to quickly parse an XML Manifest.