@ac-kit/format-dash 0.0.0-stage → 0.1.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 (92) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/LICENSE +28 -0
  3. package/README.md +180 -2
  4. package/dist/_template.d.ts +34 -0
  5. package/dist/_template.d.ts.map +1 -0
  6. package/dist/_template.js +90 -0
  7. package/dist/_template.js.map +1 -0
  8. package/dist/_xlink.d.ts +9 -0
  9. package/dist/_xlink.d.ts.map +1 -0
  10. package/dist/_xlink.js +14 -0
  11. package/dist/_xlink.js.map +1 -0
  12. package/dist/dash-namespaces.d.ts +27 -0
  13. package/dist/dash-namespaces.d.ts.map +1 -0
  14. package/dist/dash-namespaces.js +30 -0
  15. package/dist/dash-namespaces.js.map +1 -0
  16. package/dist/errors.d.ts +127 -0
  17. package/dist/errors.d.ts.map +1 -0
  18. package/dist/errors.js +52 -0
  19. package/dist/errors.js.map +1 -0
  20. package/dist/index.d.ts +12 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/index.js +12 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/limits.d.ts +51 -0
  25. package/dist/limits.d.ts.map +1 -0
  26. package/dist/limits.js +39 -0
  27. package/dist/limits.js.map +1 -0
  28. package/dist/model/dash-common.d.ts +124 -0
  29. package/dist/model/dash-common.d.ts.map +1 -0
  30. package/dist/model/dash-common.js +2 -0
  31. package/dist/model/dash-common.js.map +1 -0
  32. package/dist/model/dash-mpd.d.ts +111 -0
  33. package/dist/model/dash-mpd.d.ts.map +1 -0
  34. package/dist/model/dash-mpd.js +2 -0
  35. package/dist/model/dash-mpd.js.map +1 -0
  36. package/dist/model/dash-segment-information.d.ts +90 -0
  37. package/dist/model/dash-segment-information.d.ts.map +1 -0
  38. package/dist/model/dash-segment-information.js +2 -0
  39. package/dist/model/dash-segment-information.js.map +1 -0
  40. package/dist/parse/_attribute-reader.d.ts +94 -0
  41. package/dist/parse/_attribute-reader.d.ts.map +1 -0
  42. package/dist/parse/_attribute-reader.js +382 -0
  43. package/dist/parse/_attribute-reader.js.map +1 -0
  44. package/dist/parse/_context.d.ts +35 -0
  45. package/dist/parse/_context.d.ts.map +1 -0
  46. package/dist/parse/_context.js +39 -0
  47. package/dist/parse/_context.js.map +1 -0
  48. package/dist/parse/_xs-temporal.d.ts +22 -0
  49. package/dist/parse/_xs-temporal.d.ts.map +1 -0
  50. package/dist/parse/_xs-temporal.js +98 -0
  51. package/dist/parse/_xs-temporal.js.map +1 -0
  52. package/dist/parse/parse-dash-mpd.d.ts +67 -0
  53. package/dist/parse/parse-dash-mpd.d.ts.map +1 -0
  54. package/dist/parse/parse-dash-mpd.js +928 -0
  55. package/dist/parse/parse-dash-mpd.js.map +1 -0
  56. package/dist/resolve/_base-url.d.ts +41 -0
  57. package/dist/resolve/_base-url.d.ts.map +1 -0
  58. package/dist/resolve/_base-url.js +69 -0
  59. package/dist/resolve/_base-url.js.map +1 -0
  60. package/dist/resolve/_essential-properties.d.ts +38 -0
  61. package/dist/resolve/_essential-properties.d.ts.map +1 -0
  62. package/dist/resolve/_essential-properties.js +106 -0
  63. package/dist/resolve/_essential-properties.js.map +1 -0
  64. package/dist/resolve/_inherit.d.ts +43 -0
  65. package/dist/resolve/_inherit.d.ts.map +1 -0
  66. package/dist/resolve/_inherit.js +105 -0
  67. package/dist/resolve/_inherit.js.map +1 -0
  68. package/dist/resolve/_segment-runs.d.ts +81 -0
  69. package/dist/resolve/_segment-runs.d.ts.map +1 -0
  70. package/dist/resolve/_segment-runs.js +126 -0
  71. package/dist/resolve/_segment-runs.js.map +1 -0
  72. package/dist/resolve/dash-resolve-diagnostic.d.ts +34 -0
  73. package/dist/resolve/dash-resolve-diagnostic.d.ts.map +1 -0
  74. package/dist/resolve/dash-resolve-diagnostic.js +2 -0
  75. package/dist/resolve/dash-resolve-diagnostic.js.map +1 -0
  76. package/dist/resolve/resolve-dash-representations.d.ts +130 -0
  77. package/dist/resolve/resolve-dash-representations.d.ts.map +1 -0
  78. package/dist/resolve/resolve-dash-representations.js +203 -0
  79. package/dist/resolve/resolve-dash-representations.js.map +1 -0
  80. package/dist/resolve/resolve-dash-segments.d.ts +169 -0
  81. package/dist/resolve/resolve-dash-segments.d.ts.map +1 -0
  82. package/dist/resolve/resolve-dash-segments.js +665 -0
  83. package/dist/resolve/resolve-dash-segments.js.map +1 -0
  84. package/dist/timing/_exact-period-timings.d.ts +28 -0
  85. package/dist/timing/_exact-period-timings.d.ts.map +1 -0
  86. package/dist/timing/_exact-period-timings.js +142 -0
  87. package/dist/timing/_exact-period-timings.js.map +1 -0
  88. package/dist/timing/dash-period-timings.d.ts +29 -0
  89. package/dist/timing/dash-period-timings.d.ts.map +1 -0
  90. package/dist/timing/dash-period-timings.js +23 -0
  91. package/dist/timing/dash-period-timings.js.map +1 -0
  92. package/package.json +63 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,kBAAkB,GAC3B,YAAY,GACZ,uBAAuB,GACvB,WAAW,GACX,mBAAmB,GACnB,iBAAiB,GACjB,yBAAyB,GACzB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,iCAAiC,GACjC,6BAA6B,CAAC;AAEjC,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GAAG;IAC5B,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,WAAW,GAAG,UAAU,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAE9C,QAAQ,CAAC,IAAI,EAAE,kBAAkB;IAEjC,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IAJtC,YACU,IAAI,EAAE,kBAAkB,EACjC,OAAO,EAAE,MAAM;IACf,0CAA0C;IACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAIrC;CACD;AAED,wEAAwE;AACxE,MAAM,MAAM,aAAa,GACtB,WAAW,GACX,oBAAoB,GACpB,aAAa,GACb,QAAQ,CAAC;AAEZ,sEAAsE;AACtE,qBAAa,cAAe,SAAQ,UAAU;IAE5C,QAAQ,CAAC,KAAK,EAAE,aAAa;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAR9B,YACU,KAAK,EAAE,aAAa;IAC7B,6EAA6E;IACpE,KAAK,EAAE,MAAM;IACtB;;;OAGG;IACM,KAAK,GAAE,MAAM,GAAG,IAAW,EACpC,OAAO,CAAC,EAAE,YAAY,EAStB;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,MAAM,oBAAoB,GAC7B,sBAAsB,GACtB,yBAAyB,GACzB,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,0BAA0B,GAC1B,eAAe,GACf,kBAAkB,GAClB,mBAAmB,GACnB,uBAAuB,GACvB,kBAAkB,GAClB,sBAAsB,CAAC;AAE1B;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IAEzC,QAAQ,CAAC,IAAI,EAAE,oBAAoB;IADpC,YACU,IAAI,EAAE,oBAAoB,EACnC,OAAO,EAAE,MAAM,EAIf;CACD"}
package/dist/errors.js ADDED
@@ -0,0 +1,52 @@
1
+ /**
2
+ * An MPD that XML accepts but ISO/IEC 23009-1 does not, in the way the active
3
+ * mode does not tolerate: any violation in strict mode, and in both modes a
4
+ * root that is not an MPD.
5
+ */
6
+ export class DashSyntaxError extends SyntaxError {
7
+ code;
8
+ position;
9
+ constructor(code, message,
10
+ /** As {@link DashDiagnostic.position}. */
11
+ position) {
12
+ super(position === undefined ? message : `${message} at ${position}`);
13
+ this.code = code;
14
+ this.position = position;
15
+ this.name = "DashSyntaxError";
16
+ }
17
+ }
18
+ /** Input past one of the {@link DashLimits}; thrown in every mode. */
19
+ export class DashLimitError extends RangeError {
20
+ limit;
21
+ value;
22
+ count;
23
+ constructor(limit,
24
+ /** The bound that was exceeded; for `budget`, the private budget's limit. */
25
+ value,
26
+ /**
27
+ * How many there were, when known: for `maxSegments`, the exact number of
28
+ * segments the request selects, so a caller can narrow `from`/`to`.
29
+ */
30
+ count = null, options) {
31
+ super(count === null
32
+ ? `DASH MPD exceeds ${limit} (${value})`
33
+ : `DASH MPD exceeds ${limit} (${value}): ${count}`, options);
34
+ this.limit = limit;
35
+ this.value = value;
36
+ this.count = count;
37
+ this.name = "DashLimitError";
38
+ }
39
+ }
40
+ /**
41
+ * A Representation whose segments {@link resolveDashSegments} cannot list: the
42
+ * MPD parsed, but its segment description is incomplete or contradicts itself.
43
+ */
44
+ export class DashResolveError extends Error {
45
+ code;
46
+ constructor(code, message) {
47
+ super(message);
48
+ this.code = code;
49
+ this.name = "DashResolveError";
50
+ }
51
+ }
52
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AA6DA;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAErC,IAAI;IAGJ,QAAQ;IAJlB,YACU,IAAwB,EACjC,OAAe;IACf,0CAA0C;IACjC,QAA4B;QAErC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,OAAO,QAAQ,EAAE,CAAC,CAAC;oBAL7D,IAAI;wBAGJ,QAAQ;QAGjB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAC/B,CAAC;CACD;AASD,sEAAsE;AACtE,MAAM,OAAO,cAAe,SAAQ,UAAU;IAEnC,KAAK;IAEL,KAAK;IAKL,KAAK;IARf,YACU,KAAoB;IAC7B,6EAA6E;IACpE,KAAa;IACtB;;;OAGG;IACM,KAAK,GAAkB,IAAI,EACpC,OAAsB;QAEtB,KAAK,CACJ,KAAK,KAAK,IAAI;YACb,CAAC,CAAC,oBAAoB,KAAK,KAAK,KAAK,GAAG;YACxC,CAAC,CAAC,oBAAoB,KAAK,KAAK,KAAK,MAAM,KAAK,EAAE,EACnD,OAAO,CACP,CAAC;qBAfO,KAAK;qBAEL,KAAK;qBAKL,KAAK;QASd,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC9B,CAAC;CACD;AAsDD;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAEhC,IAAI;IADd,YACU,IAA0B,EACnC,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;oBAHN,IAAI;QAIb,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IAChC,CAAC;CACD"}
@@ -0,0 +1,12 @@
1
+ export * from "./dash-namespaces.js";
2
+ export * from "./errors.js";
3
+ export * from "./limits.js";
4
+ export * from "./model/dash-common.js";
5
+ export * from "./model/dash-mpd.js";
6
+ export * from "./model/dash-segment-information.js";
7
+ export * from "./parse/parse-dash-mpd.js";
8
+ export * from "./resolve/dash-resolve-diagnostic.js";
9
+ export * from "./resolve/resolve-dash-representations.js";
10
+ export * from "./resolve/resolve-dash-segments.js";
11
+ export * from "./timing/dash-period-timings.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ export * from "./dash-namespaces.js";
2
+ export * from "./errors.js";
3
+ export * from "./limits.js";
4
+ export * from "./model/dash-common.js";
5
+ export * from "./model/dash-mpd.js";
6
+ export * from "./model/dash-segment-information.js";
7
+ export * from "./parse/parse-dash-mpd.js";
8
+ export * from "./resolve/dash-resolve-diagnostic.js";
9
+ export * from "./resolve/resolve-dash-representations.js";
10
+ export * from "./resolve/resolve-dash-segments.js";
11
+ export * from "./timing/dash-period-timings.js";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Bounds on what one MPD may cost to parse and to expand.
3
+ *
4
+ * An MPD comes from a server the caller does not control. Each bound guards a
5
+ * different multiplier: the source text, the `<S>` entries a timeline stores
6
+ * (each becomes an object), and the segments one Representation expands to,
7
+ * which `S@r` can make astronomically many from a few characters. The XML
8
+ * limits of `@ac-kit/format-xml` (entity expansion, nesting depth) apply on
9
+ * top.
10
+ */
11
+ export type DashLimits = {
12
+ /**
13
+ * Most characters of source, 16 777 216 (16 Mi) by default. Bytes are bounded
14
+ * at three times this before decoding, the most UTF-8 a string of that many
15
+ * UTF-16 units takes.
16
+ */
17
+ readonly maxLength?: number;
18
+ /** Most `<S>` elements in the whole MPD, 1 000 000 by default. */
19
+ readonly maxTimelineEntries?: number;
20
+ /**
21
+ * Most segments {@link resolveDashSegments} may select for one Representation,
22
+ * 100 000 by default — a day of one-second segments; narrow `from`/`to` for
23
+ * more.
24
+ */
25
+ readonly maxSegments?: number;
26
+ /** Most warnings kept, 1 000 by default; later ones are counted, not stored. */
27
+ readonly maxWarnings?: number;
28
+ };
29
+ /** Every bound in {@link DashLimits}, filled in. */
30
+ export type ResolvedDashLimits = Required<DashLimits>;
31
+ /** The defaults behind every unset bound in {@link DashLimits}. */
32
+ export declare const DEFAULT_DASH_LIMITS: Readonly<ResolvedDashLimits>;
33
+ /**
34
+ * The default work allowance per call. Parsing shares it among XML parsing,
35
+ * namespace resolution and MPD model construction; resolvers charge their own
36
+ * work to the same allowance per call. This is a work limit, not a wall clock
37
+ * timeout.
38
+ */
39
+ export declare const DEFAULT_DASH_WORK_BUDGET = 500000;
40
+ /**
41
+ * The widest `%0<width>d` a template may ask for. Wider is refused rather than
42
+ * honoured, so one attribute cannot make every URL megabytes long.
43
+ */
44
+ export declare const DASH_MAX_TEMPLATE_WIDTH = 64;
45
+ /**
46
+ * Fills in the unset bounds from {@link DEFAULT_DASH_LIMITS}.
47
+ *
48
+ * @throws {RangeError} When a bound is not a non-negative safe integer.
49
+ */
50
+ export declare function dashLimits(limits?: DashLimits): ResolvedDashLimits;
51
+ //# sourceMappingURL=limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG;IACxB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,gFAAgF;IAChF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAEtD,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,kBAAkB,CAK5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,SAAU,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,kBAAkB,CAclE"}
package/dist/limits.js ADDED
@@ -0,0 +1,39 @@
1
+ /** The defaults behind every unset bound in {@link DashLimits}. */
2
+ export const DEFAULT_DASH_LIMITS = {
3
+ maxLength: 4194304,
4
+ maxTimelineEntries: 100000,
5
+ maxSegments: 100000,
6
+ maxWarnings: 1000,
7
+ };
8
+ /**
9
+ * The default work allowance per call. Parsing shares it among XML parsing,
10
+ * namespace resolution and MPD model construction; resolvers charge their own
11
+ * work to the same allowance per call. This is a work limit, not a wall clock
12
+ * timeout.
13
+ */
14
+ export const DEFAULT_DASH_WORK_BUDGET = 500000;
15
+ /**
16
+ * The widest `%0<width>d` a template may ask for. Wider is refused rather than
17
+ * honoured, so one attribute cannot make every URL megabytes long.
18
+ */
19
+ export const DASH_MAX_TEMPLATE_WIDTH = 64;
20
+ /**
21
+ * Fills in the unset bounds from {@link DEFAULT_DASH_LIMITS}.
22
+ *
23
+ * @throws {RangeError} When a bound is not a non-negative safe integer.
24
+ */
25
+ export function dashLimits(limits) {
26
+ const resolved = {
27
+ maxLength: limits?.maxLength ?? DEFAULT_DASH_LIMITS.maxLength,
28
+ maxTimelineEntries: limits?.maxTimelineEntries ?? DEFAULT_DASH_LIMITS.maxTimelineEntries,
29
+ maxSegments: limits?.maxSegments ?? DEFAULT_DASH_LIMITS.maxSegments,
30
+ maxWarnings: limits?.maxWarnings ?? DEFAULT_DASH_LIMITS.maxWarnings,
31
+ };
32
+ for (const [name, value] of Object.entries(resolved)) {
33
+ if (!Number.isSafeInteger(value) || value < 0) {
34
+ throw new RangeError(`${name} must be a non-negative safe integer`);
35
+ }
36
+ }
37
+ return resolved;
38
+ }
39
+ //# sourceMappingURL=limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAgCA,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAiC;IAChE,SAAS,EAAE,OAAS;IACpB,kBAAkB,EAAE,MAAO;IAC3B,WAAW,EAAE,MAAO;IACpB,WAAW,EAAE,IAAI;CACjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAO,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAmB;IAC7C,MAAM,QAAQ,GAAuB;QACpC,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,mBAAmB,CAAC,SAAS;QAC7D,kBAAkB,EACjB,MAAM,EAAE,kBAAkB,IAAI,mBAAmB,CAAC,kBAAkB;QACrE,WAAW,EAAE,MAAM,EAAE,WAAW,IAAI,mBAAmB,CAAC,WAAW;QACnE,WAAW,EAAE,MAAM,EAAE,WAAW,IAAI,mBAAmB,CAAC,WAAW;KACnE,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,sCAAsC,CAAC,CAAC;QACrE,CAAC;IACF,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC"}
@@ -0,0 +1,124 @@
1
+ import type { Span } from "@ac-kit/core";
2
+ import type { XmlAttribute, XmlElement } from "@ac-kit/format-xml";
3
+ /**
4
+ * What every typed node keeps of its source beyond its typed fields, so nothing
5
+ * an MPD says is lost.
6
+ */
7
+ export type DashExtensions = {
8
+ /**
9
+ * Attributes the model does not type, in source order: namespace
10
+ * declarations, foreign namespaces, MPD attributes this version does not
11
+ * read.
12
+ */
13
+ readonly otherAttributes: readonly XmlAttribute[];
14
+ /**
15
+ * Child elements the model does not type, in source order, as parsed — among
16
+ * them EventStream, ServiceDescription, Preselection, SubRepresentation and
17
+ * vendor elements.
18
+ */
19
+ readonly otherElements: readonly XmlElement[];
20
+ /**
21
+ * Attributes a lenient parse could not read as their type, in the order read:
22
+ * their typed field is `null`, and listing segments refuses a Representation
23
+ * that depends on one. Always empty after a strict parse.
24
+ */
25
+ readonly invalidAttributes: readonly XmlAttribute[];
26
+ /** The element's source span, when it has one. */
27
+ readonly span?: Span;
28
+ };
29
+ /** `30000/1001`, `16:9`; a decimal frame rate (`29.97`) is read as 2997/100. */
30
+ export type DashRatio = {
31
+ readonly numerator: number;
32
+ readonly denominator: number;
33
+ };
34
+ /** An inclusive byte range, `first-last`, or `first-` to the end. */
35
+ export type DashByteRange = {
36
+ readonly first: number;
37
+ readonly last: number | null;
38
+ };
39
+ /** `xlink:href` and `xlink:actuate` of a remote element, never fetched. */
40
+ export type DashXlink = {
41
+ readonly href: string;
42
+ readonly actuate: "onLoad" | "onRequest";
43
+ };
44
+ /** A DescriptorType element: Role, EssentialProperty, AudioChannelConfiguration… */
45
+ export type DashDescriptor = DashExtensions & {
46
+ /** `null` only from a lenient parse of an element without it. */
47
+ readonly schemeIdUri: string | null;
48
+ readonly value: string | null;
49
+ readonly id: string | null;
50
+ };
51
+ /**
52
+ * A ContentProtection descriptor, read as plain data only: nothing here, or
53
+ * anywhere in this package, acquires a license, fetches a key or decrypts.
54
+ */
55
+ export type DashContentProtection = DashDescriptor & {
56
+ /** `cenc:default_KID` as written. */
57
+ readonly defaultKid: string | null;
58
+ readonly robustness: string | null;
59
+ readonly refId: string | null;
60
+ readonly ref: string | null;
61
+ /** The text of each `cenc:pssh` child, whitespace trimmed, never decoded. */
62
+ readonly pssh: readonly string[];
63
+ /**
64
+ * The text of each DASH-IF `Laurl` child, as written: never resolved against
65
+ * a base URL, never requested.
66
+ */
67
+ readonly licenseUrls: readonly string[];
68
+ };
69
+ /** A Label or GroupLabel. */
70
+ export type DashLabel = DashExtensions & {
71
+ readonly id: number | null;
72
+ readonly lang: string | null;
73
+ readonly text: string;
74
+ };
75
+ /** Initialization, RepresentationIndex or BitstreamSwitching. */
76
+ export type DashUrl = DashExtensions & {
77
+ readonly sourceUrl: string | null;
78
+ readonly range: DashByteRange | null;
79
+ };
80
+ /** A BaseURL. */
81
+ export type DashBaseUrl = DashExtensions & {
82
+ /** The element's text, whitespace trimmed, unresolved. */
83
+ readonly url: string;
84
+ readonly serviceLocation: string | null;
85
+ /** A byte-range template; {@link resolveDashSegments} refuses it for now. */
86
+ readonly byteRange: string | null;
87
+ /** Seconds; `Infinity` for `INF`. */
88
+ readonly availabilityTimeOffset: number | null;
89
+ readonly availabilityTimeComplete: boolean | null;
90
+ readonly timeShiftBufferDepth: Temporal.Duration | null;
91
+ readonly rangeAccess: boolean | null;
92
+ };
93
+ /**
94
+ * CommonAttributesElements (§5.3.7), shared by AdaptationSet and
95
+ * Representation.
96
+ */
97
+ export type DashCommonAttributes = {
98
+ readonly profiles: readonly string[] | null;
99
+ readonly width: number | null;
100
+ readonly height: number | null;
101
+ readonly sar: DashRatio | null;
102
+ readonly frameRate: DashRatio | null;
103
+ /** One rate, or a minimum and a maximum. */
104
+ readonly audioSamplingRate: readonly number[] | null;
105
+ readonly mimeType: string | null;
106
+ readonly segmentProfiles: readonly string[] | null;
107
+ readonly codecs: string | null;
108
+ readonly containerProfiles: readonly string[] | null;
109
+ readonly maximumSAPPeriod: number | null;
110
+ readonly startWithSAP: number | null;
111
+ readonly maxPlayoutRate: number | null;
112
+ readonly codingDependency: boolean | null;
113
+ readonly scanType: "progressive" | "interlaced" | "unknown" | null;
114
+ readonly selectionPriority: number | null;
115
+ readonly tag: string | null;
116
+ readonly framePackings: readonly DashDescriptor[];
117
+ readonly audioChannelConfigurations: readonly DashDescriptor[];
118
+ readonly contentProtections: readonly DashContentProtection[];
119
+ readonly outputProtections: readonly DashDescriptor[];
120
+ readonly essentialProperties: readonly DashDescriptor[];
121
+ readonly supplementalProperties: readonly DashDescriptor[];
122
+ readonly inbandEventStreams: readonly DashDescriptor[];
123
+ };
124
+ //# sourceMappingURL=dash-common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dash-common.d.ts","sourceRoot":"","sources":["../../src/model/dash-common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,YAAY,EAAE,CAAC;IAClD;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,UAAU,EAAE,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,EAAE,SAAS,YAAY,EAAE,CAAC;IACpD,kDAAkD;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACrB,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,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Q,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACrD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,YAAY,GAAG,SAAS,GAAG,IAAI,CAAC;IACnE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,SAAS,cAAc,EAAE,CAAC;IAClD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/D,QAAQ,CAAC,kBAAkB,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC9D,QAAQ,CAAC,iBAAiB,EAAE,SAAS,cAAc,EAAE,CAAC;IACtD,QAAQ,CAAC,mBAAmB,EAAE,SAAS,cAAc,EAAE,CAAC;IACxD,QAAQ,CAAC,sBAAsB,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3D,QAAQ,CAAC,kBAAkB,EAAE,SAAS,cAAc,EAAE,CAAC;CACvD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dash-common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dash-common.js","sourceRoot":"","sources":["../../src/model/dash-common.ts"],"names":[],"mappings":""}
@@ -0,0 +1,111 @@
1
+ import type { DashBaseUrl, DashCommonAttributes, DashContentProtection, DashDescriptor, DashExtensions, DashLabel, DashRatio, DashXlink } from "./dash-common.js";
2
+ import type { DashSegmentInformation } from "./dash-segment-information.js";
3
+ /** A Representation: one encoding of one media component. */
4
+ export type DashRepresentation = DashExtensions & DashCommonAttributes & DashSegmentInformation & {
5
+ /** `null` only from a lenient parse of a Representation without one. */
6
+ readonly id: string | null;
7
+ /** Bits per second; `null` only from a lenient parse. */
8
+ readonly bandwidth: number | null;
9
+ readonly qualityRanking: number | null;
10
+ readonly dependencyId: readonly string[];
11
+ readonly associationId: readonly string[];
12
+ readonly associationType: readonly string[];
13
+ readonly mediaStreamStructureId: readonly string[];
14
+ readonly baseUrls: readonly DashBaseUrl[];
15
+ };
16
+ /** An AdaptationSet: interchangeable Representations of one component. */
17
+ export type DashAdaptationSet = DashExtensions & DashCommonAttributes & DashSegmentInformation & {
18
+ /** A remote AdaptationSet, never fetched. */
19
+ readonly xlink: DashXlink | null;
20
+ readonly id: number | null;
21
+ readonly group: number | null;
22
+ /** BCP 47 as written. */
23
+ readonly lang: string | null;
24
+ readonly contentType: string | null;
25
+ readonly par: DashRatio | null;
26
+ readonly minBandwidth: number | null;
27
+ readonly maxBandwidth: number | null;
28
+ readonly minWidth: number | null;
29
+ readonly maxWidth: number | null;
30
+ readonly minHeight: number | null;
31
+ readonly maxHeight: number | null;
32
+ readonly minFrameRate: DashRatio | null;
33
+ readonly maxFrameRate: DashRatio | null;
34
+ /** A boolean, or the number of a group of aligned sets. */
35
+ readonly segmentAlignment: boolean | number | null;
36
+ readonly subsegmentAlignment: boolean | number | null;
37
+ readonly subsegmentStartsWithSAP: number | null;
38
+ readonly bitstreamSwitching: boolean | null;
39
+ readonly accessibility: readonly DashDescriptor[];
40
+ readonly roles: readonly DashDescriptor[];
41
+ readonly ratings: readonly DashDescriptor[];
42
+ readonly viewpoints: readonly DashDescriptor[];
43
+ readonly labels: readonly DashLabel[];
44
+ readonly groupLabels: readonly DashLabel[];
45
+ readonly baseUrls: readonly DashBaseUrl[];
46
+ readonly representations: readonly DashRepresentation[];
47
+ };
48
+ /** A Period: a span of the presentation with its own set of components. */
49
+ export type DashPeriod = DashExtensions & DashSegmentInformation & {
50
+ /** A remote Period, never fetched. */
51
+ readonly xlink: DashXlink | null;
52
+ readonly id: string | null;
53
+ readonly start: Temporal.Duration | null;
54
+ readonly duration: Temporal.Duration | null;
55
+ readonly bitstreamSwitching: boolean | null;
56
+ readonly baseUrls: readonly DashBaseUrl[];
57
+ readonly assetIdentifier: DashDescriptor | null;
58
+ readonly adaptationSets: readonly DashAdaptationSet[];
59
+ /** Period-level ContentProtection (5th edition), inert data. */
60
+ readonly contentProtections: readonly DashContentProtection[];
61
+ readonly essentialProperties: readonly DashDescriptor[];
62
+ readonly supplementalProperties: readonly DashDescriptor[];
63
+ };
64
+ /** A ProgramInformation. */
65
+ export type DashProgramInformation = DashExtensions & {
66
+ readonly lang: string | null;
67
+ readonly moreInformationUrl: string | null;
68
+ readonly title: string | null;
69
+ readonly source: string | null;
70
+ readonly copyright: string | null;
71
+ };
72
+ /**
73
+ * A Media Presentation Description, values as written: no inheritance is
74
+ * applied — {@link resolveDashRepresentations} and {@link resolveDashSegments}
75
+ * compute the effective values. Every duration has a fixed length (no years or
76
+ * months) and every date-time is an instant, a value written with no zone being
77
+ * read as UTC.
78
+ */
79
+ export type DashMpd = DashExtensions & {
80
+ readonly id: string | null;
81
+ readonly profiles: readonly string[];
82
+ /**
83
+ * `"static"` when absent; `null` only from a lenient parse of an unreadable
84
+ * one, which listing segments refuses.
85
+ */
86
+ readonly type: "static" | "dynamic" | null;
87
+ readonly availabilityStartTime: Temporal.Instant | null;
88
+ readonly availabilityEndTime: Temporal.Instant | null;
89
+ readonly publishTime: Temporal.Instant | null;
90
+ readonly mediaPresentationDuration: Temporal.Duration | null;
91
+ readonly minimumUpdatePeriod: Temporal.Duration | null;
92
+ readonly minBufferTime: Temporal.Duration | null;
93
+ readonly timeShiftBufferDepth: Temporal.Duration | null;
94
+ readonly suggestedPresentationDelay: Temporal.Duration | null;
95
+ readonly maxSegmentDuration: Temporal.Duration | null;
96
+ readonly maxSubsegmentDuration: Temporal.Duration | null;
97
+ readonly programInformation: readonly DashProgramInformation[];
98
+ readonly baseUrls: readonly DashBaseUrl[];
99
+ /** Location elements, as written. */
100
+ readonly locations: readonly string[];
101
+ readonly periods: readonly DashPeriod[];
102
+ readonly utcTimings: readonly DashDescriptor[];
103
+ /**
104
+ * MPD-level ContentProtection (5th edition), inert data; a lower-level
105
+ * ContentProtection may refer to one with `@ref`.
106
+ */
107
+ readonly contentProtections: readonly DashContentProtection[];
108
+ readonly essentialProperties: readonly DashDescriptor[];
109
+ readonly supplementalProperties: readonly DashDescriptor[];
110
+ };
111
+ //# sourceMappingURL=dash-mpd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dash-mpd.d.ts","sourceRoot":"","sources":["../../src/model/dash-mpd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE5E,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAC9C,oBAAoB,GACpB,sBAAsB,GAAG;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5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AAQ,GAAG,IAAI,CAAC;IAC9D,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,qBAAqB,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC;IACzD,QAAQ,CAAC,kBAAkB,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC/D,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,qCAAqC;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC9D,QAAQ,CAAC,mBAAmB,EAAE,SAAS,cAAc,EAAE,CAAC;IACxD,QAAQ,CAAC,sBAAsB,EAAE,SAAS,cAAc,EAAE,CAAC;CAC3D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dash-mpd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dash-mpd.js","sourceRoot":"","sources":["../../src/model/dash-mpd.ts"],"names":[],"mappings":""}
@@ -0,0 +1,90 @@
1
+ import type { Span } from "@ac-kit/core";
2
+ import type { XmlAttribute } from "@ac-kit/format-xml";
3
+ import type { DashByteRange, DashExtensions, DashUrl, DashXlink } from "./dash-common.js";
4
+ /**
5
+ * SegmentBase, and what SegmentList and SegmentTemplate share with it. Values
6
+ * as one level declares them: inheritance is applied by
7
+ * {@link resolveDashSegments}, attribute by attribute.
8
+ *
9
+ * Media-timeline values are `bigint`: with a 10 MHz timescale, a `$Time$`
10
+ * counted from 1970 is about 1.7×10¹⁶, past 2^53.
11
+ */
12
+ export type DashSegmentBase = DashExtensions & {
13
+ /** Units per second of every media-timeline value at this level. */
14
+ readonly timescale: number | null;
15
+ readonly presentationTimeOffset: bigint | null;
16
+ readonly eptDelta: bigint | null;
17
+ readonly pdDelta: bigint | null;
18
+ readonly presentationDuration: bigint | null;
19
+ readonly timeShiftBufferDepth: Temporal.Duration | null;
20
+ readonly indexRange: DashByteRange | null;
21
+ readonly indexRangeExact: boolean | null;
22
+ /** Seconds; `Infinity` for `INF`. */
23
+ readonly availabilityTimeOffset: number | null;
24
+ readonly availabilityTimeComplete: boolean | null;
25
+ readonly initialization: DashUrl | null;
26
+ readonly representationIndex: DashUrl | null;
27
+ };
28
+ /** What SegmentList and SegmentTemplate add to {@link DashSegmentBase}. */
29
+ export type DashMultipleSegmentBase = DashSegmentBase & {
30
+ /** Constant segment duration, in `timescale` units. */
31
+ readonly duration: number | null;
32
+ readonly startNumber: number | null;
33
+ readonly endNumber: number | null;
34
+ readonly segmentTimeline: DashSegmentTimeline | null;
35
+ readonly bitstreamSwitching: DashUrl | null;
36
+ };
37
+ /** One `<S>`: `r + 1` segments of duration `d` from `t`. */
38
+ export type DashTimelineEntry = {
39
+ readonly t: bigint | null;
40
+ /** Segment number of the first segment of the entry. */
41
+ readonly n: number | null;
42
+ /** `null` only from a lenient parse of an entry without a readable one. */
43
+ readonly d: bigint | null;
44
+ /**
45
+ * Repetitions after the first; negative for "repeat until the next `t`, or
46
+ * the end"; `null` only from a lenient parse of an unreadable one (absent is
47
+ * 0).
48
+ */
49
+ readonly r: bigint | null;
50
+ /** Segments in a segment sequence; listing refuses it for now. */
51
+ readonly k: number | null;
52
+ /** As {@link DashExtensions.invalidAttributes}; absent when empty. */
53
+ readonly invalidAttributes?: readonly XmlAttribute[];
54
+ readonly span?: Span;
55
+ };
56
+ /** A SegmentTimeline. */
57
+ export type DashSegmentTimeline = DashExtensions & {
58
+ readonly entries: readonly DashTimelineEntry[];
59
+ };
60
+ /** A SegmentURL. */
61
+ export type DashSegmentUrl = DashExtensions & {
62
+ readonly media: string | null;
63
+ readonly mediaRange: DashByteRange | null;
64
+ readonly index: string | null;
65
+ readonly indexRange: DashByteRange | null;
66
+ };
67
+ /** A SegmentList. */
68
+ export type DashSegmentList = DashMultipleSegmentBase & {
69
+ readonly xlink: DashXlink | null;
70
+ readonly segmentUrls: readonly DashSegmentUrl[];
71
+ };
72
+ /**
73
+ * A SegmentTemplate. Every template attribute was checked when parsed: its
74
+ * identifiers are among `$$`, `$RepresentationID$`, `$Number$`, `$Time$`,
75
+ * `$Bandwidth$` and `$SubNumber$`, with at most a `%0<width>d` format.
76
+ */
77
+ export type DashSegmentTemplate = DashMultipleSegmentBase & {
78
+ readonly media: string | null;
79
+ readonly index: string | null;
80
+ /** `@initialization`, a template; distinct from the Initialization element. */
81
+ readonly initializationTemplate: string | null;
82
+ readonly bitstreamSwitchingTemplate: string | null;
83
+ };
84
+ /** The segment information one level declares, uninherited. */
85
+ export type DashSegmentInformation = {
86
+ readonly segmentBase: DashSegmentBase | null;
87
+ readonly segmentList: DashSegmentList | null;
88
+ readonly segmentTemplate: DashSegmentTemplate | null;
89
+ };
90
+ //# sourceMappingURL=dash-segment-information.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dash-segment-information.d.ts","sourceRoot":"","sources":["../../src/model/dash-segment-information.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EACX,aAAa,EACb,cAAc,EACd,OAAO,EACP,SAAS,EACT,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG;IAC9C,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACj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e,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,eAAe,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACrD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dash-segment-information.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dash-segment-information.js","sourceRoot":"","sources":["../../src/model/dash-segment-information.ts"],"names":[],"mappings":""}