mattebox 0.21.1 → 0.21.2

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 (100) hide show
  1. package/README.md +1 -1
  2. package/dist/cdn/mattebox.dash-drm.min.js +3 -3
  3. package/dist/cdn/mattebox.dash-ll.min.js +2 -2
  4. package/dist/cdn/mattebox.dash.min.js +3 -3
  5. package/dist/cdn/mattebox.dual-drm.min.js +3 -3
  6. package/dist/cdn/mattebox.dual-ll.min.js +3 -3
  7. package/dist/cdn/mattebox.dual-ts-drm.min.js +3 -3
  8. package/dist/cdn/mattebox.dual-ts.min.js +3 -3
  9. package/dist/cdn/mattebox.dual.min.js +3 -3
  10. package/dist/cdn/mattebox.hls-drm.min.js +3 -3
  11. package/dist/cdn/mattebox.hls-ll.min.js +3 -3
  12. package/dist/cdn/mattebox.hls-ts-drm.min.js +3 -3
  13. package/dist/cdn/mattebox.hls-ts.min.js +3 -3
  14. package/dist/cdn/mattebox.hls.min.js +3 -3
  15. package/dist/cdn/mattebox.kernel.min.js +1 -1
  16. package/dist/cdn/mattebox.min.js +3 -3
  17. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.159.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/asyncToGenerator.js +1 -1
  18. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.159.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/defineProperty.js +1 -1
  19. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.159.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/objectSpread2.js +1 -1
  20. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.159.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/objectWithoutProperties.js +1 -1
  21. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.159.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
  22. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.159.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/toPrimitive.js +1 -1
  23. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.159.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/toPropertyKey.js +1 -1
  24. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.159.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/typeof.js +1 -1
  25. package/dist/es2015/containers/fmp4/fit.js +1 -1
  26. package/dist/es2015/containers/id3.js +1 -1
  27. package/dist/es2015/containers/scte35.js +1 -1
  28. package/dist/es2015/containers/ts-transmux/h264.js +1 -1
  29. package/dist/es2015/containers/ts-transmux/h265.js +1 -1
  30. package/dist/es2015/containers/ts-transmux/index.js +1 -1
  31. package/dist/es2015/containers/ts-transmux/runner.js +2 -2
  32. package/dist/es2015/containers/ts-transmux/transmux.js +1 -1
  33. package/dist/es2015/containers/webm/index.js +1 -1
  34. package/dist/es2015/containers/webvtt.js +1 -1
  35. package/dist/es2015/containers/wvtt.js +1 -1
  36. package/dist/es2015/eme/index.js +3 -3
  37. package/dist/es2015/index.js +2 -2
  38. package/dist/es2015/kernel/append-queue.js +1 -1
  39. package/dist/es2015/kernel/bus.js +1 -1
  40. package/dist/es2015/kernel/context.js +1 -1
  41. package/dist/es2015/kernel/dry-run.js +1 -1
  42. package/dist/es2015/kernel/mse.js +5 -2
  43. package/dist/es2015/kernel/prepare.js +2 -2
  44. package/dist/es2015/kernel/reducer.js +120 -9
  45. package/dist/es2015/kernel/refresh.js +1 -1
  46. package/dist/es2015/kernel/rendition-select.js +2 -2
  47. package/dist/es2015/kernel/scheduler.js +1 -1
  48. package/dist/es2015/kernel/timeline.js +1 -1
  49. package/dist/es2015/kernel/trace.js +1 -1
  50. package/dist/es2015/kernel/transport.js +2 -2
  51. package/dist/es2015/presets/define.js +2 -2
  52. package/dist/es2015/protocols/dash-cmaf/index.js +1 -1
  53. package/dist/es2015/protocols/dash-cmaf/parse.js +1 -1
  54. package/dist/es2015/protocols/dash-cmaf/periods-runtime.js +1 -1
  55. package/dist/es2015/protocols/dash-cmaf/periods.js +1 -1
  56. package/dist/es2015/protocols/dash-live/index.js +1 -1
  57. package/dist/es2015/protocols/hls-cmaf/index.js +1 -1
  58. package/dist/es2015/protocols/hls-cmaf/parse.js +1 -1
  59. package/dist/es2015/protocols/hls-cmaf/unavailable.js +1 -1
  60. package/dist/es2015/protocols/hls-live/index.js +1 -1
  61. package/dist/es2015/protocols/hls-ll/parse.js +1 -1
  62. package/dist/es2015/stages/abr/index.js +1 -1
  63. package/dist/es2015/stages/aes-128/index.js +1 -1
  64. package/dist/es2015/stages/chapters/index.js +2 -2
  65. package/dist/es2015/stages/chapters/parse.js +2 -2
  66. package/dist/es2015/stages/codec-probe/index.js +1 -1
  67. package/dist/es2015/stages/content-steering/index.js +1 -1
  68. package/dist/es2015/stages/eme-core/index.js +2 -2
  69. package/dist/es2015/stages/eme-fairplay/index.js +1 -1
  70. package/dist/es2015/stages/hdr/index.js +1 -1
  71. package/dist/es2015/stages/interstitials/breaks.js +1 -1
  72. package/dist/es2015/stages/interstitials/index.js +2 -2
  73. package/dist/es2015/stages/qoe/index.js +1 -1
  74. package/dist/es2015/stages/recovery/index.js +1 -1
  75. package/dist/es2015/stages/rendition-names/index.js +1 -1
  76. package/dist/es2015/stages/text-cea608/decode.js +1 -1
  77. package/dist/es2015/stages/text-cea708/decode.js +2 -2
  78. package/dist/es2015/stages/text-cea708/index.js +1 -1
  79. package/dist/es2015/stages/text-ttml/index.js +1 -1
  80. package/dist/es2015/stages/text-ttml/parse.js +1 -1
  81. package/dist/es2015/stages/thumbnails/index.js +1 -1
  82. package/dist/es2015/stages/timed-metadata/index.js +1 -1
  83. package/dist/es2015/stages/transcript/index.js +2 -2
  84. package/dist/es2015/stages/trick-play/index.js +56 -5
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +3 -1
  87. package/dist/index.js.map +1 -1
  88. package/dist/kernel/mse.d.ts.map +1 -1
  89. package/dist/kernel/mse.js +14 -3
  90. package/dist/kernel/mse.js.map +1 -1
  91. package/dist/kernel/reducer.d.ts.map +1 -1
  92. package/dist/kernel/reducer.js +125 -2
  93. package/dist/kernel/reducer.js.map +1 -1
  94. package/dist/stages/trick-play/index.d.ts +10 -5
  95. package/dist/stages/trick-play/index.d.ts.map +1 -1
  96. package/dist/stages/trick-play/index.js +55 -6
  97. package/dist/stages/trick-play/index.js.map +1 -1
  98. package/dist/types/kernel.d.ts +6 -0
  99. package/dist/types/kernel.d.ts.map +1 -1
  100. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- // \0@oxc-project+runtime@0.159.0/helpers/esm/asyncToGenerator.js
1
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/asyncToGenerator.js
2
2
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
3
3
  try {
4
4
  var i = n[a](c), u = i.value;
@@ -1,5 +1,5 @@
1
1
  import toPropertyKey from "./toPropertyKey.js";
2
- // \0@oxc-project+runtime@0.159.0/helpers/esm/defineProperty.js
2
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/defineProperty.js
3
3
  function _defineProperty(e, r, t) {
4
4
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
5
5
  value: t,
@@ -1,5 +1,5 @@
1
1
  import _defineProperty from "./defineProperty.js";
2
- // \0@oxc-project+runtime@0.159.0/helpers/esm/objectSpread2.js
2
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/objectSpread2.js
3
3
  function ownKeys(e, r) {
4
4
  var t = Object.keys(e);
5
5
  if (Object.getOwnPropertySymbols) {
@@ -1,5 +1,5 @@
1
1
  import _objectWithoutPropertiesLoose from "./objectWithoutPropertiesLoose.js";
2
- // \0@oxc-project+runtime@0.159.0/helpers/esm/objectWithoutProperties.js
2
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/objectWithoutProperties.js
3
3
  function _objectWithoutProperties(e, t) {
4
4
  if (null == e) return {};
5
5
  var o, r, i = _objectWithoutPropertiesLoose(e, t);
@@ -1,4 +1,4 @@
1
- // \0@oxc-project+runtime@0.159.0/helpers/esm/objectWithoutPropertiesLoose.js
1
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/objectWithoutPropertiesLoose.js
2
2
  function _objectWithoutPropertiesLoose(r, e) {
3
3
  if (null == r) return {};
4
4
  var t = {};
@@ -1,5 +1,5 @@
1
1
  import _typeof from "./typeof.js";
2
- // \0@oxc-project+runtime@0.159.0/helpers/esm/toPrimitive.js
2
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/toPrimitive.js
3
3
  function toPrimitive(t, e) {
4
4
  if ("object" != _typeof(t) || !t) return t;
5
5
  var r;
@@ -1,6 +1,6 @@
1
1
  import _typeof from "./typeof.js";
2
2
  import toPrimitive from "./toPrimitive.js";
3
- // \0@oxc-project+runtime@0.159.0/helpers/esm/toPropertyKey.js
3
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/toPropertyKey.js
4
4
  function toPropertyKey(t) {
5
5
  var i = toPrimitive(t, "string");
6
6
  return "symbol" == _typeof(i) ? i : i + "";
@@ -1,4 +1,4 @@
1
- // \0@oxc-project+runtime@0.159.0/helpers/esm/typeof.js
1
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/typeof.js
2
2
  function _typeof(o) {
3
3
  "@babel/helpers - typeof";
4
4
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -1,6 +1,6 @@
1
1
  import { findBox, fragmentSamples, fullBox, viewOf } from "../mp4-box/index.js";
2
2
  import { writeMediaSegment } from "./writer.js";
3
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
4
4
  // src/containers/fmp4/fit.ts
5
5
  /**
6
6
  * The first traf's per-sample encryption entries, null for a clear
@@ -1,5 +1,5 @@
1
1
  import { fourcc } from "./mp4-box/index.js";
2
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
2
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
3
3
  // src/containers/id3.ts
4
4
  const HEADER_SIZE = 10;
5
5
  function isId3(data, offset) {
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
2
2
  // src/containers/scte35.ts
3
3
  const TABLE_ID = 252;
4
4
  const SPLICE_INSERT = 5;
@@ -1,5 +1,5 @@
1
1
  import { toRbsp } from "../sei.js";
2
- import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/defineProperty.js";
2
+ import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/defineProperty.js";
3
3
  // src/containers/ts-transmux/h264.ts
4
4
  /**
5
5
  * H.264 Annex B to AVCC. The elementary stream separates NAL units with
@@ -1,5 +1,5 @@
1
1
  import { toRbsp } from "../sei.js";
2
- import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/defineProperty.js";
2
+ import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/defineProperty.js";
3
3
  // src/containers/ts-transmux/h265.ts
4
4
  /**
5
5
  * H.265 Annex B to the hvc1 sample format. The NAL units split on start
@@ -4,7 +4,7 @@ import { deliverMetadata, metadataWanted } from "../metadata.js";
4
4
  import { createTransmuxRunner } from "./runner.js";
5
5
  import { looksLikeTransportStream } from "./sniff.js";
6
6
  import { transmuxSource } from "./source.js";
7
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
7
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/asyncToGenerator.js";
8
8
  // src/containers/ts-transmux/index.ts
9
9
  /** Runs after decrypt-class steps (lower order) and before caption extraction. */
10
10
  const TRANSMUX_ORDER = 100;
@@ -1,5 +1,5 @@
1
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
2
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
1
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/asyncToGenerator.js";
2
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
3
3
  // src/containers/ts-transmux/runner.ts
4
4
  function createTransmuxRunner(options, source) {
5
5
  let worker = null;
@@ -4,7 +4,7 @@ import { ccTriplesFromSei } from "../sei.js";
4
4
  import { STREAM_TYPE, demux, unrollTimestamps } from "./demux.js";
5
5
  import { NAL_TYPE, accessUnitFromNals, nalType, splitNalUnits, spsDimensions, toAccessUnit } from "./h264.js";
6
6
  import { HEVC_NAL_TYPE, hevcAccessUnitFromNals, hevcDecoderConfiguration, hevcNalType, hevcSpsInfo } from "./h265.js";
7
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
7
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
8
8
  // src/containers/ts-transmux/transmux.ts
9
9
  /**
10
10
  * The transmux core: MPEG-TS bytes to a self-contained fragmented MP4. Each
@@ -3,7 +3,7 @@ import { findRendition } from "../../kernel/presentation.js";
3
3
  import { activeRenditions } from "../../kernel/rendition-select.js";
4
4
  import { isUnresolved } from "../../kernel/timeline.js";
5
5
  import { cuesToSegments, readCues, readInit } from "./cues.js";
6
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
6
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
7
7
  // src/containers/webm/index.ts
8
8
  /**
9
9
  * WebM segments in DASH. MSE takes `video/webm` and `audio/webm` as they
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
2
2
  // src/containers/webvtt.ts
3
3
  /** `HH:MM:SS.mmm` or `MM:SS.mmm` to seconds, or null. */
4
4
  function parseTimestamp(text) {
@@ -1,5 +1,5 @@
1
1
  import { fourcc, viewOf } from "./mp4-box/index.js";
2
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
2
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
3
3
  // src/containers/wvtt.ts
4
4
  /** The child boxes of `bytes`, as type and payload. */
5
5
  function boxes(bytes) {
@@ -1,8 +1,8 @@
1
1
  import { fetchWithin } from "../kernel/transport.js";
2
2
  import emeCore from "../stages/eme-core/index.js";
3
- import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectWithoutProperties.js";
4
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
5
- import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
3
+ import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectWithoutProperties.js";
4
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
5
+ import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/asyncToGenerator.js";
6
6
  // src/eme/index.ts
7
7
  /**
8
8
  * The engine's DRM on an element the engine does not drive. On Safari a
@@ -12,8 +12,8 @@ import { activeAudio, availableGroups, canSwitchTo, createArbiter, exclusionsOf
12
12
  import { createMseSink } from "./kernel/sinks/mse-sink.js";
13
13
  import { createTrackRegistry } from "./kernel/track-registry.js";
14
14
  import { createTransport } from "./kernel/transport.js";
15
- import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
16
- import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
15
+ import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
16
+ import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/asyncToGenerator.js";
17
17
  import { isAudioDescription, isEnhancedSpeech, isOriginal, isSdh, videoKind } from "./kernel/characteristics.js";
18
18
  import { exportTrace, replay } from "./kernel/trace.js";
19
19
  // src/index.ts
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
2
2
  // src/kernel/append-queue.ts
3
3
  function isQuotaError(err) {
4
4
  return err instanceof DOMException && err.name === "QuotaExceededError";
@@ -1,5 +1,5 @@
1
1
  import { createTraceBuffer, digest, lighten } from "./trace.js";
2
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
2
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
3
3
  // src/kernel/bus.ts
4
4
  /**
5
5
  * One trace entry. The digest walks the state, which on every message is
@@ -1,4 +1,4 @@
1
- import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
1
+ import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/asyncToGenerator.js";
2
2
  // src/kernel/context.ts
3
3
  /**
4
4
  * Builds one stage's context and returns the registrations' own teardown,
@@ -2,7 +2,7 @@ import { createBus } from "./bus.js";
2
2
  import { createEffectRunner } from "./effects.js";
3
3
  import { createSegmentPreparer } from "./prepare.js";
4
4
  import { createReducer, initialState } from "./reducer.js";
5
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
5
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
6
6
  // src/kernel/dry-run.ts
7
7
  /** The whole run ends here, whatever it has fetched: a preload must not outlive its use. */
8
8
  const LIMIT_MS = 1e4;
@@ -1,6 +1,6 @@
1
1
  import { createAppendQueue } from "./append-queue.js";
2
2
  import { createEvictor } from "./evictor.js";
3
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
4
4
  // src/kernel/mse.ts
5
5
  function managedMediaSource() {
6
6
  return globalThis.ManagedMediaSource;
@@ -384,7 +384,7 @@ function createMseController(options) {
384
384
  function registerHandlers(runner) {
385
385
  createSourceBuffer = (effect) => {
386
386
  const ms = mediaSource;
387
- if (ms !== null && !opened && ms.readyState === "closed") {
387
+ if (ms !== null && !opened) {
388
388
  pendingCreates.push(effect);
389
389
  return;
390
390
  }
@@ -406,6 +406,9 @@ function createMseController(options) {
406
406
  if (buffers.has(effect.sbId) || deferred.has(effect.sbId)) return;
407
407
  if (options.inferType !== void 0 && !declaresCodecs(effect.codecs)) {
408
408
  deferred.set(effect.sbId, effect.codecs);
409
+ const held = heldAppends.get(effect.sbId);
410
+ heldAppends.delete(effect.sbId);
411
+ for (const data of held !== null && held !== void 0 ? held : []) enqueueAppend(effect.sbId, data);
409
412
  return;
410
413
  }
411
414
  open(effect.sbId, effect.codecs);
@@ -1,5 +1,5 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
2
- import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
2
+ import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/asyncToGenerator.js";
3
3
  // src/kernel/prepare.ts
4
4
  /**
5
5
  * The boundary meta a transform and the probe receive. The content type
@@ -6,8 +6,8 @@ import { activeAudio, audioGroup, audioInGroup, availableGroups, canSwitchTo, co
6
6
  import { bufferedEndFrom, reachesEnd, schedule } from "./scheduler.js";
7
7
  import { sbIdFor } from "./sinks/mse-sink.js";
8
8
  import { reconciledOffset, segmentAtTime } from "./timeline.js";
9
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
10
- import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectWithoutProperties.js";
9
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
10
+ import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectWithoutProperties.js";
11
11
  // src/kernel/reducer.ts
12
12
  const _excluded = ["pendingInit"];
13
13
  const _excluded2 = ["repeat"];
@@ -15,8 +15,9 @@ const _excluded3 = ["appended"];
15
15
  const _excluded4 = ["initFor"];
16
16
  const _excluded5 = ["serverThroughput"];
17
17
  const _excluded6 = ["behindTrick"];
18
- const _excluded7 = ["start"];
18
+ const _excluded7 = ["behindTrick"];
19
19
  const _excluded8 = ["start"];
20
+ const _excluded9 = ["start"];
20
21
  /**
21
22
  * The default tuning. Every value is overridable through the `config`
22
23
  * parameters of `initialState` and `createReducer`; these are starting
@@ -482,6 +483,7 @@ function reduceCommand(state, msg, cfg, hooks) {
482
483
  const track = findTrack(state.presentation, msg.trackId);
483
484
  if (track === null) return reject(state, msg.type, `unknown track: ${msg.trackId}`);
484
485
  if (isUndecodable(state, track)) return reject(state, msg.type, `undecodable track: ${msg.trackId}`);
486
+ if (isTrick(track) && state.tracks.trickFailed === true) return reject(state, msg.type, `failed trick track: ${msg.trackId}`);
485
487
  const previous = state.tracks.active.get(track.contentType);
486
488
  const active = new Map(state.tracks.active);
487
489
  active.set(track.contentType, track.id);
@@ -769,6 +771,81 @@ function behindTrick(tracks, track, previous) {
769
771
  return tracks;
770
772
  }
771
773
  /**
774
+ * A failure that would end playback while an I-frame track stands in for
775
+ * the video track ends the I-frame track instead. `state` is the state
776
+ * before the failing message and `failed` what its reduction emitted. The
777
+ * element may be in its error state, which no buffer operation leaves, so
778
+ * the media source is replaced: every buffer goes, the track behind the
779
+ * I-frame track returns, and scheduling starts again at the playhead. The
780
+ * error is reported as it was, except that it is not fatal and names the
781
+ * I-frame track. Null when no track is left to return to: the failure
782
+ * stays fatal.
783
+ */
784
+ function leaveFailedTrick(state, failed, hooks, cfg) {
785
+ const behind = state.tracks.behindTrick;
786
+ const trick = state.tracks.active.get("video");
787
+ const presentation = state.presentation;
788
+ if (behind === void 0 || presentation === null || findTrack(presentation, behind) === null) return null;
789
+ const [stopped, aborts] = abortInflight(state);
790
+ const to = state.playback.currentTime;
791
+ const active = new Map(state.tracks.active).set("video", behind);
792
+ const _state$tracks = state.tracks, { behindTrick: _behind } = _state$tracks, tracks = _objectWithoutProperties(_state$tracks, _excluded7);
793
+ const rebuilt = _objectSpread2(_objectSpread2({}, stopped), {}, {
794
+ lifecycle: { phase: state.lifecycle.phase === "ended" ? "ready" : state.lifecycle.phase },
795
+ buffers: /* @__PURE__ */ new Map(),
796
+ bufferErrors: /* @__PURE__ */ new Map(),
797
+ timeline: _objectSpread2(_objectSpread2({}, state.timeline), {}, { periodOffsets: /* @__PURE__ */ new Map() }),
798
+ scheduling: clearRepeat(withPendingInit(stopped.scheduling, void 0)),
799
+ tracks: _objectSpread2(_objectSpread2({}, tracks), {}, {
800
+ active,
801
+ trickFailed: true
802
+ }),
803
+ quality: _objectSpread2(_objectSpread2({}, bumped(state.quality)), {}, { appendLog: [] }),
804
+ playback: _objectSpread2(_objectSpread2({}, state.playback), {}, {
805
+ currentTime: to,
806
+ seeking: false
807
+ })
808
+ });
809
+ const effects = [...aborts];
810
+ for (const effect of failed) {
811
+ if (effect.kind !== "emit") continue;
812
+ effects.push(effect.event === "error" ? _objectSpread2(_objectSpread2({}, effect), {}, { payload: _objectSpread2(_objectSpread2({}, effect.payload), {}, {
813
+ fatal: false,
814
+ recoverable: true,
815
+ trackId: trick
816
+ }) }) : effect);
817
+ }
818
+ effects.push({ kind: "resetSource" });
819
+ if (!presentation.isLive && presentation.duration !== void 0) effects.push({
820
+ kind: "setDuration",
821
+ seconds: presentation.duration
822
+ });
823
+ else if (state.live !== null) {
824
+ if (presentation.duration === void 0) effects.push({
825
+ kind: "setDuration",
826
+ seconds: Number.POSITIVE_INFINITY
827
+ });
828
+ effects.push({
829
+ kind: "setLiveSeekableRange",
830
+ start: state.live.span.start,
831
+ end: state.live.span.end
832
+ });
833
+ }
834
+ effects.push({
835
+ kind: "seekElement",
836
+ to
837
+ }, {
838
+ kind: "emit",
839
+ event: "tracks:selected",
840
+ payload: {
841
+ contentType: "video",
842
+ trackId: behind
843
+ }
844
+ });
845
+ const [driven, driveEffects] = driveScheduling(rebuilt, hooks, cfg);
846
+ return [driven, [...effects, ...driveEffects]];
847
+ }
848
+ /**
772
849
  * A presentation replaces the one held: a manifest landed, or a playlist
773
850
  * merged into it. Activates default tracks and reports what changed.
774
851
  */
@@ -818,7 +895,7 @@ function loadPresentation(state, merged, undecodableIds = /* @__PURE__ */ new Se
818
895
  if (start !== void 0 && !presentation.isLive) {
819
896
  var _presentation$duratio;
820
897
  const to = Math.max(0, Math.min(start, (_presentation$duratio = presentation.duration) !== null && _presentation$duratio !== void 0 ? _presentation$duratio : start));
821
- const _loaded$playback = loaded.playback, { start: _ } = _loaded$playback, rest = _objectWithoutProperties(_loaded$playback, _excluded7);
898
+ const _loaded$playback = loaded.playback, { start: _ } = _loaded$playback, rest = _objectWithoutProperties(_loaded$playback, _excluded8);
822
899
  manifestEffects.push({
823
900
  kind: "seekElement",
824
901
  to
@@ -1049,7 +1126,7 @@ function reduceFact(state, msg, cfg, hooks) {
1049
1126
  }), effects];
1050
1127
  }
1051
1128
  case "SEGMENT_FAILED": {
1052
- var _msg$status2;
1129
+ var _msg$status3;
1053
1130
  const inflight = new Map(state.scheduling.inflight);
1054
1131
  for (const [token, request] of inflight) if (request.trackId === msg.trackId && request.seq === msg.seq) inflight.delete(token);
1055
1132
  if (msg.preload === true) return [_objectSpread2(_objectSpread2({}, state), {}, { scheduling: _objectSpread2(_objectSpread2({}, state.scheduling), {}, { inflight }) }), []];
@@ -1061,6 +1138,35 @@ function reduceFact(state, msg, cfg, hooks) {
1061
1138
  recoverable: false
1062
1139
  }), _objectSpread2({ status: (_msg$status = msg.status) !== null && _msg$status !== void 0 ? _msg$status : null }, typeof contentType === "string" ? { contentType } : {}));
1063
1140
  }
1141
+ const behind = state.tracks.behindTrick;
1142
+ const failedSite = msg.renditionId === void 0 ? null : findRendition(state.presentation, msg.renditionId);
1143
+ if (behind !== void 0 && failedSite !== null && isTrick(failedSite.track)) {
1144
+ const [left, leftEffects] = reduceCommand(_objectSpread2(_objectSpread2({}, state), {}, { scheduling: _objectSpread2(_objectSpread2({}, state.scheduling), {}, { inflight }) }), {
1145
+ type: "SELECT_TRACK",
1146
+ trackId: behind,
1147
+ apply: "now"
1148
+ }, cfg, hooks);
1149
+ if (left.tracks.active.get("video") === behind) {
1150
+ var _msg$status2;
1151
+ return [_objectSpread2(_objectSpread2({}, left), {}, { tracks: _objectSpread2(_objectSpread2({}, left.tracks), {}, { trickFailed: true }) }), [
1152
+ {
1153
+ kind: "emit",
1154
+ event: "error",
1155
+ payload: {
1156
+ category: msg.error.category,
1157
+ code: msg.error.code,
1158
+ fatal: false,
1159
+ recoverable: true,
1160
+ trackId: failedSite.track.id,
1161
+ seq: msg.seq,
1162
+ status: (_msg$status2 = msg.status) !== null && _msg$status2 !== void 0 ? _msg$status2 : null
1163
+ }
1164
+ },
1165
+ ...leftEffects,
1166
+ tickAfter("kernel:retry", 0)
1167
+ ]];
1168
+ }
1169
+ }
1064
1170
  const failedTrack = findTrack(state.presentation, msg.trackId);
1065
1171
  const isCueTrack = failedTrack !== null && (failedTrack.contentType === "text" || failedTrack.contentType === "metadata");
1066
1172
  let cues = state.cues;
@@ -1088,7 +1194,7 @@ function reduceFact(state, msg, cfg, hooks) {
1088
1194
  recoverable: msg.error.recoverable,
1089
1195
  trackId: msg.trackId,
1090
1196
  seq: msg.seq,
1091
- status: (_msg$status2 = msg.status) !== null && _msg$status2 !== void 0 ? _msg$status2 : null
1197
+ status: (_msg$status3 = msg.status) !== null && _msg$status3 !== void 0 ? _msg$status3 : null
1092
1198
  }
1093
1199
  }];
1094
1200
  if (!isCueTrack) failEffects.push(tickAfter("kernel:retry", cfg.baseRetryDelayMs));
@@ -1151,7 +1257,8 @@ function reduceFact(state, msg, cfg, hooks) {
1151
1257
  bufferErrors.set(msg.sbId, count);
1152
1258
  const scheduling = withPendingInit(state.scheduling, withoutPendingInit(state.scheduling.pendingInit, msg.sbId));
1153
1259
  let buffers = forgetAppended(state.buffers, msg.sbId);
1154
- const fatal = msg.error.fatal || count >= cfg.bufferErrorLimit;
1260
+ const trickAppend = state.tracks.behindTrick !== void 0 && msg.sbId === sbIdFor("video") && msg.error.code === "MEDIA_APPEND_FAILED";
1261
+ const fatal = msg.error.fatal || count >= cfg.bufferErrorLimit || trickAppend;
1155
1262
  const phase = fatal ? "error" : state.lifecycle.phase;
1156
1263
  const neverAppended = msg.error.code === "MEDIA_CONTAINER_INVALID";
1157
1264
  const waiting = buffers.get(msg.sbId);
@@ -1165,7 +1272,7 @@ function reduceFact(state, msg, cfg, hooks) {
1165
1272
  fatal,
1166
1273
  recoverable: msg.error.recoverable,
1167
1274
  sbId: msg.sbId
1168
- }, fatal && !msg.error.fatal ? { consecutiveFailures: count } : {}), msg.error.context !== void 0 ? { context: msg.error.context } : {})
1275
+ }, fatal && !msg.error.fatal && !trickAppend ? { consecutiveFailures: count } : {}), msg.error.context !== void 0 ? { context: msg.error.context } : {})
1169
1276
  }];
1170
1277
  if (neverAppended && !fatal) effects.push(tickAfter("kernel:retry", cfg.baseRetryDelayMs));
1171
1278
  let inflight = state.scheduling.inflight;
@@ -1274,7 +1381,7 @@ function reduceFact(state, msg, cfg, hooks) {
1274
1381
  const start = state.playback.start;
1275
1382
  if (firstWindow && start !== void 0) {
1276
1383
  const to = start >= msg.start && start <= msg.edge ? start : edgeStart(msg.start, msg.edge);
1277
- const _withLive$playback = withLive.playback, { start: _ } = _withLive$playback, rest = _objectWithoutProperties(_withLive$playback, _excluded8);
1384
+ const _withLive$playback = withLive.playback, { start: _ } = _withLive$playback, rest = _objectWithoutProperties(_withLive$playback, _excluded9);
1278
1385
  const [scheduled, effects] = driveScheduling(_objectSpread2(_objectSpread2({}, withLive), {}, { playback: _objectSpread2(_objectSpread2({}, rest), {}, { currentTime: to }) }), hooks, cfg);
1279
1386
  return [scheduled, [
1280
1387
  ...spanEffects,
@@ -1561,6 +1668,10 @@ function createReducer(slices, config, shared = {}) {
1561
1668
  return (state, msg) => {
1562
1669
  const manifestRequest = !isCommand(msg) && msg.type === "SEGMENT_LOADED" ? manifestRequestFor(state, msg) : null;
1563
1670
  let [next, effects] = isCommand(msg) ? reduceCommand(state, msg, cfg, hooks) : reduceFact(state, msg, cfg, hooks);
1671
+ if (next.lifecycle.phase === "error" && state.lifecycle.phase !== "error") {
1672
+ const left = leaveFailedTrick(state, effects, hooks, cfg);
1673
+ if (left !== null) [next, effects] = left;
1674
+ }
1564
1675
  if (isCommand(msg) && effects.some((effect) => effect.kind === "emit" && effect.event === "command:rejected")) return [next, effects];
1565
1676
  const merged = msg.type !== "PLAYLIST_REFRESHED" || next.presentation !== state.presentation;
1566
1677
  if (!isCommand(msg) && DRIVING_FACTS.has(msg.type) && merged) {
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
2
2
  // src/kernel/refresh.ts
3
3
  /** The presentation with the refresh merged, or null when it names no rendition the presentation holds. */
4
4
  function applyRefresh(presentation, refresh) {
@@ -1,8 +1,8 @@
1
1
  import { findRendition, findTrackSite } from "./presentation.js";
2
2
  import { bufferedEndFrom } from "./scheduler.js";
3
3
  import { segmentAtTime } from "./timeline.js";
4
- import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectWithoutProperties.js";
5
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
4
+ import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectWithoutProperties.js";
5
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
6
6
  // src/kernel/rendition-select.ts
7
7
  const _excluded = [
8
8
  "maxHeight",
@@ -1,5 +1,5 @@
1
1
  import { buildEpochs, epochForSeq, epochKey, isIndexed, segmentAtTime, timestampOffsetFor } from "./timeline.js";
2
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
2
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
3
3
  // src/kernel/scheduler.ts
4
4
  const DEFAULT_GAP_TOLERANCE = .25;
5
5
  /**
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
2
2
  // src/kernel/timeline.ts
3
3
  function isIndexed(addressing) {
4
4
  return !Array.isArray(addressing) && addressing.kind === "indexed";
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
2
2
  function isBytes(value) {
3
3
  return value instanceof ArrayBuffer || ArrayBuffer.isView(value);
4
4
  }
@@ -1,5 +1,5 @@
1
- import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
2
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
1
+ import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/asyncToGenerator.js";
2
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectSpread2.js";
3
3
  // src/kernel/transport.ts
4
4
  const DEFAULT_RETRY_POLICY = {
5
5
  maxAttempts: 3,
@@ -1,6 +1,6 @@
1
1
  import { mattebox } from "../index.js";
2
- import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectWithoutProperties.js";
3
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
2
+ import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.160.0/helpers/esm/objectWithoutProperties.js";
3
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.160.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`. */
@@ -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.159.0/helpers/esm/objectSpread2.js";
9
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.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
@@ -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.159.0/helpers/esm/objectSpread2.js";
7
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.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
@@ -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.159.0/helpers/esm/asyncToGenerator.js";
3
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.160.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.159.0/helpers/esm/objectSpread2.js";
2
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.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.159.0/helpers/esm/objectSpread2.js";
4
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.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
@@ -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.159.0/helpers/esm/objectSpread2.js";
7
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.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.159.0/helpers/esm/objectSpread2.js";
6
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.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
@@ -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.159.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.160.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