mattebox 0.8.2 → 0.9.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 (90) hide show
  1. package/dist/cdn/mattebox.dash-drm.min.js +3 -3
  2. package/dist/cdn/mattebox.dash.min.js +3 -3
  3. package/dist/cdn/mattebox.dual-drm.min.js +3 -3
  4. package/dist/cdn/mattebox.dual-ts-drm.min.js +3 -3
  5. package/dist/cdn/mattebox.dual-ts.min.js +3 -3
  6. package/dist/cdn/mattebox.dual.min.js +3 -3
  7. package/dist/cdn/mattebox.hls-drm.min.js +3 -3
  8. package/dist/cdn/mattebox.hls-ts-drm.min.js +3 -3
  9. package/dist/cdn/mattebox.hls-ts.min.js +3 -3
  10. package/dist/cdn/mattebox.hls.min.js +3 -3
  11. package/dist/cdn/mattebox.kernel.min.js +1 -1
  12. package/dist/cdn/mattebox.min.js +2 -2
  13. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/asyncToGenerator.js +1 -1
  14. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.js +1 -1
  15. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/objectSpread2.js +1 -1
  16. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/objectWithoutProperties.js +1 -1
  17. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
  18. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.js +1 -1
  19. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.js +1 -1
  20. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.js +1 -1
  21. package/dist/es2015/containers/id3.js +1 -1
  22. package/dist/es2015/containers/ts-transmux/h264.js +1 -1
  23. package/dist/es2015/containers/ts-transmux/index.js +1 -1
  24. package/dist/es2015/containers/webvtt.js +1 -1
  25. package/dist/es2015/index.js +4 -3
  26. package/dist/es2015/kernel/append-queue.js +1 -1
  27. package/dist/es2015/kernel/characteristics.js +27 -0
  28. package/dist/es2015/kernel/context.js +3 -0
  29. package/dist/es2015/kernel/mse.js +1 -1
  30. package/dist/es2015/kernel/prepare.js +2 -2
  31. package/dist/es2015/kernel/reducer.js +2 -2
  32. package/dist/es2015/kernel/refresh.js +1 -1
  33. package/dist/es2015/kernel/rendition-select.js +1 -1
  34. package/dist/es2015/kernel/scheduler.js +1 -1
  35. package/dist/es2015/kernel/trace.js +1 -1
  36. package/dist/es2015/kernel/transport.js +2 -2
  37. package/dist/es2015/presets/define.js +2 -2
  38. package/dist/es2015/presets/tiers.js +2 -0
  39. package/dist/es2015/protocols/dash-cmaf/index.js +1 -1
  40. package/dist/es2015/protocols/dash-cmaf/parse.js +50 -26
  41. package/dist/es2015/protocols/dash-live/index.js +1 -1
  42. package/dist/es2015/protocols/hls-cmaf/index.js +1 -1
  43. package/dist/es2015/protocols/hls-cmaf/parse.js +5 -4
  44. package/dist/es2015/protocols/hls-cmaf/unavailable.js +1 -1
  45. package/dist/es2015/protocols/hls-live/index.js +1 -1
  46. package/dist/es2015/stages/abr/index.js +1 -1
  47. package/dist/es2015/stages/abr-persist/index.js +1 -1
  48. package/dist/es2015/stages/aes-128/index.js +1 -1
  49. package/dist/es2015/stages/chapters/index.js +2 -2
  50. package/dist/es2015/stages/chapters/parse.js +2 -2
  51. package/dist/es2015/stages/content-steering/index.js +1 -1
  52. package/dist/es2015/stages/eme-core/index.js +78 -9
  53. package/dist/es2015/stages/eme-fairplay/index.js +1 -1
  54. package/dist/es2015/stages/forced-subtitles/index.js +82 -0
  55. package/dist/es2015/stages/recovery/index.js +1 -1
  56. package/dist/es2015/stages/text-cea608/decode.js +1 -1
  57. package/dist/es2015/stages/thumbnails/index.js +1 -1
  58. package/dist/es2015/stages/trick-play/index.js +1 -1
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +2 -0
  62. package/dist/index.js.map +1 -1
  63. package/dist/kernel/characteristics.d.ts +20 -0
  64. package/dist/kernel/characteristics.d.ts.map +1 -0
  65. package/dist/kernel/characteristics.js +25 -0
  66. package/dist/kernel/characteristics.js.map +1 -0
  67. package/dist/kernel/context.d.ts.map +1 -1
  68. package/dist/kernel/context.js +3 -0
  69. package/dist/kernel/context.js.map +1 -1
  70. package/dist/presets/tiers.d.ts.map +1 -1
  71. package/dist/presets/tiers.js +2 -0
  72. package/dist/presets/tiers.js.map +1 -1
  73. package/dist/protocols/dash-cmaf/parse.d.ts.map +1 -1
  74. package/dist/protocols/dash-cmaf/parse.js +35 -4
  75. package/dist/protocols/dash-cmaf/parse.js.map +1 -1
  76. package/dist/protocols/hls-cmaf/parse.d.ts.map +1 -1
  77. package/dist/protocols/hls-cmaf/parse.js +7 -0
  78. package/dist/protocols/hls-cmaf/parse.js.map +1 -1
  79. package/dist/stages/eme-core/index.d.ts.map +1 -1
  80. package/dist/stages/eme-core/index.js +82 -8
  81. package/dist/stages/eme-core/index.js.map +1 -1
  82. package/dist/stages/forced-subtitles/index.d.ts +40 -0
  83. package/dist/stages/forced-subtitles/index.d.ts.map +1 -0
  84. package/dist/stages/forced-subtitles/index.js +80 -0
  85. package/dist/stages/forced-subtitles/index.js.map +1 -0
  86. package/dist/types/ir.d.ts +14 -0
  87. package/dist/types/ir.d.ts.map +1 -1
  88. package/dist/types/stage.d.ts +2 -0
  89. package/dist/types/stage.d.ts.map +1 -1
  90. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.150.0/helpers/esm/asyncToGenerator.js
1
+ //#region \0@oxc-project+runtime@0.151.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
- //#region \0@oxc-project+runtime@0.150.0/helpers/esm/defineProperty.js
2
+ //#region \0@oxc-project+runtime@0.151.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
- //#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectSpread2.js
2
+ //#region \0@oxc-project+runtime@0.151.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
- //#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutProperties.js
2
+ //#region \0@oxc-project+runtime@0.151.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
- //#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutPropertiesLoose.js
1
+ //#region \0@oxc-project+runtime@0.151.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
- //#region \0@oxc-project+runtime@0.150.0/helpers/esm/toPrimitive.js
2
+ //#region \0@oxc-project+runtime@0.151.0/helpers/esm/toPrimitive.js
3
3
  function toPrimitive(t, r) {
4
4
  if ("object" != _typeof(t) || !t) return t;
5
5
  var e = t[Symbol.toPrimitive];
@@ -1,6 +1,6 @@
1
1
  import _typeof from "./typeof.js";
2
2
  import toPrimitive from "./toPrimitive.js";
3
- //#region \0@oxc-project+runtime@0.150.0/helpers/esm/toPropertyKey.js
3
+ //#region \0@oxc-project+runtime@0.151.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
- //#region \0@oxc-project+runtime@0.150.0/helpers/esm/typeof.js
1
+ //#region \0@oxc-project+runtime@0.151.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,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { fourcc } from "./mp4-box/index.js";
3
3
  //#region src/containers/id3.ts
4
4
  const HEADER_SIZE = 10;
@@ -1,4 +1,4 @@
1
- import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/defineProperty.js";
1
+ import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js";
2
2
  import { toRbsp } from "../sei.js";
3
3
  //#region src/containers/ts-transmux/h264.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/asyncToGenerator.js";
1
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/asyncToGenerator.js";
2
2
  import { looksLikeTransportStream } from "./demux.js";
3
3
  import { captionsWanted, deliverCaptions } from "../captions.js";
4
4
  import { createTransmuxRunner } from "./runner.js";
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  //#region src/containers/webvtt.ts
3
3
  /** `HH:MM:SS.mmm` or `MM:SS.mmm` to seconds, or null. */
4
4
  function parseTimestamp(text) {
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { exportTrace, replay } from "./kernel/trace.js";
3
3
  import { createBus } from "./kernel/bus.js";
4
4
  import { createEffectRunner } from "./kernel/effects.js";
@@ -10,10 +10,11 @@ import { createReducer, initialState, resolveConfig } from "./kernel/reducer.js"
10
10
  import { createLifecycle } from "./kernel/lifecycle.js";
11
11
  import { compose } from "./kernel/loader.js";
12
12
  import { createMseController, decodable } from "./kernel/mse.js";
13
- import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/asyncToGenerator.js";
13
+ import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/asyncToGenerator.js";
14
14
  import { createSegmentPreparer } from "./kernel/prepare.js";
15
15
  import { createTrackRegistry } from "./kernel/track-registry.js";
16
16
  import { createTransport } from "./kernel/transport.js";
17
+ import { isAudioDescription, isEnhancedSpeech, isOriginal, isSdh } from "./kernel/characteristics.js";
17
18
  //#region src/index.ts
18
19
  /**
19
20
  * Mattebox: a modular adaptive-streaming engine for HLS and DASH.
@@ -359,4 +360,4 @@ mattebox.from = (el) => {
359
360
  return (_registry$get = registry.get(el)) !== null && _registry$get !== void 0 ? _registry$get : null;
360
361
  };
361
362
  //#endregion
362
- export { canSwitchTo, createReducer, exportTrace, initialState, mattebox, replay, resolveConfig };
363
+ export { canSwitchTo, createReducer, exportTrace, initialState, isAudioDescription, isEnhancedSpeech, isOriginal, isSdh, mattebox, replay, resolveConfig };
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  //#region src/kernel/append-queue.ts
3
3
  function isQuotaError(err) {
4
4
  return err instanceof DOMException && err.name === "QuotaExceededError";
@@ -0,0 +1,27 @@
1
+ //#region src/kernel/characteristics.ts
2
+ function has(track, tag) {
3
+ var _track$characteristic;
4
+ return ((_track$characteristic = track.characteristics) === null || _track$characteristic === void 0 ? void 0 : _track$characteristic.includes(tag)) === true;
5
+ }
6
+ /** Audio that describes the picture. */
7
+ function isAudioDescription(track) {
8
+ return has(track, "public.accessibility.describes-video");
9
+ }
10
+ /** Audio processed so speech is easier to follow. */
11
+ function isEnhancedSpeech(track) {
12
+ return has(track, "public.accessibility.enhances-speech-intelligibility");
13
+ }
14
+ /**
15
+ * Subtitles for the deaf and hard of hearing: tagged for both dialogue and
16
+ * sounds, as Apple's authoring rules require, or carrying the role caption.
17
+ */
18
+ function isSdh(track) {
19
+ var _track$roles;
20
+ return has(track, "public.accessibility.transcribes-spoken-dialog") && has(track, "public.accessibility.describes-music-and-sound") || ((_track$roles = track.roles) === null || _track$roles === void 0 ? void 0 : _track$roles.includes("caption")) === true;
21
+ }
22
+ /** The language the content was made in, not a translation. */
23
+ function isOriginal(track) {
24
+ return has(track, "public.original-content");
25
+ }
26
+ //#endregion
27
+ export { isAudioDescription, isEnhancedSpeech, isOriginal, isSdh };
@@ -20,6 +20,9 @@ function createStageContext(deps) {
20
20
  deps.bus.registerSink(contentType, factory);
21
21
  sinkTypes.push(contentType);
22
22
  },
23
+ capabilities() {
24
+ return deps.bus.capabilities();
25
+ },
23
26
  registerParser(mimeType, parse) {
24
27
  deps.bus.registerParser(mimeType, parse);
25
28
  parserTypes.push(mimeType);
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { createAppendQueue } from "./append-queue.js";
3
3
  import { createEvictor } from "./evictor.js";
4
4
  //#region src/kernel/mse.ts
@@ -1,5 +1,5 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
2
- import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/asyncToGenerator.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
+ import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/asyncToGenerator.js";
3
3
  //#region src/kernel/prepare.ts
4
4
  /**
5
5
  * The boundary meta a transform and the probe receive. The content type
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { tickAfter } from "./effects.js";
3
3
  import { normalizeMimeType, typeString } from "./mime.js";
4
4
  import { findRendition, findTrackSite, isTrick } from "./presentation.js";
@@ -7,7 +7,7 @@ import { reconciledOffset, segmentAtTime } from "./timeline.js";
7
7
  import { bufferedEndFrom, reachesEnd, schedule } from "./scheduler.js";
8
8
  import { availableGroups, canSwitchTo, codecFamily, createArbiter, planPinApply, withDeadGroups } from "./rendition-select.js";
9
9
  import { sbIdFor } from "./sinks/mse-sink.js";
10
- import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectWithoutProperties.js";
10
+ import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectWithoutProperties.js";
11
11
  //#region src/kernel/reducer.ts
12
12
  const _excluded = ["pendingInit"];
13
13
  const _excluded2 = ["repeat"];
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  //#region 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,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { findRendition } from "./presentation.js";
3
3
  import { segmentAtTime } from "./timeline.js";
4
4
  import { bufferedEndFrom } from "./scheduler.js";
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { buildEpochs, epochForSeq, epochKey, segmentAtTime, timestampOffsetFor } from "./timeline.js";
3
3
  //#region src/kernel/scheduler.ts
4
4
  const DEFAULT_GAP_TOLERANCE = .25;
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.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 _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
2
- import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/asyncToGenerator.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
+ import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/asyncToGenerator.js";
3
3
  //#region src/kernel/transport.ts
4
4
  const DEFAULT_RETRY_POLICY = {
5
5
  maxAttempts: 3,
@@ -1,5 +1,5 @@
1
- import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
2
- import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectWithoutProperties.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
+ import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectWithoutProperties.js";
3
3
  import { mattebox } from "../index.js";
4
4
  //#region src/presets/define.ts
5
5
  const _excluded = ["stages", "without"];
@@ -6,6 +6,7 @@ import pdt from "../stages/pdt/index.js";
6
6
  import nalScan from "../stages/nal-scan/index.js";
7
7
  import mp4Box from "../stages/mp4-box/index.js";
8
8
  import metaId3 from "../stages/meta-id3/index.js";
9
+ import forcedSubtitles from "../stages/forced-subtitles/index.js";
9
10
  import emeFairplay from "../stages/eme-fairplay/index.js";
10
11
  import emeCore from "../stages/eme-core/index.js";
11
12
  import emeCenc from "../stages/eme-cenc/index.js";
@@ -69,6 +70,7 @@ function base() {
69
70
  altAudio(),
70
71
  textWebvtt(),
71
72
  textWebvttSegmented(),
73
+ forcedSubtitles(),
72
74
  cmafTiming(),
73
75
  pdt(),
74
76
  mp4Box(),
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { scheduled } from "../../kernel/effects.js";
3
3
  import { normalizeMimeType } from "../../kernel/mime.js";
4
4
  import { findRendition } from "../../kernel/presentation.js";
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { findBox, parseSidx } from "../../containers/mp4-box/index.js";
3
3
  import { resolveUrl } from "../../kernel/url.js";
4
4
  import { base64ToBytes } from "../../kernel/base64.js";
@@ -117,6 +117,26 @@ function parseProtection(elements) {
117
117
  return schemes;
118
118
  }
119
119
  /**
120
+ * DVB-DASH (ETSI TS 103 285, A168 Table 5) audio purposes, as the HLS
121
+ * characteristic tags that mean the same, so players read one vocabulary.
122
+ */
123
+ const AUDIO_PURPOSE_SCHEME = "urn:tva:metadata:cs:AudioPurposeCS:2007";
124
+ const AUDIO_PURPOSES = {
125
+ "1": "public.accessibility.describes-video",
126
+ "2": "public.accessibility.enhances-speech-intelligibility"
127
+ };
128
+ /** The characteristic tags an audio AdaptationSet's Accessibility descriptors declare. */
129
+ function audioCharacteristics(adaptationSet) {
130
+ const tags = [];
131
+ for (const descriptor of children(adaptationSet, "Accessibility")) {
132
+ var _attr5;
133
+ if (attr(descriptor, "schemeIdUri") !== AUDIO_PURPOSE_SCHEME) continue;
134
+ const tag = AUDIO_PURPOSES[(_attr5 = attr(descriptor, "value")) !== null && _attr5 !== void 0 ? _attr5 : ""];
135
+ if (tag !== void 0 && !tags.includes(tag)) tags.push(tag);
136
+ }
137
+ return tags;
138
+ }
139
+ /**
120
140
  * A trick-mode AdaptationSet: the DASH-IF trickmode EssentialProperty, or a
121
141
  * representation declaring a playout rate other than 1. Both mark an
122
142
  * I-frame-only set meant for fast forward and previews, never for normal
@@ -124,8 +144,8 @@ function parseProtection(elements) {
124
144
  */
125
145
  function isTrickMode(adaptationSet) {
126
146
  for (const property of children(adaptationSet, "EssentialProperty")) {
127
- var _attr5;
128
- if (((_attr5 = attr(property, "schemeIdUri")) !== null && _attr5 !== void 0 ? _attr5 : "").includes("trickmode")) return true;
147
+ var _attr6;
148
+ if (((_attr6 = attr(property, "schemeIdUri")) !== null && _attr6 !== void 0 ? _attr6 : "").includes("trickmode")) return true;
129
149
  }
130
150
  if (numberAttr(adaptationSet, "maxPlayoutRate") !== null) return true;
131
151
  for (const representation of children(adaptationSet, "Representation")) {
@@ -144,8 +164,8 @@ function tileGridOf(representation, adaptationSet, width, height) {
144
164
  if (width === null || height === null) return null;
145
165
  const properties = [...children(representation, "EssentialProperty"), ...children(adaptationSet, "EssentialProperty")];
146
166
  for (const property of properties) {
147
- var _attr6;
148
- if (!((_attr6 = attr(property, "schemeIdUri")) !== null && _attr6 !== void 0 ? _attr6 : "").includes("thumbnail_tile")) continue;
167
+ var _attr7;
168
+ if (!((_attr7 = attr(property, "schemeIdUri")) !== null && _attr7 !== void 0 ? _attr7 : "").includes("thumbnail_tile")) continue;
149
169
  const grid = dimensions(attr(property, "value"));
150
170
  if (grid === null) continue;
151
171
  const [columns, rows] = grid;
@@ -170,12 +190,12 @@ function mergeTemplates(levels) {
170
190
  let timelineElement = null;
171
191
  let found = false;
172
192
  for (const level of levels) {
173
- var _attr7, _attr8, _numberAttr, _numberAttr2, _numberAttr3, _numberAttr4, _children$2;
193
+ var _attr8, _attr9, _numberAttr, _numberAttr2, _numberAttr3, _numberAttr4, _children$2;
174
194
  const template = children(level, "SegmentTemplate")[0];
175
195
  if (template === void 0) continue;
176
196
  found = true;
177
- media = (_attr7 = attr(template, "media")) !== null && _attr7 !== void 0 ? _attr7 : media;
178
- initialization = (_attr8 = attr(template, "initialization")) !== null && _attr8 !== void 0 ? _attr8 : initialization;
197
+ media = (_attr8 = attr(template, "media")) !== null && _attr8 !== void 0 ? _attr8 : media;
198
+ initialization = (_attr9 = attr(template, "initialization")) !== null && _attr9 !== void 0 ? _attr9 : initialization;
179
199
  timescale = (_numberAttr = numberAttr(template, "timescale")) !== null && _numberAttr !== void 0 ? _numberAttr : timescale;
180
200
  startNumber = (_numberAttr2 = numberAttr(template, "startNumber")) !== null && _numberAttr2 !== void 0 ? _numberAttr2 : startNumber;
181
201
  duration = (_numberAttr3 = numberAttr(template, "duration")) !== null && _numberAttr3 !== void 0 ? _numberAttr3 : duration;
@@ -242,7 +262,7 @@ function contentTypeOf(adaptationSet, mimeType) {
242
262
  }
243
263
  /** parse an MPD document into a Presentation. Never throws. */
244
264
  function parse(text, baseUrl) {
245
- var _parseDuration, _parseDuration2, _attr16;
265
+ var _parseDuration, _parseDuration2, _attr17;
246
266
  let doc;
247
267
  try {
248
268
  doc = new DOMParser().parseFromString(text, "text/xml");
@@ -262,15 +282,15 @@ function parse(text, baseUrl) {
262
282
  const mpdBase = applyBaseUrl(mpd, baseUrl);
263
283
  let live;
264
284
  if (isLive) {
265
- var _attr9, _attr10, _attr11;
266
- const availabilityStart = Date.parse((_attr9 = attr(mpd, "availabilityStartTime")) !== null && _attr9 !== void 0 ? _attr9 : "");
285
+ var _attr10, _attr11, _attr12;
286
+ const availabilityStart = Date.parse((_attr10 = attr(mpd, "availabilityStartTime")) !== null && _attr10 !== void 0 ? _attr10 : "");
267
287
  const updatePeriod = parseDuration(attr(mpd, "minimumUpdatePeriod"));
268
288
  const timeShiftDepth = parseDuration(attr(mpd, "timeShiftBufferDepth"));
269
289
  const holdBack = parseDuration(attr(mpd, "suggestedPresentationDelay"));
270
290
  const timing = children(mpd, "UTCTiming")[0];
271
291
  live = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, Number.isFinite(availabilityStart) ? { availabilityStart: availabilityStart / 1e3 } : {}), updatePeriod !== null ? { updatePeriod } : {}), timeShiftDepth !== null ? { timeShiftDepth } : {}), holdBack !== null ? { holdBack } : {}), timing !== void 0 ? { timeServer: {
272
- scheme: (_attr10 = attr(timing, "schemeIdUri")) !== null && _attr10 !== void 0 ? _attr10 : "",
273
- value: (_attr11 = attr(timing, "value")) !== null && _attr11 !== void 0 ? _attr11 : ""
292
+ scheme: (_attr11 = attr(timing, "schemeIdUri")) !== null && _attr11 !== void 0 ? _attr11 : "",
293
+ value: (_attr12 = attr(timing, "value")) !== null && _attr12 !== void 0 ? _attr12 : ""
274
294
  } } : {});
275
295
  }
276
296
  let steering;
@@ -306,7 +326,7 @@ function parse(text, baseUrl) {
306
326
  const tracks = [];
307
327
  const adaptationSets = children(periodElement, "AdaptationSet");
308
328
  for (let asIndex = 0; asIndex < adaptationSets.length; asIndex += 1) {
309
- var _children$0$getAttrib, _children$3, _trackMime2;
329
+ var _roles$, _trackMime2;
310
330
  const adaptationSet = adaptationSets[asIndex];
311
331
  const trick = isTrickMode(adaptationSet);
312
332
  const asPlayoutRate = numberAttr(adaptationSet, "maxPlayoutRate");
@@ -314,21 +334,22 @@ function parse(text, baseUrl) {
314
334
  const asMime = attr(adaptationSet, "mimeType");
315
335
  const asCodecs = attr(adaptationSet, "codecs");
316
336
  const lang = attr(adaptationSet, "lang");
317
- const role = trick ? "trick" : (_children$0$getAttrib = (_children$3 = children(adaptationSet, "Role")[0]) === null || _children$3 === void 0 ? void 0 : _children$3.getAttribute("value")) !== null && _children$0$getAttrib !== void 0 ? _children$0$getAttrib : null;
337
+ const roles = children(adaptationSet, "Role").map((element) => attr(element, "value")).filter((value) => value !== null);
338
+ const role = trick ? "trick" : (_roles$ = roles[0]) !== null && _roles$ !== void 0 ? _roles$ : null;
318
339
  const protectionSchemes = parseProtection(children(adaptationSet, "ContentProtection"));
319
340
  const renditions = [];
320
341
  let trackMime = null;
321
342
  for (const representation of children(adaptationSet, "Representation")) {
322
- var _ref, _attr12, _trackMime, _parseFrameRate2, _numberAttr8, _attr15;
343
+ var _ref, _attr13, _trackMime, _parseFrameRate2, _numberAttr8, _attr16;
323
344
  const id = attr(representation, "id");
324
345
  const bandwidth = numberAttr(representation, "bandwidth");
325
346
  if (id === null || bandwidth === null) continue;
326
347
  const repBase = applyBaseUrl(representation, asBase);
327
- const mimeType = (_ref = (_attr12 = attr(representation, "mimeType")) !== null && _attr12 !== void 0 ? _attr12 : asMime) !== null && _ref !== void 0 ? _ref : "video/mp4";
348
+ const mimeType = (_ref = (_attr13 = attr(representation, "mimeType")) !== null && _attr13 !== void 0 ? _attr13 : asMime) !== null && _ref !== void 0 ? _ref : "video/mp4";
328
349
  trackMime = (_trackMime = trackMime) !== null && _trackMime !== void 0 ? _trackMime : mimeType;
329
350
  const segmentBase = children(representation, "SegmentBase")[0];
330
351
  if (segmentBase !== void 0) {
331
- var _numberAttr7, _parseFrameRate, _attr13;
352
+ var _numberAttr7, _parseFrameRate, _attr14;
332
353
  const indexRange = parseByteRange(attr(segmentBase, "indexRange"));
333
354
  if (indexRange === null) continue;
334
355
  const baseTimescale = (_numberAttr7 = numberAttr(segmentBase, "timescale")) !== null && _numberAttr7 !== void 0 ? _numberAttr7 : 1;
@@ -351,7 +372,7 @@ function parse(text, baseUrl) {
351
372
  renditions.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
352
373
  id,
353
374
  bitrate: bandwidth,
354
- codecs: (_attr13 = attr(representation, "codecs")) !== null && _attr13 !== void 0 ? _attr13 : asCodecs,
375
+ codecs: (_attr14 = attr(representation, "codecs")) !== null && _attr14 !== void 0 ? _attr14 : asCodecs,
355
376
  mimeType,
356
377
  segments: sidxSegments
357
378
  }, sidxInit !== null ? { init: sidxInit } : {}), w !== null ? { width: w } : {}), h !== null ? { height: h } : {}), fr !== null ? { frameRate: fr } : {}));
@@ -364,11 +385,11 @@ function parse(text, baseUrl) {
364
385
  ]);
365
386
  if (template === null || template.media === null) {
366
387
  if (contentTypeOf(adaptationSet, mimeType) === "text" && periodDuration !== null) {
367
- var _attr14;
388
+ var _attr15;
368
389
  renditions.push({
369
390
  id,
370
391
  bitrate: bandwidth,
371
- codecs: (_attr14 = attr(representation, "codecs")) !== null && _attr14 !== void 0 ? _attr14 : asCodecs,
392
+ codecs: (_attr15 = attr(representation, "codecs")) !== null && _attr15 !== void 0 ? _attr15 : asCodecs,
372
393
  mimeType,
373
394
  segments: [{
374
395
  seq: 0,
@@ -411,20 +432,23 @@ function parse(text, baseUrl) {
411
432
  renditions.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
412
433
  id,
413
434
  bitrate: bandwidth,
414
- codecs: (_attr15 = attr(representation, "codecs")) !== null && _attr15 !== void 0 ? _attr15 : asCodecs,
435
+ codecs: (_attr16 = attr(representation, "codecs")) !== null && _attr16 !== void 0 ? _attr16 : asCodecs,
415
436
  mimeType,
416
437
  segments
417
438
  }, init !== null ? { init } : {}), width !== null ? { width } : {}), height !== null ? { height } : {}), frameRate !== null ? { frameRate } : {}), tiles !== null ? { tiles } : {}), playoutRate !== null ? { maxPlayoutRate: playoutRate } : {}));
418
439
  }
419
440
  if (renditions.length === 0) continue;
420
441
  const mimeType = (_trackMime2 = trackMime) !== null && _trackMime2 !== void 0 ? _trackMime2 : "video/mp4";
421
- tracks.push(_objectSpread2(_objectSpread2({
442
+ const contentType = contentTypeOf(adaptationSet, mimeType);
443
+ const characteristics = contentType === "audio" ? audioCharacteristics(adaptationSet) : [];
444
+ const forced = contentType === "text" && (roles.includes("forced-subtitle") || roles.includes("forced_subtitle"));
445
+ tracks.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
422
446
  id: attr(adaptationSet, "id") !== null ? `as-${attr(adaptationSet, "id")}` : `as-i${asIndex}`,
423
- contentType: contentTypeOf(adaptationSet, mimeType),
447
+ contentType,
424
448
  mimeType,
425
449
  protection: protectionSchemes.length > 0 ? { schemes: protectionSchemes } : null,
426
450
  renditions
427
- }, lang !== null ? { lang } : {}), role !== null ? { role } : {}));
451
+ }, lang !== null ? { lang } : {}), role !== null ? { role } : {}), roles.length > 0 ? { roles } : {}), characteristics.length > 0 ? { characteristics } : {}), forced ? { forced: true } : {}));
428
452
  }
429
453
  if (tracks.length === 0) return {
430
454
  presentation: null,
@@ -442,7 +466,7 @@ function parse(text, baseUrl) {
442
466
  isLive
443
467
  }, mpdDuration !== null ? { duration: mpdDuration } : {}), {}, {
444
468
  periods: [_objectSpread2(_objectSpread2({
445
- id: (_attr16 = attr(periodElement, "id")) !== null && _attr16 !== void 0 ? _attr16 : "p0",
469
+ id: (_attr17 = attr(periodElement, "id")) !== null && _attr17 !== void 0 ? _attr17 : "p0",
446
470
  start: periodStart
447
471
  }, periodDuration !== null ? { duration: periodDuration } : {}), {}, { tracks })],
448
472
  couplings: []
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { scheduled, tickAfter } from "../../kernel/effects.js";
3
3
  import { registerLiveNamespace } from "../live-shared.js";
4
4
  import { parse } from "../dash-cmaf/parse.js";
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { scheduled } from "../../kernel/effects.js";
3
3
  import { normalizeMimeType } from "../../kernel/mime.js";
4
4
  import { activeRenditions } from "../../kernel/rendition-select.js";
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { resolveUrl } from "../../kernel/url.js";
3
3
  import { manifestError } from "../adapter-shared.js";
4
4
  import { dimensions } from "../dimensions.js";
@@ -463,17 +463,18 @@ function parse(text, baseUrl) {
463
463
  });
464
464
  }
465
465
  for (const entry of mediaEntries) {
466
- var _variants$find;
466
+ var _variants$find, _entry$attributes$CHA;
467
467
  const contentType = mediaContentType(entry.type);
468
468
  if (contentType === null || entry.uri === null) continue;
469
469
  const { audio } = splitCodecs((_variants$find = variants.find((v) => v.attributes.AUDIO === entry.groupId)) === null || _variants$find === void 0 ? void 0 : _variants$find.attributes.CODECS);
470
470
  const mimeType = contentType === "audio" ? "audio/mp4" : "text/vtt";
471
- tracks.push(_objectSpread2(_objectSpread2(_objectSpread2({
471
+ const characteristics = ((_entry$attributes$CHA = entry.attributes.CHARACTERISTICS) !== null && _entry$attributes$CHA !== void 0 ? _entry$attributes$CHA : "").split(",").map((tag) => tag.trim()).filter((tag) => tag !== "");
472
+ tracks.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
472
473
  id: `${entry.groupId}:${entry.name}`,
473
474
  contentType,
474
475
  mimeType,
475
476
  protection: sessionProtection
476
- }, entry.attributes.LANGUAGE !== void 0 ? { lang: entry.attributes.LANGUAGE } : {}), entry.attributes.DEFAULT === "YES" ? { role: "main" } : { role: "alternate" }), {}, { renditions: [{
477
+ }, entry.attributes.LANGUAGE !== void 0 ? { lang: entry.attributes.LANGUAGE } : {}), entry.attributes.DEFAULT === "YES" ? { role: "main" } : { role: "alternate" }), characteristics.length > 0 ? { characteristics } : {}), contentType === "text" && entry.attributes.FORCED === "YES" ? { forced: true } : {}), {}, { renditions: [{
477
478
  id: `${entry.groupId}:${entry.name}`,
478
479
  bitrate: 0,
479
480
  codecs: contentType === "audio" ? audio : null,
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { isTrick } from "../../kernel/presentation.js";
3
3
  import { withDeadGroups } from "../../kernel/rendition-select.js";
4
4
  //#region src/protocols/hls-cmaf/unavailable.ts
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { scheduled, tickAfter } from "../../kernel/effects.js";
3
3
  import { findRendition } from "../../kernel/presentation.js";
4
4
  import { activeRenditions } from "../../kernel/rendition-select.js";
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { scheduled } from "../../kernel/effects.js";
3
3
  import { findRendition, isTrick } from "../../kernel/presentation.js";
4
4
  import { canSwitchTo } from "../../kernel/rendition-select.js";
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { scheduled } from "../../kernel/effects.js";
3
3
  //#region src/stages/abr-persist/index.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { findRendition } from "../../kernel/presentation.js";
2
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/asyncToGenerator.js";
2
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/asyncToGenerator.js";
3
3
  //#region 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,6 +1,6 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { findTrackSite } from "../../kernel/presentation.js";
3
- import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/asyncToGenerator.js";
3
+ import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/asyncToGenerator.js";
4
4
  import { chaptersFromInput, parseAppleChapters, parseChapterTrack } from "./parse.js";
5
5
  //#region src/stages/chapters/index.ts
6
6
  /**
@@ -1,5 +1,5 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
2
- import _objectWithoutProperties from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectWithoutProperties.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
+ import _objectWithoutProperties from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectWithoutProperties.js";
3
3
  import { parseVtt } from "../../containers/webvtt.js";
4
4
  import { resolveUrl } from "../../kernel/url.js";
5
5
  //#region src/stages/chapters/parse.ts
@@ -1,4 +1,4 @@
1
- import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/objectSpread2.js";
2
2
  import { scheduled, tickAfter } from "../../kernel/effects.js";
3
3
  //#region src/stages/content-steering/index.ts
4
4
  /**