mattebox 0.17.2 → 0.19.0

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 (155) hide show
  1. package/dist/cdn/mattebox.dash-drm.min.js +3 -3
  2. package/dist/cdn/mattebox.dash-ll.min.js +3 -3
  3. package/dist/cdn/mattebox.dash.min.js +2 -2
  4. package/dist/cdn/mattebox.dual-drm.min.js +3 -3
  5. package/dist/cdn/mattebox.dual-ll.min.js +3 -3
  6. package/dist/cdn/mattebox.dual-ts-drm.min.js +3 -3
  7. package/dist/cdn/mattebox.dual-ts.min.js +3 -3
  8. package/dist/cdn/mattebox.dual.min.js +3 -3
  9. package/dist/cdn/mattebox.hls-drm.min.js +3 -3
  10. package/dist/cdn/mattebox.hls-ll.min.js +3 -3
  11. package/dist/cdn/mattebox.hls-ts-drm.min.js +3 -3
  12. package/dist/cdn/mattebox.hls-ts.min.js +3 -3
  13. package/dist/cdn/mattebox.hls.min.js +3 -3
  14. package/dist/cdn/mattebox.kernel.min.js +1 -1
  15. package/dist/cdn/mattebox.min.js +5 -5
  16. package/dist/containers/projection.d.ts +36 -0
  17. package/dist/containers/projection.d.ts.map +1 -0
  18. package/dist/containers/projection.js +68 -0
  19. package/dist/containers/projection.js.map +1 -0
  20. package/dist/containers/webm/cues.d.ts +59 -0
  21. package/dist/containers/webm/cues.d.ts.map +1 -0
  22. package/dist/containers/webm/cues.js +218 -0
  23. package/dist/containers/webm/cues.js.map +1 -0
  24. package/dist/containers/webm/index.d.ts +36 -0
  25. package/dist/containers/webm/index.d.ts.map +1 -0
  26. package/dist/containers/webm/index.js +271 -0
  27. package/dist/containers/webm/index.js.map +1 -0
  28. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/asyncToGenerator.js +1 -1
  29. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/defineProperty.js +1 -1
  30. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/objectSpread2.js +1 -1
  31. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/objectWithoutProperties.js +1 -1
  32. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
  33. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/toPrimitive.js +1 -1
  34. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/toPropertyKey.js +1 -1
  35. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/typeof.js +1 -1
  36. package/dist/es2015/containers/fmp4/fit.js +1 -1
  37. package/dist/es2015/containers/id3.js +1 -1
  38. package/dist/es2015/containers/projection.js +68 -0
  39. package/dist/es2015/containers/scte35.js +1 -1
  40. package/dist/es2015/containers/ts-transmux/h264.js +1 -1
  41. package/dist/es2015/containers/ts-transmux/h265.js +1 -1
  42. package/dist/es2015/containers/ts-transmux/index.js +1 -1
  43. package/dist/es2015/containers/ts-transmux/runner.js +2 -2
  44. package/dist/es2015/containers/ts-transmux/transmux.js +1 -1
  45. package/dist/es2015/containers/webm/cues.js +197 -0
  46. package/dist/es2015/containers/webm/index.js +258 -0
  47. package/dist/es2015/containers/webvtt.js +1 -1
  48. package/dist/es2015/containers/wvtt.js +1 -1
  49. package/dist/es2015/eme/index.js +3 -3
  50. package/dist/es2015/index.js +2 -2
  51. package/dist/es2015/kernel/append-queue.js +1 -1
  52. package/dist/es2015/kernel/dry-run.js +1 -1
  53. package/dist/es2015/kernel/mse.js +1 -1
  54. package/dist/es2015/kernel/prepare.js +2 -2
  55. package/dist/es2015/kernel/reducer.js +33 -4
  56. package/dist/es2015/kernel/refresh.js +1 -1
  57. package/dist/es2015/kernel/rendition-select.js +4 -4
  58. package/dist/es2015/kernel/scheduler.js +1 -1
  59. package/dist/es2015/kernel/timeline.js +1 -1
  60. package/dist/es2015/kernel/trace.js +1 -1
  61. package/dist/es2015/kernel/transport.js +2 -2
  62. package/dist/es2015/presets/define.js +2 -2
  63. package/dist/es2015/presets/full/index.js +6 -3
  64. package/dist/es2015/presets/tiers/dash-ll.js +2 -1
  65. package/dist/es2015/presets/tiers/dash.js +7 -2
  66. package/dist/es2015/presets/tiers/drm.js +4 -2
  67. package/dist/es2015/protocols/dash-cmaf/index.js +12 -6
  68. package/dist/es2015/protocols/dash-cmaf/parse.js +41 -13
  69. package/dist/es2015/protocols/dash-cmaf/periods-runtime.js +1 -1
  70. package/dist/es2015/protocols/dash-cmaf/periods.js +1 -1
  71. package/dist/es2015/protocols/dash-live/index.js +8 -5
  72. package/dist/es2015/protocols/dash-ll/index.js +3 -2
  73. package/dist/es2015/protocols/hls-cmaf/index.js +1 -1
  74. package/dist/es2015/protocols/hls-cmaf/parse.js +6 -4
  75. package/dist/es2015/protocols/hls-cmaf/unavailable.js +1 -1
  76. package/dist/es2015/protocols/hls-live/index.js +1 -1
  77. package/dist/es2015/protocols/hls-ll/parse.js +2 -2
  78. package/dist/es2015/stages/abr/index.js +1 -1
  79. package/dist/es2015/stages/aes-128/index.js +1 -1
  80. package/dist/es2015/stages/chapters/index.js +2 -2
  81. package/dist/es2015/stages/chapters/parse.js +2 -2
  82. package/dist/es2015/stages/codec-probe/index.js +1 -1
  83. package/dist/es2015/stages/content-steering/index.js +1 -1
  84. package/dist/es2015/stages/eme-core/index.js +4 -4
  85. package/dist/es2015/stages/eme-fairplay/index.js +1 -1
  86. package/dist/es2015/stages/eme-wiseplay/index.js +24 -0
  87. package/dist/es2015/stages/hdr/index.js +1 -1
  88. package/dist/es2015/stages/interstitials/breaks.js +1 -1
  89. package/dist/es2015/stages/interstitials/index.js +2 -2
  90. package/dist/es2015/stages/projection/index.js +41 -0
  91. package/dist/es2015/stages/qoe/index.js +1 -1
  92. package/dist/es2015/stages/recovery/index.js +1 -1
  93. package/dist/es2015/stages/rendition-names/index.js +1 -1
  94. package/dist/es2015/stages/text-cea608/decode.js +1 -1
  95. package/dist/es2015/stages/text-cea708/decode.js +2 -2
  96. package/dist/es2015/stages/text-cea708/index.js +1 -1
  97. package/dist/es2015/stages/text-ttml/index.js +1 -1
  98. package/dist/es2015/stages/text-ttml/parse.js +1 -1
  99. package/dist/es2015/stages/thumbnails/index.js +1 -1
  100. package/dist/es2015/stages/timed-metadata/index.js +1 -1
  101. package/dist/es2015/stages/trick-play/index.js +1 -1
  102. package/dist/kernel/reducer.d.ts.map +1 -1
  103. package/dist/kernel/reducer.js +44 -1
  104. package/dist/kernel/reducer.js.map +1 -1
  105. package/dist/presets/full/index.d.ts.map +1 -1
  106. package/dist/presets/full/index.js +5 -2
  107. package/dist/presets/full/index.js.map +1 -1
  108. package/dist/presets/tiers/dash-ll.d.ts.map +1 -1
  109. package/dist/presets/tiers/dash-ll.js +2 -1
  110. package/dist/presets/tiers/dash-ll.js.map +1 -1
  111. package/dist/presets/tiers/dash.d.ts +7 -1
  112. package/dist/presets/tiers/dash.d.ts.map +1 -1
  113. package/dist/presets/tiers/dash.js +3 -2
  114. package/dist/presets/tiers/dash.js.map +1 -1
  115. package/dist/presets/tiers/drm.d.ts +1 -1
  116. package/dist/presets/tiers/drm.d.ts.map +1 -1
  117. package/dist/presets/tiers/drm.js +3 -2
  118. package/dist/presets/tiers/drm.js.map +1 -1
  119. package/dist/protocols/dash-cmaf/index.d.ts +8 -3
  120. package/dist/protocols/dash-cmaf/index.d.ts.map +1 -1
  121. package/dist/protocols/dash-cmaf/index.js +12 -5
  122. package/dist/protocols/dash-cmaf/index.js.map +1 -1
  123. package/dist/protocols/dash-cmaf/parse.d.ts +6 -1
  124. package/dist/protocols/dash-cmaf/parse.d.ts.map +1 -1
  125. package/dist/protocols/dash-cmaf/parse.js +54 -7
  126. package/dist/protocols/dash-cmaf/parse.js.map +1 -1
  127. package/dist/protocols/dash-live/index.d.ts +6 -3
  128. package/dist/protocols/dash-live/index.d.ts.map +1 -1
  129. package/dist/protocols/dash-live/index.js +7 -4
  130. package/dist/protocols/dash-live/index.js.map +1 -1
  131. package/dist/protocols/dash-ll/index.d.ts.map +1 -1
  132. package/dist/protocols/dash-ll/index.js +3 -2
  133. package/dist/protocols/dash-ll/index.js.map +1 -1
  134. package/dist/protocols/hls-cmaf/parse.d.ts.map +1 -1
  135. package/dist/protocols/hls-cmaf/parse.js +8 -0
  136. package/dist/protocols/hls-cmaf/parse.js.map +1 -1
  137. package/dist/stages/drm-shared.d.ts +1 -1
  138. package/dist/stages/drm-shared.js +1 -1
  139. package/dist/stages/eme-core/index.js +2 -2
  140. package/dist/stages/eme-wiseplay/index.d.ts +27 -0
  141. package/dist/stages/eme-wiseplay/index.d.ts.map +1 -0
  142. package/dist/stages/eme-wiseplay/index.js +29 -0
  143. package/dist/stages/eme-wiseplay/index.js.map +1 -0
  144. package/dist/stages/projection/index.d.ts +3 -0
  145. package/dist/stages/projection/index.d.ts.map +1 -0
  146. package/dist/stages/projection/index.js +45 -0
  147. package/dist/stages/projection/index.js.map +1 -0
  148. package/dist/types/ir.d.ts +14 -1
  149. package/dist/types/ir.d.ts.map +1 -1
  150. package/dist/types/kernel.d.ts +3 -1
  151. package/dist/types/kernel.d.ts.map +1 -1
  152. package/dist/types/kernel.js.map +1 -1
  153. package/dist/types/messages.d.ts +13 -1
  154. package/dist/types/messages.d.ts.map +1 -1
  155. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { mattebox } from "../index.js";
2
- import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectWithoutProperties.js";
3
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
2
+ import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectWithoutProperties.js";
3
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
4
4
  // src/presets/define.ts
5
5
  const _excluded = ["stages", "without"];
6
6
  /** Applies the merge rule. Exported for tests; presets call it through `stages`. */
@@ -1,6 +1,7 @@
1
1
  import chapters from "../../stages/chapters/index.js";
2
2
  import cmsd from "../../stages/cmsd/index.js";
3
3
  import hdr from "../../stages/hdr/index.js";
4
+ import projection from "../../stages/projection/index.js";
4
5
  import qoe from "../../stages/qoe/index.js";
5
6
  import renditionNames from "../../stages/rendition-names/index.js";
6
7
  import textCea708 from "../../stages/text-cea708/index.js";
@@ -24,8 +25,9 @@ import { tsTier } from "../tiers/ts.js";
24
25
  * streams carry 608 beside them, which the base reads), TTML subtitles
25
26
  * (opt-in by the owner's decision), HDR by capability (it excludes HDR
26
27
  * where nothing is known, which a page may not want by default), local
27
- * QoE metrics, CMSD (it acts on response headers a CDN must expose), and
28
- * localized rendition names (a menu reads them).
28
+ * QoE metrics, CMSD (it acts on response headers a CDN must expose),
29
+ * localized rendition names (a menu reads them), and the projection of a
30
+ * 360° init segment (most programmes are flat).
29
31
  * CMCD is in no preset: it changes every request, which costs a page that
30
32
  * never asked for it. A page adds the stage.
31
33
  * Feature parity with
@@ -48,6 +50,7 @@ const preset = definePreset("full", () => [
48
50
  hdr(),
49
51
  qoe(),
50
52
  cmsd(),
51
- renditionNames()
53
+ renditionNames(),
54
+ projection()
52
55
  ]);
53
56
  export { preset as default };
@@ -1,3 +1,4 @@
1
+ import webm from "../../containers/webm/index.js";
1
2
  import dashLl from "../../protocols/dash-ll/index.js";
2
3
  // src/presets/tiers/dash-ll.ts
3
4
  /**
@@ -12,6 +13,6 @@ import dashLl from "../../protocols/dash-ll/index.js";
12
13
  * plays it.
13
14
  */
14
15
  function dashLlLine() {
15
- return [dashLl()];
16
+ return [dashLl(), webm()];
16
17
  }
17
18
  export { dashLlLine };
@@ -1,3 +1,4 @@
1
+ import webm from "../../containers/webm/index.js";
1
2
  import dashCmaf from "../../protocols/dash-cmaf/index.js";
2
3
  import dashLive from "../../protocols/dash-live/index.js";
3
4
  // src/presets/tiers/dash.ts
@@ -7,8 +8,12 @@ import dashLive from "../../protocols/dash-live/index.js";
7
8
  * lazy chunks then gives each preset its stages and no others. Each group is
8
9
  * a function so a preset gets fresh stage instances.
9
10
  */
10
- /** DASH on demand and live. */
11
+ /** DASH on demand and live, with WebM next to MP4, as dash.js and Shaka Player play it. */
11
12
  function dashLine() {
12
- return [dashCmaf(), dashLive()];
13
+ return [
14
+ dashCmaf(),
15
+ dashLive(),
16
+ webm()
17
+ ];
13
18
  }
14
19
  export { dashLine };
@@ -1,6 +1,7 @@
1
1
  import emeCenc from "../../stages/eme-cenc/index.js";
2
2
  import emeCore from "../../stages/eme-core/index.js";
3
3
  import emeFairplay from "../../stages/eme-fairplay/index.js";
4
+ import emeWiseplay from "../../stages/eme-wiseplay/index.js";
4
5
  // src/presets/tiers/drm.ts
5
6
  /**
6
7
  * One group of the preset matrix. Each group is its own module so a preset
@@ -8,12 +9,13 @@ import emeFairplay from "../../stages/eme-fairplay/index.js";
8
9
  * lazy chunks then gives each preset its stages and no others. Each group is
9
10
  * a function so a preset gets fresh stage instances.
10
11
  */
11
- /** The EME stages: sessions, CENC (Widevine, PlayReady, ClearKey), FairPlay. */
12
+ /** The EME stages: sessions, CENC (Widevine, PlayReady, ClearKey), FairPlay, WisePlay. */
12
13
  function drmTier() {
13
14
  return [
14
15
  emeCore(),
15
16
  emeCenc(),
16
- emeFairplay()
17
+ emeFairplay(),
18
+ emeWiseplay()
17
19
  ];
18
20
  }
19
21
  export { drmTier };
@@ -6,7 +6,7 @@ import { isUnresolved } from "../../kernel/timeline.js";
6
6
  import { manifestFact } from "../adapter-shared.js";
7
7
  import { parse, sidxToSegments } from "./parse.js";
8
8
  import { installPeriods } from "./periods-runtime.js";
9
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
9
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
10
10
  // src/protocols/dash-cmaf/index.ts
11
11
  /**
12
12
  * The dash-cmaf protocol adapter as a stage. Inert module: exports a
@@ -67,7 +67,8 @@ function neededIndexes(state, kernel) {
67
67
  "audio",
68
68
  "text"
69
69
  ], kernel.quality.active)) {
70
- if (asSidx(rendition.segments) === null) continue;
70
+ const sidx = asSidx(rendition.segments);
71
+ if (sidx === null || sidx.format === "webm") continue;
71
72
  if (asked.has(rendition.id) || rendition.id in state.failed) continue;
72
73
  needed.push(rendition);
73
74
  }
@@ -119,8 +120,13 @@ function retry(state, renditionId) {
119
120
  constraint: { excludeIds: Object.keys(failed) }
120
121
  })]];
121
122
  }
122
- /** The slice reducer. `lowLatency` reads the MPD as dash-ll does. */
123
- const createReduceDash = (retryMs, lowLatency = false) => (slice, msg, kernel) => {
123
+ /**
124
+ * The slice reducer. `lowLatency` reads the MPD as dash-ll does.
125
+ * `capabilities` is the composition's, read once at install: they are
126
+ * fixed when the engine is built. A stage that provides `video/webm` keeps
127
+ * WebM Representations in.
128
+ */
129
+ const createReduceDash = (retryMs, lowLatency = false, capabilities = []) => (slice, msg, kernel) => {
124
130
  const state = slice !== null && slice !== void 0 ? slice : INITIAL;
125
131
  if (msg.type === "LOAD") return [_objectSpread2(_objectSpread2({}, INITIAL), {}, {
126
132
  manifestUrl: msg.url,
@@ -133,7 +139,7 @@ const createReduceDash = (retryMs, lowLatency = false) => (slice, msg, kernel) =
133
139
  let warnings = [];
134
140
  const fact = manifestFact(msg.bytes, (_msg$url = msg.url) !== null && _msg$url !== void 0 ? _msg$url : state.manifestUrl, (text) => claims(state, text), (text, url) => {
135
141
  var _result$warnings;
136
- const result = parse(text, url, lowLatency);
142
+ const result = parse(text, url, lowLatency, capabilities);
137
143
  if (result.presentation !== null) warnings = (_result$warnings = result.warnings) !== null && _result$warnings !== void 0 ? _result$warnings : [];
138
144
  return result;
139
145
  });
@@ -249,7 +255,7 @@ function dashCmaf(options = {}) {
249
255
  name: "dash-cmaf",
250
256
  provides: ["dash-cmaf", ...MANIFEST_TYPES],
251
257
  install(ctx) {
252
- ctx.reduce("dash", createReduceDash(retryMs));
258
+ ctx.reduce("dash", createReduceDash(retryMs, false, ctx.capabilities()));
253
259
  return installDashPeriods(ctx);
254
260
  }
255
261
  };
@@ -4,7 +4,7 @@ import { resolveUrl } from "../../kernel/url.js";
4
4
  import { manifestError } from "../adapter-shared.js";
5
5
  import { dimensions } from "../dimensions.js";
6
6
  import { flattenPeriods } from "./periods.js";
7
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
7
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
8
8
  // src/protocols/dash-cmaf/parse.ts
9
9
  /**
10
10
  * MPD into the IR. Pure: no fetching, no state, no side effects. DOMParser
@@ -260,6 +260,28 @@ function supplementalOf(representation, adaptationSet) {
260
260
  for (const element of [representation, adaptationSet]) for (const attribute of Array.from(element.attributes)) if (attribute.localName === "supplementalCodecs") return { supplementalCodecs: attribute.value };
261
261
  return {};
262
262
  }
263
+ const OMAF_PROJECTION = "urn:mpeg:mpegI:omaf:2017:pf";
264
+ /**
265
+ * The OMAF projection format descriptor (ISO/IEC 23090-2 §8.3.2), on the
266
+ * Representation or its AdaptationSet, as EssentialProperty or
267
+ * SupplementalProperty: 3GPP TS 26.118 §5.2.2.3 uses the second, its
268
+ * advanced profile and the OMAF reference software the first.
269
+ * `omaf:projection_type` 0 is equirectangular, 1 a cube map, which the IR
270
+ * does not name. Read by local name, since the prefix is the manifest's
271
+ * choice. OMAF has no half-equirectangular type. Sources:
272
+ * https://www.etsi.org/deliver/etsi_ts/126100_126199/126118/17.00.00_60/ts_126118v170000p.pdf
273
+ * https://github.com/nokiatech/omaf/blob/d08ad5b82e021696483bc6fece804f915b5b389c/Player/Sources/Player/DashProvider/NVRMPDExtension.cpp#L25-L34
274
+ */
275
+ function projectionOf(representation, adaptationSet) {
276
+ for (const element of [representation, adaptationSet]) for (const property of [...children(element, "EssentialProperty"), ...children(element, "SupplementalProperty")]) {
277
+ if (attr(property, "schemeIdUri") !== OMAF_PROJECTION) continue;
278
+ for (const attribute of Array.from(property.attributes)) {
279
+ if (attribute.localName !== "projection_type") continue;
280
+ return attribute.value.trim().split(/\s+/)[0] === "0" ? { projection: "equirectangular" } : {};
281
+ }
282
+ }
283
+ return {};
284
+ }
263
285
  function videoRangeOf(representation, adaptationSet, codecs) {
264
286
  for (const element of [representation, adaptationSet]) for (const property of [...children(element, "EssentialProperty"), ...children(element, "SupplementalProperty")]) {
265
287
  if (attr(property, "schemeIdUri") !== TRANSFER_CHARACTERISTICS) continue;
@@ -557,7 +579,7 @@ function followsOf(adaptationSet) {
557
579
  return ((_attr21 = attr(property, "value")) !== null && _attr21 !== void 0 ? _attr21 : "").split(/[\s,]+/).filter((v) => v !== "");
558
580
  });
559
581
  }
560
- function parsePeriod(periodElement, span, index, mpdBase, isLive, availability) {
582
+ function parsePeriod(periodElement, span, index, mpdBase, isLive, availability, capabilities) {
561
583
  var _attr30;
562
584
  const matching = /* @__PURE__ */ new Map();
563
585
  const periodStart = span.start;
@@ -586,7 +608,8 @@ function parsePeriod(periodElement, span, index, mpdBase, isLive, availability)
586
608
  if (id === null || bandwidth === null) continue;
587
609
  const repBase = applyBaseUrl(representation, asBase);
588
610
  const mimeType = (_ref2 = (_attr22 = attr(representation, "mimeType")) !== null && _attr22 !== void 0 ? _attr22 : asMime) !== null && _ref2 !== void 0 ? _ref2 : "video/mp4";
589
- if (/\/(webm|x-matroska)$/.test(mimeType)) continue;
611
+ const webm = /\/(webm|x-matroska)$/.test(mimeType);
612
+ if (webm && !capabilities.some((c) => typeof c !== "string" && c.mimeType === mimeType)) continue;
590
613
  trackMime = (_trackMime = trackMime) !== null && _trackMime !== void 0 ? _trackMime : mimeType;
591
614
  const segmentBase = children(representation, "SegmentBase")[0];
592
615
  if (segmentBase !== void 0) {
@@ -597,12 +620,13 @@ function parsePeriod(periodElement, span, index, mpdBase, isLive, availability)
597
620
  const pto = numberAttr(segmentBase, "presentationTimeOffset");
598
621
  const initElement = children(segmentBase, "Initialization")[0];
599
622
  const initRange = initElement !== void 0 ? parseByteRange(attr(initElement, "range")) : null;
600
- const sidxSegments = _objectSpread2({
623
+ if (webm && initRange === null) continue;
624
+ const sidxSegments = _objectSpread2(_objectSpread2({
601
625
  kind: "sidx",
602
626
  url: repBase,
603
627
  indexRange,
604
628
  timescale: baseTimescale
605
- }, pto !== null && pto !== 0 ? { presentationTimeOffset: pto / baseTimescale } : {});
629
+ }, pto !== null && pto !== 0 ? { presentationTimeOffset: pto / baseTimescale } : {}), webm ? { format: "webm" } : {});
606
630
  const sidxInit = initRange !== null ? {
607
631
  url: repBase,
608
632
  byteRange: initRange
@@ -610,13 +634,13 @@ function parsePeriod(periodElement, span, index, mpdBase, isLive, availability)
610
634
  const w = numberAttr(representation, "width");
611
635
  const h = numberAttr(representation, "height");
612
636
  const fr = (_parseFrameRate = parseFrameRate(attr(representation, "frameRate"))) !== null && _parseFrameRate !== void 0 ? _parseFrameRate : parseFrameRate(attr(adaptationSet, "frameRate"));
613
- renditions.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
637
+ renditions.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
614
638
  id,
615
639
  bitrate: bandwidth,
616
640
  codecs: (_attr23 = attr(representation, "codecs")) !== null && _attr23 !== void 0 ? _attr23 : asCodecs,
617
641
  mimeType,
618
642
  segments: sidxSegments
619
- }, sidxInit !== null ? { init: sidxInit } : {}), w !== null ? { width: w } : {}), h !== null ? { height: h } : {}), fr !== null ? { frameRate: fr } : {}), videoRangeOf(representation, adaptationSet, (_attr24 = attr(representation, "codecs")) !== null && _attr24 !== void 0 ? _attr24 : asCodecs)), channelsOf(representation, adaptationSet)), supplementalOf(representation, adaptationSet)));
643
+ }, sidxInit !== null ? { init: sidxInit } : {}), w !== null ? { width: w } : {}), h !== null ? { height: h } : {}), fr !== null ? { frameRate: fr } : {}), videoRangeOf(representation, adaptationSet, (_attr24 = attr(representation, "codecs")) !== null && _attr24 !== void 0 ? _attr24 : asCodecs)), channelsOf(representation, adaptationSet)), supplementalOf(representation, adaptationSet)), projectionOf(representation, adaptationSet)));
620
644
  continue;
621
645
  }
622
646
  const list = segmentListOf([
@@ -628,13 +652,13 @@ function parsePeriod(periodElement, span, index, mpdBase, isLive, availability)
628
652
  if (list !== null) {
629
653
  var _attr25, _attr26;
630
654
  const segments = list.segments.map((segment) => segment.duration === 0 && periodDuration !== null ? _objectSpread2(_objectSpread2({}, segment), {}, { duration: periodDuration }) : segment);
631
- renditions.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
655
+ renditions.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
632
656
  id,
633
657
  bitrate: bandwidth,
634
658
  codecs: (_attr25 = attr(representation, "codecs")) !== null && _attr25 !== void 0 ? _attr25 : asCodecs,
635
659
  mimeType,
636
660
  segments
637
- }, list.init !== null ? { init: list.init } : {}), numberAttr(representation, "width") !== null ? { width: numberAttr(representation, "width") } : {}), numberAttr(representation, "height") !== null ? { height: numberAttr(representation, "height") } : {}), videoRangeOf(representation, adaptationSet, (_attr26 = attr(representation, "codecs")) !== null && _attr26 !== void 0 ? _attr26 : asCodecs)), channelsOf(representation, adaptationSet)), supplementalOf(representation, adaptationSet)));
661
+ }, list.init !== null ? { init: list.init } : {}), numberAttr(representation, "width") !== null ? { width: numberAttr(representation, "width") } : {}), numberAttr(representation, "height") !== null ? { height: numberAttr(representation, "height") } : {}), videoRangeOf(representation, adaptationSet, (_attr26 = attr(representation, "codecs")) !== null && _attr26 !== void 0 ? _attr26 : asCodecs)), channelsOf(representation, adaptationSet)), supplementalOf(representation, adaptationSet)), projectionOf(representation, adaptationSet)));
638
662
  continue;
639
663
  }
640
664
  const template = mergeTemplates([
@@ -682,13 +706,13 @@ function parsePeriod(periodElement, span, index, mpdBase, isLive, availability)
682
706
  const height = numberAttr(representation, "height");
683
707
  const tiles = tileGridOf(representation, adaptationSet, width, height);
684
708
  const playoutRate = trick ? (_numberAttr15 = numberAttr(representation, "maxPlayoutRate")) !== null && _numberAttr15 !== void 0 ? _numberAttr15 : asPlayoutRate : null;
685
- renditions.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
709
+ renditions.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
686
710
  id,
687
711
  bitrate: bandwidth,
688
712
  codecs: (_attr28 = attr(representation, "codecs")) !== null && _attr28 !== void 0 ? _attr28 : asCodecs,
689
713
  mimeType,
690
714
  segments
691
- }, init !== null ? { init } : {}), width !== null ? { width } : {}), height !== null ? { height } : {}), frameRate !== null ? { frameRate } : {}), videoRangeOf(representation, adaptationSet, (_attr29 = attr(representation, "codecs")) !== null && _attr29 !== void 0 ? _attr29 : asCodecs)), tiles !== null ? { tiles } : {}), playoutRate !== null ? { maxPlayoutRate: playoutRate } : {}), channelsOf(representation, adaptationSet)), supplementalOf(representation, adaptationSet)));
715
+ }, init !== null ? { init } : {}), width !== null ? { width } : {}), height !== null ? { height } : {}), frameRate !== null ? { frameRate } : {}), videoRangeOf(representation, adaptationSet, (_attr29 = attr(representation, "codecs")) !== null && _attr29 !== void 0 ? _attr29 : asCodecs)), tiles !== null ? { tiles } : {}), playoutRate !== null ? { maxPlayoutRate: playoutRate } : {}), channelsOf(representation, adaptationSet)), supplementalOf(representation, adaptationSet)), projectionOf(representation, adaptationSet)));
692
716
  }
693
717
  if (renditions.length === 0) continue;
694
718
  const mimeType = (_trackMime2 = trackMime) !== null && _trackMime2 !== void 0 ? _trackMime2 : "video/mp4";
@@ -814,8 +838,12 @@ function serviceOf(mpd) {
814
838
  * dash.js's live delay: the ServiceDescription target, else
815
839
  * `@suggestedPresentationDelay`, else four `@maxSegmentDuration`, else four
816
840
  * `@minBufferTime`.
841
+ *
842
+ * `capabilities` is the composition's. A WebM Representation is kept
843
+ * only when a stage provides its MIME type as a content handler, as the
844
+ * `webm` container does.
817
845
  */
818
- function parse(text, baseUrl, lowLatency = false) {
846
+ function parse(text, baseUrl, lowLatency = false, capabilities = []) {
819
847
  var _flat$tracks, _flat$events;
820
848
  let doc;
821
849
  try {
@@ -887,7 +915,7 @@ function parse(text, baseUrl, lowLatency = false) {
887
915
  const parsed = [];
888
916
  for (let i = 0; i < periodElements.length; i += 1) {
889
917
  if (i > 0 && isLive) break;
890
- const result = parsePeriod(periodElements[i], spans[i], i, mpdBase, isLive, availability);
918
+ const result = parsePeriod(periodElements[i], spans[i], i, mpdBase, isLive, availability, capabilities);
891
919
  if ("error" in result) return {
892
920
  presentation: null,
893
921
  error: result.error
@@ -1,6 +1,6 @@
1
1
  import { findRendition } from "../../kernel/presentation.js";
2
2
  import { segmentAt } from "../../kernel/timeline.js";
3
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/asyncToGenerator.js";
3
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/asyncToGenerator.js";
4
4
  // src/protocols/dash-cmaf/periods-runtime.ts
5
5
  /**
6
6
  * What a flattened multi-period presentation needs at playback time, kept
@@ -1,5 +1,5 @@
1
1
  import { isIndexed, isUnresolved, segmentAt } from "../../kernel/timeline.js";
2
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
2
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
3
3
  // src/protocols/dash-cmaf/periods.ts
4
4
  /**
5
5
  * Several DASH Periods as one continuous presentation, the way Shaka
@@ -1,7 +1,7 @@
1
1
  import { scheduled, tickAfter } from "../../kernel/effects.js";
2
2
  import { parse } from "../dash-cmaf/parse.js";
3
3
  import { registerLiveNamespace } from "../live-shared.js";
4
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
4
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
5
5
  // src/protocols/dash-live/index.ts
6
6
  /**
7
7
  * DASH live: the edge is computed, never read. Wall clock enters only as
@@ -143,8 +143,11 @@ function reloadFailed(state, presentation, cause) {
143
143
  tickPending: true
144
144
  }), [tick((_presentation$live$up = presentation.live.updatePeriod) !== null && _presentation$live$up !== void 0 ? _presentation$live$up : 4)]];
145
145
  }
146
- /** The slice reducer. `lowLatency` reloads the MPD as dash-ll reads it. */
147
- const createReduceDashLive = (lowLatency = false) => (slice, msg, kernel) => {
146
+ /**
147
+ * The slice reducer. `lowLatency` reloads the MPD as dash-ll reads it.
148
+ * `capabilities` is the composition's, which the MPD parse reads.
149
+ */
150
+ const createReduceDashLive = (lowLatency = false, capabilities = []) => (slice, msg, kernel) => {
148
151
  let state = slice !== null && slice !== void 0 ? slice : INITIAL;
149
152
  if ((msg.type === "TIME_UPDATE" || msg.type === "SEGMENT_LOADED") && msg.wallClock !== void 0) state = _objectSpread2(_objectSpread2({}, state), {}, { lastWallClock: msg.wallClock });
150
153
  if (msg.type === "SEGMENT_LOADED" && (msg.trackId === "manifest" || msg.trackId === MPD_TOKEN) && msg.serverDate !== void 0 && msg.wallClock !== void 0) state = _objectSpread2(_objectSpread2({}, state), {}, { mpdSkew: msg.serverDate - msg.wallClock });
@@ -256,7 +259,7 @@ const createReduceDashLive = (lowLatency = false) => (slice, msg, kernel) => {
256
259
  var _msg$url;
257
260
  if (state.manifestUrl === null) return [state, []];
258
261
  const base = (_msg$url = msg.url) !== null && _msg$url !== void 0 ? _msg$url : state.manifestUrl;
259
- const result = parse(new TextDecoder().decode(msg.bytes), base, lowLatency);
262
+ const result = parse(new TextDecoder().decode(msg.bytes), base, lowLatency, capabilities);
260
263
  if (result.presentation === null) return reloadFailed(state, kernel.presentation, result.error.code);
261
264
  const effects = [];
262
265
  const hash = hashOf(msg.bytes);
@@ -296,7 +299,7 @@ function dashLive() {
296
299
  provides: ["dash-live"],
297
300
  requires: ["dash-cmaf"],
298
301
  install(ctx) {
299
- ctx.reduce("dash-live", createReduceDashLive());
302
+ ctx.reduce("dash-live", createReduceDashLive(false, ctx.capabilities()));
300
303
  registerLiveNamespace(ctx);
301
304
  }
302
305
  };
@@ -30,8 +30,9 @@ function dashLl(options = {}) {
30
30
  ...MANIFEST_TYPES
31
31
  ],
32
32
  install(ctx) {
33
- ctx.reduce("dash", createReduceDash(retryMs, true));
34
- ctx.reduce("dash-live", createReduceDashLive(true));
33
+ const capabilities = ctx.capabilities();
34
+ ctx.reduce("dash", createReduceDash(retryMs, true, capabilities));
35
+ ctx.reduce("dash-live", createReduceDashLive(true, capabilities));
35
36
  ctx.registerChunkSplitter(completeChunks);
36
37
  registerLiveNamespace(ctx);
37
38
  return installDashPeriods(ctx);
@@ -4,7 +4,7 @@ import { activeRenditions } from "../../kernel/rendition-select.js";
4
4
  import { manifestFact } from "../adapter-shared.js";
5
5
  import { parse, parseMediaPlaylist, refreshFor } from "./parse.js";
6
6
  import { LOAD_FAILED, readmitMessage, unavailableMessages } from "./unavailable.js";
7
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
7
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
8
8
  // src/protocols/hls-cmaf/index.ts
9
9
  /**
10
10
  * The hls-cmaf protocol adapter as a stage. Inert module: exports a
@@ -3,7 +3,7 @@ import { resolveUrl } from "../../kernel/url.js";
3
3
  import { manifestError } from "../adapter-shared.js";
4
4
  import { dimensions } from "../dimensions.js";
5
5
  import { lex } from "./lexer.js";
6
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
6
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
7
7
  // src/protocols/hls-cmaf/parse.ts
8
8
  /**
9
9
  * m3u8 into the IR. Pure: no fetching, no state, no side effects. URLs are
@@ -608,7 +608,7 @@ function parse(text, baseUrl, parseMedia = parseMediaPlaylist) {
608
608
  const alternateVideos = /* @__PURE__ */ new Map();
609
609
  let mainVideo;
610
610
  for (const variant of variants) {
611
- var _dimensions, _variant$attributes$V;
611
+ var _dimensions, _split$0$split, _split$, _variant$attributes$R, _variant$attributes$V;
612
612
  const bandwidth = Number(variant.attributes.BANDWIDTH) || 0;
613
613
  const [width, height] = (_dimensions = dimensions(variant.attributes.RESOLUTION)) !== null && _dimensions !== void 0 ? _dimensions : [];
614
614
  const { video, audio } = splitCodecs(variant.attributes.CODECS);
@@ -621,6 +621,8 @@ function parse(text, baseUrl, parseMedia = parseMediaPlaylist) {
621
621
  const frameRate = Number(variant.attributes["FRAME-RATE"]);
622
622
  const range = variant.attributes["VIDEO-RANGE"];
623
623
  const videoRange = range === "SDR" || range === "PQ" || range === "HLG" ? range : video !== null && /^dv(h1|he|a1|av)/.test(video) ? "PQ" : void 0;
624
+ const layout = (_split$0$split = (_split$ = ((_variant$attributes$R = variant.attributes["REQ-VIDEO-LAYOUT"]) !== null && _variant$attributes$R !== void 0 ? _variant$attributes$R : "").split(",")[0]) === null || _split$ === void 0 ? void 0 : _split$.split("/")) !== null && _split$0$split !== void 0 ? _split$0$split : [];
625
+ const projection = layout.includes("PROJ-EQUI") ? "equirectangular" : layout.includes("PROJ-HEQU") ? "half-equirectangular" : void 0;
624
626
  const pathway = variant.attributes["PATHWAY-ID"];
625
627
  let id = pathway !== void 0 ? `v-${bandwidth}-${pathway}` : `v-${bandwidth}`;
626
628
  const taken = declared.get(id);
@@ -631,14 +633,14 @@ function parse(text, baseUrl, parseMedia = parseMediaPlaylist) {
631
633
  declared.set(id, variant.attributes);
632
634
  const average = Number(variant.attributes["AVERAGE-BANDWIDTH"]);
633
635
  const supplemental = variant.attributes["SUPPLEMENTAL-CODECS"];
634
- const base = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
636
+ const base = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
635
637
  id,
636
638
  bitrate: bandwidth,
637
639
  codecs,
638
640
  mimeType: "video/mp4",
639
641
  segments: [],
640
642
  playlistUrl: variant.uri
641
- }, average > 0 ? { averageBitrate: average } : {}), supplemental !== void 0 ? { supplementalCodecs: supplemental } : {}), pathway !== void 0 ? { pathway } : {}), width !== void 0 ? { width } : {}), height !== void 0 ? { height } : {}), Number.isFinite(frameRate) ? { frameRate } : {}), videoRange !== void 0 ? { videoRange } : {});
643
+ }, average > 0 ? { averageBitrate: average } : {}), supplemental !== void 0 ? { supplementalCodecs: supplemental } : {}), pathway !== void 0 ? { pathway } : {}), width !== void 0 ? { width } : {}), height !== void 0 ? { height } : {}), Number.isFinite(frameRate) ? { frameRate } : {}), videoRange !== void 0 ? { videoRange } : {}), projection !== void 0 ? { projection } : {});
642
644
  const requires = {};
643
645
  if (variant.attributes.AUDIO !== void 0) requires.audio = variant.attributes.AUDIO;
644
646
  if (variant.attributes.SUBTITLES !== void 0) requires.text = variant.attributes.SUBTITLES;
@@ -1,6 +1,6 @@
1
1
  import { isTrick } from "../../kernel/presentation.js";
2
2
  import { withDeadGroups } from "../../kernel/rendition-select.js";
3
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
4
4
  // src/protocols/hls-cmaf/unavailable.ts
5
5
  /**
6
6
  * What a playlist that cannot be used means for playback. Pure; shared by
@@ -4,7 +4,7 @@ import { activeRenditions } from "../../kernel/rendition-select.js";
4
4
  import { parseMediaPlaylist, refreshFor } from "../hls-cmaf/parse.js";
5
5
  import { RELOAD_FAILED, readmitMessage, unavailableMessages } from "../hls-cmaf/unavailable.js";
6
6
  import { registerLiveNamespace } from "../live-shared.js";
7
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
7
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
8
8
  // src/protocols/hls-live/index.ts
9
9
  /**
10
10
  * HLS live: the edge is read, never computed. A slice reducer reloads the
@@ -2,7 +2,7 @@ import { resolveUrl } from "../../kernel/url.js";
2
2
  import { manifestError } from "../adapter-shared.js";
3
3
  import { lex } from "../hls-cmaf/lexer.js";
4
4
  import { parseByteRange, parseMediaLines } from "../hls-cmaf/parse.js";
5
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
5
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
6
6
  // src/protocols/hls-ll/parse.ts
7
7
  /**
8
8
  * Low-latency HLS media playlists (RFC 8216bis §4.4.3.7, §4.4.3.8,
@@ -155,7 +155,7 @@ function parseLowLatency(text, baseUrl, previous = [], previousRanges = []) {
155
155
  const length = Number(attributes["BYTERANGE-LENGTH"]);
156
156
  hint = _objectSpread2({ url: resolveUrl(uri, baseUrl) }, Number.isFinite(start) ? { byteRange: {
157
157
  start,
158
- end: length > 0 ? start + length - 1 : Infinity
158
+ end: length > 0 ? start + length - 1 : 1e400
159
159
  } } : {});
160
160
  break;
161
161
  }
@@ -1,7 +1,7 @@
1
1
  import { scheduled } from "../../kernel/effects.js";
2
2
  import { findRendition, isTrick } from "../../kernel/presentation.js";
3
3
  import { canSwitchTo } from "../../kernel/rendition-select.js";
4
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
4
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
5
5
  // src/stages/abr/index.ts
6
6
  /**
7
7
  * Adaptive bitrate as a stage, not kernel. It registers one chooser
@@ -1,5 +1,5 @@
1
1
  import { findRendition } from "../../kernel/presentation.js";
2
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/asyncToGenerator.js";
2
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/asyncToGenerator.js";
3
3
  // src/stages/aes-128/index.ts
4
4
  /**
5
5
  * aes-128 as a stage: full-segment AES-CBC decryption for HLS EXT-X-KEY
@@ -1,7 +1,7 @@
1
1
  import { findTrackSite } from "../../kernel/presentation.js";
2
2
  import { chaptersFromInput, parseAppleChapters, parseChapterTrack } from "./parse.js";
3
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
4
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/asyncToGenerator.js";
3
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
4
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/asyncToGenerator.js";
5
5
  // src/stages/chapters/index.ts
6
6
  /**
7
7
  * Chapters: named spans of the presentation, answered through
@@ -1,7 +1,7 @@
1
1
  import { parseVtt } from "../../containers/webvtt.js";
2
2
  import { resolveUrl } from "../../kernel/url.js";
3
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
4
- import _objectWithoutProperties from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectWithoutProperties.js";
3
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
4
+ import _objectWithoutProperties from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectWithoutProperties.js";
5
5
  // src/stages/chapters/parse.ts
6
6
  /**
7
7
  * Chapter files into one record shape. Pure. A WebVTT file serves two
@@ -1,6 +1,6 @@
1
1
  import { codecMismatch, probeInitSegment } from "../../containers/codec-probe/index.js";
2
2
  import { findRendition } from "../../kernel/presentation.js";
3
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
4
4
  // src/stages/codec-probe/index.ts
5
5
  /**
6
6
  * codec-probe as a loadable stage. The derivation itself lives in the
@@ -1,5 +1,5 @@
1
1
  import { scheduled, tickAfter } from "../../kernel/effects.js";
2
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
2
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
3
3
  // src/stages/content-steering/index.ts
4
4
  /**
5
5
  * Content steering: pathway switching from a steering manifest, plus
@@ -1,7 +1,7 @@
1
1
  import { bytesToBase64 } from "../../kernel/base64.js";
2
2
  import { keySystemHandlers, normalizeSystemId } from "../drm-shared.js";
3
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
4
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/asyncToGenerator.js";
3
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
4
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/asyncToGenerator.js";
5
5
  // src/stages/eme-core/index.ts
6
6
  /**
7
7
  * The generic EME handshake, entanglement #3 resolved: DRM lands without
@@ -23,8 +23,8 @@ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.157.0/help
23
23
  * its own (Widevine `license-renewal`) takes the normal license path.
24
24
  *
25
25
  * ClearKey is built in — it is the only key system testable headlessly.
26
- * Widevine, PlayReady, and FairPlay arrive as handlers eme-cenc and
27
- * eme-fairplay register through drm-shared.
26
+ * Widevine, PlayReady, FairPlay, and WisePlay arrive as handlers eme-cenc,
27
+ * eme-fairplay, and eme-wiseplay register through drm-shared.
28
28
  *
29
29
  * A license request follows hls.js's key-load policy: a network error or
30
30
  * an HTTP status outside 4xx retries up to 8 times, a timeout (20 s) once,
@@ -1,6 +1,6 @@
1
1
  import { base64ToBytes, bytesToBase64 } from "../../kernel/base64.js";
2
2
  import { registerKeySystem } from "../drm-shared.js";
3
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
4
4
  // src/stages/eme-fairplay/index.ts
5
5
  /**
6
6
  * FairPlay Streaming: the non-standard SPC/CKC flow. Safari only, and it
@@ -0,0 +1,24 @@
1
+ import { registerKeySystem } from "../drm-shared.js";
2
+ // src/stages/eme-wiseplay/index.ts
3
+ /** ChinaDRM's system id, which WisePlay signals. */
4
+ const WISEPLAY_SYSTEM_ID = "3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c";
5
+ /** The key system strings, in the order eme-core asks for them. */
6
+ const WISEPLAY_KEY_SYSTEMS = ["com.huawei.wiseplay", "com.wiseplay.drm"];
7
+ /** The WisePlay handlers for eme-core, under both key system strings. */
8
+ function emeWiseplay() {
9
+ return {
10
+ name: "eme-wiseplay",
11
+ provides: ["eme-wiseplay"],
12
+ requires: ["eme-core"],
13
+ install() {
14
+ for (const keySystem of WISEPLAY_KEY_SYSTEMS) registerKeySystem({
15
+ keySystem,
16
+ systemIds: [WISEPLAY_SYSTEM_ID],
17
+ initDataTypes: ["cenc"],
18
+ buildLicenseRequest: (message) => message,
19
+ parseLicenseResponse: (response) => response
20
+ });
21
+ }
22
+ };
23
+ }
24
+ export { WISEPLAY_KEY_SYSTEMS, WISEPLAY_SYSTEM_ID, emeWiseplay as default };
@@ -1,4 +1,4 @@
1
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/asyncToGenerator.js";
1
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/asyncToGenerator.js";
2
2
  // src/stages/hdr/index.ts
3
3
  const SOURCE = "hdr";
4
4
  /** The display's answer, or null when the browser does not know `dynamic-range`. */
@@ -1,6 +1,6 @@
1
1
  import { scte35Summary } from "../../containers/scte35.js";
2
2
  import { resolveUrl } from "../../kernel/url.js";
3
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
4
4
  // src/stages/interstitials/breaks.ts
5
5
  /**
6
6
  * Breaks from what the stream signals, as plain data. HLS interstitials
@@ -2,8 +2,8 @@ import { placeEmsg } from "../../containers/emsg.js";
2
2
  import { findBox, trackTimescales } from "../../containers/mp4-box/index.js";
3
3
  import { bytesToBase64 } from "../../kernel/base64.js";
4
4
  import { assetsOf, breaksOf, fromEvent } from "./breaks.js";
5
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/objectSpread2.js";
6
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.157.0/helpers/esm/asyncToGenerator.js";
5
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/objectSpread2.js";
6
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/asyncToGenerator.js";
7
7
  // src/stages/interstitials/index.ts
8
8
  /**
9
9
  * Plays breaks: HLS interstitials, DASH alternative MPD events, and the