@amazon/vinyl-mpd-parser 3.2.3-next.20261010160052 → 3.2.3-next.20261013174635

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 (45) hide show
  1. package/dist/index.cjs +124 -14
  2. package/dist/index.cjs.map +4 -4
  3. package/dist/index.js +125 -8
  4. package/dist/index.js.map +4 -4
  5. package/dist/test/benchmark.es5.js +18 -16
  6. package/dist/test/benchmark.js +155 -52
  7. package/dist/test/benchmark.js.map +4 -4
  8. package/dist/types/current/index.d.ts +2 -0
  9. package/dist/types/current/index.d.ts.map +1 -1
  10. package/dist/types/current/index.js +2 -0
  11. package/dist/types/current/manifest/dashManifestXmlRules.d.ts +5 -0
  12. package/dist/types/current/manifest/dashManifestXmlRules.d.ts.map +1 -1
  13. package/dist/types/current/manifest/dashManifestXmlRules.js +30 -5
  14. package/dist/types/current/manifest/dashParser.d.ts +368 -1
  15. package/dist/types/current/manifest/dashParser.d.ts.map +1 -1
  16. package/dist/types/current/manifest/dashParser.js +2 -1
  17. package/dist/types/current/manifest/ext/events/scte35XmlRules.d.ts +33 -0
  18. package/dist/types/current/manifest/ext/events/scte35XmlRules.d.ts.map +1 -0
  19. package/dist/types/current/manifest/ext/events/scte35XmlRules.js +83 -0
  20. package/dist/types/current/tsconfig.tsbuildinfo +1 -1
  21. package/dist/types/current/xmlns/mpeg/dash/schema/mpd/2011.d.ts +79 -1
  22. package/dist/types/current/xmlns/mpeg/dash/schema/mpd/2011.d.ts.map +1 -1
  23. package/dist/types/current/xmlns/scte/35/2016.d.ts +73 -0
  24. package/dist/types/current/xmlns/scte/35/2016.d.ts.map +1 -0
  25. package/dist/types/current/xmlns/scte/35/2016.js +13 -0
  26. package/dist/types/ts3.7/index.d.ts +2 -0
  27. package/dist/types/ts3.7/manifest/dashManifestXmlRules.d.ts +5 -0
  28. package/dist/types/ts3.7/manifest/dashParser.d.ts +368 -1
  29. package/dist/types/ts3.7/manifest/ext/events/scte35XmlRules.d.ts +33 -0
  30. package/dist/types/ts3.7/xmlns/mpeg/dash/schema/mpd/2011.d.ts +79 -1
  31. package/dist/types/ts3.7/xmlns/scte/35/2016.d.ts +73 -0
  32. package/dist/types/ts4.1/index.d.ts +2 -0
  33. package/dist/types/ts4.1/manifest/dashManifestXmlRules.d.ts +5 -0
  34. package/dist/types/ts4.1/manifest/dashParser.d.ts +368 -1
  35. package/dist/types/ts4.1/manifest/ext/events/scte35XmlRules.d.ts +33 -0
  36. package/dist/types/ts4.1/xmlns/mpeg/dash/schema/mpd/2011.d.ts +79 -1
  37. package/dist/types/ts4.1/xmlns/scte/35/2016.d.ts +73 -0
  38. package/dist/types/ts4.7/index.d.ts +2 -0
  39. package/dist/types/ts4.7/manifest/dashManifestXmlRules.d.ts +5 -0
  40. package/dist/types/ts4.7/manifest/dashParser.d.ts +368 -1
  41. package/dist/types/ts4.7/manifest/ext/events/scte35XmlRules.d.ts +33 -0
  42. package/dist/types/ts4.7/xmlns/mpeg/dash/schema/mpd/2011.d.ts +79 -1
  43. package/dist/types/ts4.7/xmlns/scte/35/2016.d.ts +73 -0
  44. package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -125,10 +125,13 @@ function stringifyFrameRate(value) {
125
125
 
126
126
  // src/manifest/dashManifestXmlRules.ts
127
127
  var dashNamespaceUri = "urn:mpeg:dash:schema:mpd:2011";
128
+ var XLINK_NAMESPACE_URI = "http://www.w3.org/1999/xlink";
128
129
  function dashManifestXmlRules() {
129
130
  const attrActuateType = attr(assertActuateEnum, stringify, {
130
- default: "onRequest"
131
+ default: "onRequest",
132
+ namespaceUri: XLINK_NAMESPACE_URI
131
133
  });
134
+ const attrHref = attrString({ namespaceUri: XLINK_NAMESPACE_URI });
132
135
  const descriptorType = {
133
136
  id: attrString,
134
137
  schemeIdUri: attrString({ required: true }),
@@ -189,7 +192,7 @@ function dashManifestXmlRules() {
189
192
  };
190
193
  const segmentListType = __spreadProps(__spreadValues({}, multipleSegmentBaseType), {
191
194
  actuate: attrActuateType,
192
- href: attrString,
195
+ href: attrHref,
193
196
  SegmentURL: elements(segmentURLType)
194
197
  });
195
198
  const segmentTemplateType = __spreadProps(__spreadValues({}, multipleSegmentBaseType), {
@@ -202,19 +205,32 @@ function dashManifestXmlRules() {
202
205
  contains: attr(parseIntVector, stringifyIntVector, { required: true }),
203
206
  id: attrString
204
207
  };
208
+ const alternativePresentationType = {
209
+ uri: attrString,
210
+ maxDuration: attrInt,
211
+ earliestResolutionTimeOffset: attrInt,
212
+ returnOffset: attrInt,
213
+ clip: attrBoolean,
214
+ startWithOffset: attrBoolean
215
+ };
205
216
  const eventType = {
206
217
  duration: attrInt,
207
218
  id: attrInt,
208
219
  messageData: attrString,
209
- presentationTime: attrInt({ default: 0 })
220
+ presentationTime: attrInt({ default: 0 }),
221
+ contentEncoding: attrString,
222
+ _content: charactersString,
223
+ InsertPresentation: element(alternativePresentationType),
224
+ ReplacePresentation: element(alternativePresentationType)
210
225
  };
211
226
  const eventStreamType = {
212
227
  Event: elements(eventType),
213
228
  actuate: attrActuateType,
214
- href: attrString,
229
+ href: attrHref,
215
230
  messageData: attrString,
216
231
  schemeIdUri: attrString({ required: true }),
217
232
  timescale: attrInt,
233
+ presentationTimeOffset: attrInt,
218
234
  value: attrString
219
235
  };
220
236
  const switchingType = {
@@ -278,7 +294,7 @@ function dashManifestXmlRules() {
278
294
  bitstreamSwitching: attrBoolean,
279
295
  contentType: attrString,
280
296
  group: attrInt,
281
- href: attrString,
297
+ href: attrHref,
282
298
  id: attrInt,
283
299
  lang: attrString,
284
300
  maxBandwidth: attrInt,
@@ -310,6 +326,10 @@ function dashManifestXmlRules() {
310
326
  Range: elements(rangeType),
311
327
  Reporting: elements(descriptorType, { minOccurs: 1 })
312
328
  };
329
+ const importedMpdType = {
330
+ earliestResolutionTimeOffset: attrFloat,
331
+ _content: charactersString
332
+ };
313
333
  const periodType = {
314
334
  BaseURL: elements(baseURLType),
315
335
  SegmentBase: element(segmentBaseType),
@@ -320,10 +340,11 @@ function dashManifestXmlRules() {
320
340
  AdaptationSet: elements(adaptationSetType),
321
341
  Subset: elements(subsetType),
322
342
  SupplementalProperty: elements(descriptorType),
343
+ ImportedMPD: element(importedMpdType),
323
344
  actuate: attrActuateType,
324
345
  bitstreamSwitching: attrBoolean({ default: false }),
325
346
  duration: attr(parseDuration, stringifyDuration),
326
- href: attrString,
347
+ href: attrHref,
327
348
  id: attrString,
328
349
  start: attr(parseDuration, stringifyDuration)
329
350
  };
@@ -411,7 +432,8 @@ function stringifyIntVector(value) {
411
432
  }
412
433
  var presentationTypeValidator = /* @__PURE__ */ isOneOf(
413
434
  "static",
414
- "dynamic"
435
+ "dynamic",
436
+ "list"
415
437
  );
416
438
  function parsePresentationTypeType(str) {
417
439
  presentationTypeValidator.assert(str, ErrorOrigin3.PARSING);
@@ -506,11 +528,102 @@ var playreadyXmlRules = {
506
528
  )
507
529
  };
508
530
 
531
+ // src/manifest/ext/events/scte35XmlRules.ts
532
+ import {
533
+ attrBoolean as attrBoolean2,
534
+ attrInt as attrInt2,
535
+ attrString as attrString2,
536
+ charactersString as charactersString4,
537
+ element as element5,
538
+ elements as elements3
539
+ } from "@amazon/vinyl-xml";
540
+
541
+ // src/xmlns/scte/35/2016.ts
542
+ var SCTE35_2016_NAMESPACE_URI = "http://www.scte.org/schemas/35/2016";
543
+
544
+ // src/manifest/ext/events/scte35XmlRules.ts
545
+ var options = { namespaceUri: SCTE35_2016_NAMESPACE_URI };
546
+ var spliceTimeType = {
547
+ ptsTime: attrInt2
548
+ };
549
+ var segmentationUpidType = {
550
+ segmentationUpidType: attrInt2,
551
+ segmentationUpidFormat: attrString2,
552
+ _content: charactersString4
553
+ };
554
+ var segmentationDescriptorType = {
555
+ segmentationEventId: attrInt2,
556
+ segmentationEventCancelIndicator: attrBoolean2,
557
+ segmentationDuration: attrInt2,
558
+ segmentationTypeId: attrInt2,
559
+ segmentNum: attrInt2,
560
+ segmentsExpected: attrInt2,
561
+ SegmentationUpid: /* @__PURE__ */ elements3(segmentationUpidType, options)
562
+ };
563
+ var programType = {
564
+ SpliceTime: /* @__PURE__ */ element5(spliceTimeType, options)
565
+ };
566
+ var breakDurationType = {
567
+ autoReturn: attrBoolean2,
568
+ duration: attrInt2
569
+ };
570
+ var spliceInsertType = {
571
+ spliceEventId: attrInt2,
572
+ spliceEventCancelIndicator: attrBoolean2,
573
+ outOfNetworkIndicator: attrBoolean2,
574
+ spliceImmediateFlag: attrBoolean2,
575
+ uniqueProgramId: attrInt2,
576
+ availNum: attrInt2,
577
+ availsExpected: attrInt2,
578
+ Program: /* @__PURE__ */ element5(programType, options),
579
+ BreakDuration: /* @__PURE__ */ element5(breakDurationType, options)
580
+ };
581
+ var timeSignalType = {
582
+ SpliceTime: /* @__PURE__ */ element5(spliceTimeType, options)
583
+ };
584
+ var spliceNullType = {};
585
+ var spliceInfoSectionType = {
586
+ ptsAdjustment: attrInt2,
587
+ tier: attrInt2,
588
+ SpliceNull: /* @__PURE__ */ element5(spliceNullType, options),
589
+ SpliceInsert: /* @__PURE__ */ element5(spliceInsertType, options),
590
+ TimeSignal: /* @__PURE__ */ element5(timeSignalType, options),
591
+ SegmentationDescriptor: /* @__PURE__ */ elements3(segmentationDescriptorType, options)
592
+ };
593
+ var binaryType = {
594
+ _content: charactersString4
595
+ };
596
+ var signalType = {
597
+ Binary: /* @__PURE__ */ element5(binaryType, options)
598
+ };
599
+ var scte35EventXmlRules = {
600
+ Signal: /* @__PURE__ */ element5(signalType, options),
601
+ SpliceInfoSection: /* @__PURE__ */ element5(spliceInfoSectionType, options)
602
+ };
603
+ function createDashScte35EventXmlRules() {
604
+ return {
605
+ MPD: element5(
606
+ {
607
+ Period: elements3(
608
+ {
609
+ EventStream: elements3({
610
+ Event: elements3(scte35EventXmlRules)
611
+ })
612
+ },
613
+ { minOccurs: 1 }
614
+ )
615
+ },
616
+ { required: true, namespaceUri: dashNamespaceUri }
617
+ )
618
+ };
619
+ }
620
+
509
621
  // src/manifest/dashParser.ts
510
622
  var dashDrmRules = /* @__PURE__ */ mergeXmlRules(
511
623
  /* @__PURE__ */ dashManifestXmlRules(),
512
624
  /* @__PURE__ */ createDashProtectionXmlRules(cencXmlRules),
513
- /* @__PURE__ */ createDashProtectionXmlRules(playreadyXmlRules)
625
+ /* @__PURE__ */ createDashProtectionXmlRules(playreadyXmlRules),
626
+ /* @__PURE__ */ createDashScte35EventXmlRules()
514
627
  );
515
628
  var dashDrmRulesMapped = /* @__PURE__ */ mapXmlRules(dashDrmRules);
516
629
  function dashManifestHandler() {
@@ -558,8 +671,11 @@ export {
558
671
  CENC_NAMESPACE_URI,
559
672
  ContentProtectionScheme,
560
673
  PLAY_READY_NAMESPACE_URI,
674
+ SCTE35_2016_NAMESPACE_URI,
675
+ XLINK_NAMESPACE_URI,
561
676
  cencXmlRules,
562
677
  createDashProtectionXmlRules,
678
+ createDashScte35EventXmlRules,
563
679
  dashDrmRules,
564
680
  dashManifestXmlRules,
565
681
  dashNamespaceUri,
@@ -577,6 +693,7 @@ export {
577
693
  parseSwitchingTypeType,
578
694
  parseVideoScan,
579
695
  playreadyXmlRules,
696
+ scte35EventXmlRules,
580
697
  stringifyByteRange,
581
698
  stringifyDashManifest,
582
699
  stringifyDuration,
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/duration/duration.ts", "../src/error/parsingError.ts", "../src/manifest/dashManifestXmlRules.ts", "../src/media/byteRange.ts", "../src/media/ratio.ts", "../src/media/frameRate.ts", "../src/manifest/dashParser.ts", "../src/manifest/ext/drm/cencXmlRules.ts", "../src/xmlns/mpeg/cenc/2013.ts", "../src/manifest/ext/drm/contentProtection.ts", "../src/manifest/ext/drm/playreadyXmlRules.ts", "../src/xmlns/microsoft/playready.ts", "../src/manifest/ext/drm/ContentProtectionScheme.ts"],
4
- "sourcesContent": ["/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n ErrorOrigin,\n roundToNearest,\n ValidationError,\n} from '@amazon/vinyl-util'\n\n// ESBuild (https://github.com/evanw/esbuild/issues/3988) considers multiplication and division\n// to have a side effect and will inhibit tree shaking.\n// E.g. H = 60 * 60 will not be removed when not referenced.\nconst I = 60\nconst H = 3600\nconst D = 86400\nconst M = 2592000\nconst Y = 31536000\n\n/**\n * A duration, in seconds. (This may be negative)\n */\nexport type Duration = number\n\n/**\n * https://www.w3.org/TR/xmlschema-2/#duration\n */\nconst iso8601Duration =\n /^(-?)P?(\\d+(?:\\.\\d*)?Y)?(\\d+(?:\\.\\d*)?M)?(\\d+(?:\\.\\d*)?D)?T?(\\d+(?:\\.\\d*)?H)?(\\d+(?:\\.\\d*)?M)?(\\d+(?:\\.\\d*)?S?)?$/i\n\n/**\n * Parses an ISO 8601 duration into seconds.\n * The accepted format is P(n)Y(n)M(n)DT(n)H(n)M(n)S\n *\n * All units shall have a fixed size.\n *\n * P - Period designator, precedes all durations.\n * 1Y (Year) = 365 * 24 * 60 * 60 Seconds\n * 1M (Month) = 30 * 24 * 60 * 60 Seconds\n * 1D (Day) = 24 * 60 * 60 Seconds\n *\n * T - Time designator, precedes all time components.\n * 1H (Hour) = 60 * 60 Seconds\n * 1M (Minute) = 60 Seconds\n * 1S (Second)\n *\n *\n * @param value\n * @return Returns the duration in seconds or throws an {@link ValidationError}\n * if not properly formatted.\n * @see https://www.w3.org/TR/xmlschema-2/#duration\n */\nexport function parseDuration(value: string): Duration {\n const match = iso8601Duration.exec(value)\n if (match == null)\n throw new ValidationError(\n `Unexpected duration: '${value}', should be in iso 8601 format`,\n ErrorOrigin.PARSING\n )\n\n const sign = match[1] === '-' ? -1 : 1\n return (\n sign *\n (parseFloat(match[2] || '0') * Y +\n parseFloat(match[3] || '0') * M +\n parseFloat(match[4] || '0') * D +\n parseFloat(match[5] || '0') * H +\n parseFloat(match[6] || '0') * I +\n parseFloat(match[7] || '0'))\n )\n}\n\n/**\n * Returns the iso 8601 string representation of a duration value.\n *\n * @param value A duration value, in seconds.\n */\nexport function stringifyDuration(value: Duration): string {\n const sign = value < 0 ? '-' : ''\n let abs = Math.abs(value)\n\n const years = Math.floor(abs / Y)\n abs -= years * Y\n const months = Math.floor(abs / M)\n const days = Math.floor((abs % M) / D)\n const hours = Math.floor((abs % D) / H)\n const minutes = Math.floor((abs % H) / I)\n const seconds = abs % I\n\n let date = ''\n if (years > 0) date += `${years}Y`\n if (months > 0) date += `${months}M`\n if (days > 0) date += `${days}D`\n let time = ''\n if (hours > 0) time += `${hours}H`\n if (minutes > 0) time += `${minutes}M`\n if (seconds > 0) time += `${roundToNearest(seconds, 0.001)}S`\n // A duration must carry at least one component, so a zero duration is\n // written as `PT0S`. The time designator is only written when a time\n // component follows it; a trailing `T` is not a valid duration.\n if (!date && !time) time = '0S'\n return `${sign}P${date}${time && `T${time}`}`\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ErrorOrigin, ValidationError } from '@amazon/vinyl-util'\n\nexport function throwParsingError(message: string): never {\n throw new ValidationError(message, ErrorOrigin.PARSING)\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Parser definitions for a dash manifest.\n * Attribute order does not matter, element order matters for writing.\n *\n * @module\n */\n\nimport type { actuateType, UriType } from '@amazon/vinyl-xml'\nimport {\n assertActuateEnum,\n attr,\n attrBoolean,\n attrDateTime,\n attrFloat,\n attrInt,\n attrString,\n charactersString,\n element,\n elements,\n type XmlRules,\n} from '@amazon/vinyl-xml'\nimport { ErrorOrigin, stringify } from '@amazon/vinyl-util'\nimport { isOneOf, number, type Validator } from '@amazon/vinyl-validation'\nimport { parseDuration, stringifyDuration } from '../duration/duration'\nimport { parseByteRange, stringifyByteRange } from '../media/byteRange'\nimport { parseRatio, stringifyRatio } from '../media/ratio'\nimport { parseFrameRate, stringifyFrameRate } from '../media/frameRate'\nimport type {\n AdaptationSetType,\n BaseURLType,\n ConditionalUintType,\n ContentComponentType,\n DashManifest,\n DescriptorType,\n EventStreamType,\n EventType,\n MetricsType,\n MPDtype,\n MultipleSegmentBaseType,\n PeriodType,\n PresentationType,\n ProgramInformationType,\n RangeType,\n RepresentationBaseType,\n RepresentationType,\n SegmentBaseType,\n SegmentListType,\n SegmentTemplateType,\n SegmentTimelineType,\n SegmentTimelineTypeSType,\n SegmentURLType,\n SubRepresentationType,\n SubsetType,\n SwitchingType,\n SwitchingTypeType,\n URLType,\n VideoScanType,\n} from '../xmlns/mpeg/dash/schema/mpd/2011'\n\nexport const dashNamespaceUri = 'urn:mpeg:dash:schema:mpd:2011'\n\nexport function dashManifestXmlRules(): XmlRules<DashManifest> {\n const attrActuateType = attr<actuateType>(assertActuateEnum, stringify, {\n default: 'onRequest',\n } as const)\n\n const descriptorType: XmlRules<DescriptorType> = {\n id: attrString,\n schemeIdUri: attrString({ required: true }),\n value: attrString,\n } as const\n\n const baseURLType: XmlRules<BaseURLType> = {\n availabilityTimeComplete: attrBoolean,\n availabilityTimeOffset: attrFloat,\n byteRange: attrString,\n serviceLocation: attrString,\n _content: charactersString,\n } as const\n\n const contentComponentType: XmlRules<ContentComponentType> = {\n contentType: attrString,\n id: attrInt,\n lang: attrString,\n par: attr(parseRatio, stringifyRatio),\n Accessibility: elements(descriptorType),\n Rating: elements(descriptorType),\n Role: elements(descriptorType),\n Viewpoint: elements(descriptorType),\n } as const\n\n const urlType: XmlRules<URLType> = {\n range: attr(parseByteRange, stringifyByteRange),\n sourceURL: attrString,\n } as const\n\n const uriType: XmlRules<UriType> = { _content: charactersString } as const\n\n const segmentBaseType: XmlRules<SegmentBaseType> = {\n Initialization: element(urlType),\n RepresentationIndex: element(urlType),\n availabilityTimeComplete: attrBoolean,\n availabilityTimeOffset: attrInt,\n indexRange: attr(parseByteRange, stringifyByteRange),\n indexRangeExact: attrBoolean({ default: false }),\n presentationTimeOffset: attrFloat,\n timescale: attrInt,\n } as const\n\n const segmentTimelineTypeSType: XmlRules<SegmentTimelineTypeSType> = {\n d: attrInt({ required: true }),\n n: attrInt,\n r: attrInt({ default: 0 }),\n t: attrInt,\n } as const\n\n const segmentTimelineType: XmlRules<SegmentTimelineType> = {\n S: elements(segmentTimelineTypeSType),\n } as const\n\n const multipleSegmentBaseType: XmlRules<MultipleSegmentBaseType> = {\n ...segmentBaseType,\n SegmentTimeline: element(segmentTimelineType),\n BitstreamSwitching: element(urlType),\n duration: attrInt,\n startNumber: attrInt,\n } as const\n\n const segmentURLType: XmlRules<SegmentURLType> = {\n index: attrString,\n indexRange: attr(parseByteRange, stringifyByteRange),\n media: attrString,\n mediaRange: attr(parseByteRange, stringifyByteRange),\n } as const\n\n const segmentListType: XmlRules<SegmentListType> = {\n ...multipleSegmentBaseType,\n actuate: attrActuateType,\n href: attrString,\n SegmentURL: elements(segmentURLType),\n } as const\n\n const segmentTemplateType: XmlRules<SegmentTemplateType> = {\n ...multipleSegmentBaseType,\n bitstreamSwitching: attrString,\n index: attrString,\n initialization: attrString,\n media: attrString,\n } as const\n\n const subsetType: XmlRules<SubsetType> = {\n contains: attr(parseIntVector, stringifyIntVector, { required: true }),\n id: attrString,\n } as const\n\n const eventType: XmlRules<EventType> = {\n duration: attrInt,\n id: attrInt,\n messageData: attrString,\n presentationTime: attrInt({ default: 0 }),\n } as const\n\n const eventStreamType: XmlRules<EventStreamType> = {\n Event: elements(eventType),\n actuate: attrActuateType,\n href: attrString,\n messageData: attrString,\n schemeIdUri: attrString({ required: true }),\n timescale: attrInt,\n value: attrString,\n } as const\n\n const switchingType: XmlRules<SwitchingType> = {\n interval: attrInt({ required: true }),\n type: attr(parseSwitchingTypeType, stringify),\n } as const\n\n const representationBaseType: XmlRules<RepresentationBaseType> = {\n FramePacking: elements(descriptorType),\n AudioChannelConfiguration: elements(descriptorType),\n ContentProtection: elements(descriptorType),\n EssentialProperty: elements(descriptorType),\n SupplementalProperty: elements(descriptorType),\n InbandEventStream: elements(eventStreamType),\n Switching: elements(switchingType),\n audioSamplingRate: attr(parseIntVector, stringifyIntVector),\n codecs: attrString,\n codingDependency: attrBoolean,\n frameRate: attr(parseFrameRate, stringifyFrameRate),\n height: attrInt,\n maximumSAPPeriod: attrInt,\n maxPlayoutRate: attrInt,\n mimeType: attrString,\n profiles: attr(parseProfiles, stringifyProfiles),\n sar: attr(parseRatio, stringifyRatio),\n scanType: attr(parseVideoScan, stringify),\n segmentProfiles: attrString,\n startWithSAP: attr(parseSap, stringify),\n width: attrInt,\n } as const\n\n const subRepresentationType: XmlRules<SubRepresentationType> = {\n ...representationBaseType,\n bandwidth: attrInt,\n contentComponent: attr(parseStringVector, stringifyStringVector),\n dependencyLevel: attr(parseIntVector, stringifyIntVector),\n level: attrInt,\n } as const\n\n const representationType: XmlRules<RepresentationType> = {\n ...representationBaseType,\n bandwidth: attrInt({ required: true }),\n bitrate: attrInt,\n dependencyId: attr(parseStringVector, stringifyStringVector),\n id: attrString({ required: true }),\n mediaStreamStructureId: attr(parseStringVector, stringifyStringVector),\n qualityRanking: attrInt,\n BaseURL: elements(baseURLType),\n SegmentBase: element(segmentBaseType),\n SegmentList: element(segmentListType),\n SegmentTemplate: element(segmentTemplateType),\n SubRepresentation: elements(subRepresentationType),\n } as const\n\n const adaptationSetType: XmlRules<AdaptationSetType> = {\n ...representationBaseType,\n Accessibility: elements(descriptorType),\n Role: elements(descriptorType),\n Rating: elements(descriptorType),\n Viewpoint: elements(descriptorType),\n ContentComponent: elements(contentComponentType),\n BaseURL: elements(baseURLType),\n SegmentBase: element(segmentBaseType),\n SegmentList: element(segmentListType),\n SegmentTemplate: element(segmentTemplateType),\n Representation: elements(representationType),\n actuate: attrActuateType,\n bitstreamSwitching: attrBoolean,\n contentType: attrString,\n group: attrInt,\n href: attrString,\n id: attrInt,\n lang: attrString,\n maxBandwidth: attrInt,\n maxFrameRate: attr(parseFrameRate, stringifyFrameRate),\n maxHeight: attrInt,\n maxWidth: attrInt,\n minBandwidth: attrInt,\n minFrameRate: attr(parseFrameRate, stringifyFrameRate),\n minHeight: attrInt,\n minWidth: attrInt,\n par: attr(parseRatio, stringifyRatio),\n segmentAlignment: attr(parseConditionalUint, stringify, {\n default: false,\n }),\n selectionPriority: attrInt({\n default: 1,\n }),\n subsegmentAlignment: attr(parseConditionalUint, stringify, {\n default: false,\n }),\n subsegmentStartsWithSAP: attr(parseSap, stringify, { default: 0 }),\n } as const\n\n const rangeType: XmlRules<RangeType> = {\n duration: attr(parseDuration, stringifyDuration),\n starttime: attr(parseDuration, stringifyDuration),\n } as const\n\n const metricsType: XmlRules<MetricsType> = {\n metrics: attrString({ required: true }),\n Range: elements(rangeType),\n Reporting: elements(descriptorType, { minOccurs: 1 }),\n } as const\n\n const periodType: XmlRules<PeriodType> = {\n BaseURL: elements(baseURLType),\n SegmentBase: element(segmentBaseType),\n SegmentList: element(segmentListType),\n SegmentTemplate: element(segmentTemplateType),\n AssetIdentifier: element(descriptorType),\n EventStream: elements(eventStreamType),\n AdaptationSet: elements(adaptationSetType),\n Subset: elements(subsetType),\n SupplementalProperty: elements(descriptorType),\n actuate: attrActuateType,\n bitstreamSwitching: attrBoolean({ default: false }),\n duration: attr(parseDuration, stringifyDuration),\n href: attrString,\n id: attrString,\n start: attr(parseDuration, stringifyDuration),\n } as const\n\n const programInformationType: XmlRules<ProgramInformationType> = {\n lang: attrString,\n moreInformationURL: attrString,\n Copyright: attrString,\n Source: attrString,\n Title: attrString,\n } as const\n\n const mpdType: XmlRules<MPDtype> = {\n ProgramInformation: elements(programInformationType),\n BaseURL: elements(baseURLType),\n Location: elements(uriType),\n Period: elements(periodType, { minOccurs: 1 }),\n Metrics: elements(metricsType),\n EssentialProperty: elements(descriptorType),\n SupplementalProperty: elements(descriptorType),\n UTCTiming: elements(descriptorType),\n availabilityEndTime: attrDateTime,\n availabilityStartTime: attrDateTime,\n id: attrString,\n maxSegmentDuration: attr(parseDuration, stringifyDuration),\n maxSubsegmentDuration: attr(parseDuration, stringifyDuration),\n mediaPresentationDuration: attr(parseDuration, stringifyDuration),\n minBufferTime: attr(parseDuration, stringifyDuration, {\n required: true,\n }),\n minimumUpdatePeriod: attr(parseDuration, stringifyDuration),\n profiles: attr(parseProfiles, stringifyProfiles, { required: true }),\n publishTime: attrDateTime,\n suggestedPresentationDelay: attr(parseDuration, stringifyDuration),\n timeShiftBufferDepth: attr(parseDuration, stringifyDuration),\n type: attr(parsePresentationTypeType, stringify, {\n default: 'static',\n } as const),\n } as const\n\n return {\n MPD: element(mpdType, {\n required: true,\n namespaceUri: dashNamespaceUri,\n }),\n } as const\n}\n\n/**\n * Parses a comma delimited list of profiles.\n * Profile values are not whitespace trimmed.\n *\n * @param str\n */\nexport function parseProfiles(str: string): readonly string[] {\n return str.split(',')\n}\n\n/**\n * Returns the string representation of a {@link FrameRate} value.\n *\n * @param value\n */\nexport function stringifyProfiles(value: readonly string[]): string {\n return value.join(',')\n}\n\nconst videoScanTypeValidator: Validator<VideoScanType> = /* @__PURE__ */ isOneOf(\n 'progressive',\n 'interlaced',\n 'unknown'\n)\n\n/**\n * @private\n */\nexport function parseVideoScan(str: string): VideoScanType {\n videoScanTypeValidator.assert(str, ErrorOrigin.PARSING)\n return str\n}\n\nconst switchingTypeTypeValidator: Validator<SwitchingTypeType> = /* @__PURE__ */ isOneOf(\n 'media',\n 'bitstream'\n)\n\n/**\n * @private\n */\nexport function parseSwitchingTypeType(str: string): SwitchingTypeType {\n switchingTypeTypeValidator.assert(str, ErrorOrigin.PARSING)\n return str\n}\n\nconst validateSap: Validator<number> = /* @__PURE__ */ /* @__PURE__ */ number().within(0, 6)\n\n/**\n * @private\n */\nexport function parseSap(str: string): number {\n const number = parseInt(str)\n validateSap.assert(number, ErrorOrigin.PARSING)\n return number\n}\n\n/**\n * Splits a string by whitespace.\n *\n * @private\n */\nexport function parseStringVector(str: string): readonly string[] {\n return str.split(/\\s+/)\n}\n\n/**\n * Returns the string representation of a string vector value.\n *\n * @param value\n */\nexport function stringifyStringVector(value: readonly string[]): string {\n return value.join(' ')\n}\n\n/**\n * Splits a string by whitespace and parses as int.\n *\n * @private\n */\nexport function parseIntVector(str: string): readonly number[] {\n return str.split(/\\s+/).map((subStr) => parseInt(subStr))\n}\n\n/**\n * Returns the string representation of an int vector value.\n *\n * @param value\n */\nexport function stringifyIntVector(value: readonly number[]): string {\n return value.join(' ')\n}\n\nconst presentationTypeValidator: Validator<PresentationType> = /* @__PURE__ */ isOneOf(\n 'static',\n 'dynamic'\n)\n\n/**\n * Asserts that the given string is one of the {@link PresentationType} enumerated values.\n * @param str\n */\nexport function parsePresentationTypeType(str: string): PresentationType {\n presentationTypeValidator.assert(str, ErrorOrigin.PARSING)\n return str\n}\n\n/**\n * Parses a string into true, false, or a number.\n *\n * @private\n */\nexport function parseConditionalUint(str: string): ConditionalUintType {\n const lower = str.toLowerCase()\n switch (lower) {\n case 'true':\n return true\n case 'false':\n return false\n default:\n return parseInt(str)\n }\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { parseIntSafe } from '@amazon/vinyl-util'\nimport { throwParsingError } from '../error/parsingError'\n\n/**\n * A range of bytes, [from, to (optional, inclusive)].\n */\nexport type ByteRange = readonly [number, number | null]\n\nconst byteRangeExp = /^(-?[0-9]+)-(-?[0-9]*)$/\n\nexport function parseByteRange(str: string): ByteRange {\n const match = str ? byteRangeExp.exec(str) : null\n if (!match) throwParsingError(`invalid byte range: '${str}'`)\n let start = parseInt(match[1])\n // Convert possibly-negative Int32 overflow value to its Uint32 equivalent\n // (reinterpret 32-bit signed integer bits as unsigned)\n if (start < 0) start >>>= 0\n let end = parseIntSafe(match[2])\n if (end != null && end < 0) end = end >>> 0\n return [start, end]\n}\n\n/**\n * Returns the string representation of a {@link ByteRange} value.\n *\n * @param value\n */\nexport function stringifyByteRange(value: ByteRange): string {\n const end = value[1]\n return `${value[0]}-${end == null ? '' : end}`\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { throwParsingError } from '../error/parsingError'\n\n/**\n * A numerator and denominator.\n */\nexport type Ratio = readonly [number, number]\n\n/**\n * The XSD specifies `[0-9]*`, and not `[0-9]+`, which would match `'23:'`\n * For missing dimensions, default to 1.\n */\nconst ratioRegExp = /^([0-9]*):([0-9]*)$/\n\n/**\n * Parses a string representing a ratio into [number, number].\n * The string must satisfy the pattern: `/^([0-9]*):([0-9]*)$/`\n * Examples:\n * ```\n * parseRatio('4:3') // [4, 3]\n * parseRatio('16:9') // [16, 9]\n * parseRatio('2:') // [2, 1]\n * ```\n *\n * @private\n */\nexport function parseRatio(str: string): Ratio {\n const match = str ? ratioRegExp.exec(str) : null\n if (!match) throwParsingError(`invalid ratio format: ${str}`)\n return [parseInt(match[1] || '1'), parseInt(match[2] || '1')]\n}\n\n/**\n * Returns the string representation of a {@link Ratio} value.\n *\n * @param value\n */\nexport function stringifyRatio(value: Ratio): string {\n return `${value[0]}:${value[1]}`\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { throwParsingError } from '../error/parsingError'\n\nexport type FrameRate = readonly [number, number]\n\nconst framerateRegexp = /^(\\d+)(?:\\/(\\d+))?$/\n\n/**\n * Parses a string into a {@link FrameRate}\n *\n * @private\n */\nexport function parseFrameRate(str: string): FrameRate {\n const match = str ? framerateRegexp.exec(str) : null\n if (!match) throwParsingError(`invalid frame rate: '${str}'`)\n return [parseInt(match[1]), parseInt(match[2] || '1')]\n}\n\n/**\n * Returns the string representation of a {@link FrameRate} value.\n *\n * @param value\n */\nexport function stringifyFrameRate(value: FrameRate): string {\n return value[1] === 1 ? value[0].toString() : `${value[0]}/${value[1]}`\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ReservedXmlRuleKeys } from '@amazon/vinyl-xml'\nimport {\n mapXmlRules,\n type Merged,\n mergeXmlRules,\n parseXml,\n ParseXmlHandlerImpl,\n stringifyXml,\n} from '@amazon/vinyl-xml'\nimport type { PlayreadyContentProtection } from '../xmlns/microsoft/playready'\nimport type { CencContentProtection } from '../xmlns/mpeg/cenc/2013'\nimport type {\n DashManifest,\n DescriptorType,\n} from '../xmlns/mpeg/dash/schema/mpd/2011'\nimport { dashManifestXmlRules } from './dashManifestXmlRules'\nimport { cencXmlRules } from './ext/drm/cencXmlRules'\nimport type { DashProtections } from './ext/drm/contentProtection'\nimport { createDashProtectionXmlRules } from './ext/drm/contentProtection'\nimport { playreadyXmlRules } from './ext/drm/playreadyXmlRules'\nimport type { OptionalDeep } from '@amazon/vinyl-util'\n\n/**\n * Creates a Dash Manifest parser with supported extensions.\n *\n * @module\n */\n\nexport type DashDrmManifest = Merged<\n DashManifest & DashProtections<ContentProtection>\n>\n\nexport interface ContentProtection\n extends DescriptorType, CencContentProtection, PlayreadyContentProtection {}\n\nexport const dashDrmRules = /* @__PURE__ */ mergeXmlRules(\n /* @__PURE__ */ dashManifestXmlRules(),\n /* @__PURE__ */ createDashProtectionXmlRules(cencXmlRules),\n /* @__PURE__ */ createDashProtectionXmlRules(playreadyXmlRules)\n)\n\nconst dashDrmRulesMapped = /* @__PURE__ */ mapXmlRules(dashDrmRules)\n\n/**\n * A Content handler for a dash manifest.\n */\nfunction dashManifestHandler() {\n return new ParseXmlHandlerImpl(dashDrmRulesMapped)\n}\n\n/**\n * Parses a Dash Manifest, according to the mpd:2011 schema.\n * @see https://raw.githubusercontent.com/Dash-Industry-Forum/MPEG-Conformance-and-reference-source/master/conformance/MPDValidator/schemas/DASH-MPD.xsd\n * @param manifest\n */\nexport function parseDashManifest(manifest: string): DashDrmManifest {\n return parseXml(manifest, dashManifestHandler())\n}\n\nexport function stringifyDashManifest(\n manifest: OptionalDeep<DashDrmManifest, ReservedXmlRuleKeys>\n): string {\n return stringifyXml(manifest, dashDrmRulesMapped)\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n parseStringVector,\n stringifyStringVector,\n} from '../../dashManifestXmlRules'\nimport type { XmlRules } from '@amazon/vinyl-xml'\nimport { attr, charactersString, element } from '@amazon/vinyl-xml'\nimport type { CencContentProtection } from '../../../xmlns/mpeg/cenc/2013'\nimport { CENC_NAMESPACE_URI } from '../../../xmlns/mpeg/cenc/2013'\n\n/**\n * A parser for ContentProtection elements using the cenc namespace.\n * @see https://github.com/sannies/rtp2dash/blob/master/src/main/resources/auxxsd/cenc.xsd\n */\nexport const cencXmlRules: XmlRules<CencContentProtection> = {\n default_KID: /* @__PURE__ */ attr(parseStringVector, stringifyStringVector, {\n namespaceUri: CENC_NAMESPACE_URI,\n }),\n pssh: /* @__PURE__ */ element(\n {\n _content: charactersString,\n },\n {\n namespaceUri: CENC_NAMESPACE_URI,\n }\n ),\n} as const\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Base64BinaryType } from '@amazon/vinyl-xml'\n\n/**\n * Cenc content protection xml types.\n *\n * @see https://github.com/sannies/rtp2dash/blob/master/src/main/resources/auxxsd/cenc.xsd\n * @module\n */\n\nexport const CENC_NAMESPACE_URI = 'urn:mpeg:cenc:2013'\n\n/**\n * A 128-bit integer written in canonical UUID notation.\n * Must be in the form:\n * `[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}`\n */\nexport type KeyIdType = string\n\nexport interface CencContentProtection {\n readonly default_KID?: readonly KeyIdType[]\n readonly pssh?: Base64BinaryType\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { element, elements, type XmlRules } from '@amazon/vinyl-xml'\nimport { dashNamespaceUri } from '../../dashManifestXmlRules'\n\n/**\n * ContentProtection extension point for Dash manifests.\n *\n * @module\n */\n\nexport interface WithProtections<T> {\n readonly ContentProtection?: readonly T[]\n}\n\nexport interface RepresentationTypeProtections<T> extends WithProtections<T> {\n readonly SubRepresentation?: readonly WithProtections<T>[]\n}\n\nexport interface AdaptationSetProtections<T> extends WithProtections<T> {\n readonly Representation?: readonly RepresentationTypeProtections<T>[]\n}\n\nexport interface PeriodProtections<T> {\n readonly AdaptationSet?: readonly AdaptationSetProtections<T>[]\n}\n\nexport interface MPDProtections<T> {\n readonly Period: readonly PeriodProtections<T>[]\n}\n\nexport interface DashProtections<T> {\n readonly MPD: MPDProtections<T>\n}\n\n/**\n * Creates a dash extension for content protection parsing rules.\n *\n * @param contentProtectionRules Rules to be used when processing `ContentProtection` elements.\n * @return Returns a rules map that should be merged with the dash manifest rules.\n */\nexport function createDashProtectionXmlRules<T extends object>(\n contentProtectionRules: XmlRules<T>\n): XmlRules<DashProtections<T>> {\n const withProtections: XmlRules<WithProtections<T>> = {\n ContentProtection: elements(contentProtectionRules),\n } as const\n\n return {\n MPD: element<MPDProtections<T>>(\n {\n Period: elements<PeriodProtections<T>>(\n {\n AdaptationSet: elements<AdaptationSetProtections<T>>({\n ...withProtections,\n Representation: elements<\n RepresentationTypeProtections<T>\n >({\n ...withProtections,\n SubRepresentation:\n elements<WithProtections<T>>(\n withProtections\n ),\n }),\n }),\n },\n {\n minOccurs: 1,\n }\n ),\n },\n { required: true, namespaceUri: dashNamespaceUri } as const\n ),\n } as const\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { charactersString, element, type XmlRules } from '@amazon/vinyl-xml'\nimport type { PlayreadyContentProtection } from '../../../xmlns/microsoft/playready'\nimport { PLAY_READY_NAMESPACE_URI } from '../../../xmlns/microsoft/playready'\n\nexport const playreadyXmlRules: XmlRules<PlayreadyContentProtection> = {\n pro: /* @__PURE__ */ element(\n {\n _content: charactersString,\n },\n {\n namespaceUri: PLAY_READY_NAMESPACE_URI,\n }\n ),\n} as const\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Base64BinaryType } from '@amazon/vinyl-xml'\n\n/**\n * Cenc content protection playready.\n *\n * @see https://learn.microsoft.com/en-us/playready/specifications/mpeg-dash-playready#21-dash-contentprotection-descriptor-elements\n * @module\n */\n\nexport const PLAY_READY_NAMESPACE_URI = 'urn:microsoft:playready'\n\nexport interface PlayreadyContentProtection {\n readonly pro?: Base64BinaryType\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const ContentProtectionScheme = {\n /**\n * CENC protection scheme. (Should not be used to create a key session)\n */\n CENC: 'urn:mpeg:dash:mp4protection:2011',\n\n /**\n * A simple, unencrypted content protection scheme. Not a full DRM solution.\n */\n CLEAR_KEY: 'urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e',\n\n /**\n * Apple's FairPlay.\n */\n FAIR_PLAY: 'urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2',\n\n /**\n * Open-standards community initiative by Marlin Developer Community.\n */\n MARLIN: 'urn:uuid:5e629af5-38da-4063-8977-97ffbd9902d4',\n\n /**\n * Microsoft's PlayReady.\n */\n PLAY_READY: 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95',\n\n /**\n * An old, unused PlayReady scheme id.\n */\n PLAY_READY_DEPRECATED: 'urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95',\n\n /**\n * Google's Widevine.\n */\n WIDEVINE: 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed',\n} as const\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAKA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AAA;AAAA,EAKR,YAAY;AAAA;AAAA;AAAA;AAAA,EAKZ,uBAAuB;AAAA;AAAA;AAAA;AAAA,EAKvB,UAAU;AACd;",
6
- "names": ["ErrorOrigin", "ValidationError", "ErrorOrigin", "ErrorOrigin", "number", "attr", "charactersString", "element", "attr", "element", "charactersString", "element", "elements", "elements", "element", "charactersString", "element", "element", "charactersString"]
3
+ "sources": ["../src/duration/duration.ts", "../src/error/parsingError.ts", "../src/manifest/dashManifestXmlRules.ts", "../src/media/byteRange.ts", "../src/media/ratio.ts", "../src/media/frameRate.ts", "../src/manifest/dashParser.ts", "../src/manifest/ext/drm/cencXmlRules.ts", "../src/xmlns/mpeg/cenc/2013.ts", "../src/manifest/ext/drm/contentProtection.ts", "../src/manifest/ext/drm/playreadyXmlRules.ts", "../src/xmlns/microsoft/playready.ts", "../src/manifest/ext/events/scte35XmlRules.ts", "../src/xmlns/scte/35/2016.ts", "../src/manifest/ext/drm/ContentProtectionScheme.ts"],
4
+ "sourcesContent": ["/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n ErrorOrigin,\n roundToNearest,\n ValidationError,\n} from '@amazon/vinyl-util'\n\n// ESBuild (https://github.com/evanw/esbuild/issues/3988) considers multiplication and division\n// to have a side effect and will inhibit tree shaking.\n// E.g. H = 60 * 60 will not be removed when not referenced.\nconst I = 60\nconst H = 3600\nconst D = 86400\nconst M = 2592000\nconst Y = 31536000\n\n/**\n * A duration, in seconds. (This may be negative)\n */\nexport type Duration = number\n\n/**\n * https://www.w3.org/TR/xmlschema-2/#duration\n */\nconst iso8601Duration =\n /^(-?)P?(\\d+(?:\\.\\d*)?Y)?(\\d+(?:\\.\\d*)?M)?(\\d+(?:\\.\\d*)?D)?T?(\\d+(?:\\.\\d*)?H)?(\\d+(?:\\.\\d*)?M)?(\\d+(?:\\.\\d*)?S?)?$/i\n\n/**\n * Parses an ISO 8601 duration into seconds.\n * The accepted format is P(n)Y(n)M(n)DT(n)H(n)M(n)S\n *\n * All units shall have a fixed size.\n *\n * P - Period designator, precedes all durations.\n * 1Y (Year) = 365 * 24 * 60 * 60 Seconds\n * 1M (Month) = 30 * 24 * 60 * 60 Seconds\n * 1D (Day) = 24 * 60 * 60 Seconds\n *\n * T - Time designator, precedes all time components.\n * 1H (Hour) = 60 * 60 Seconds\n * 1M (Minute) = 60 Seconds\n * 1S (Second)\n *\n *\n * @param value\n * @return Returns the duration in seconds or throws an {@link ValidationError}\n * if not properly formatted.\n * @see https://www.w3.org/TR/xmlschema-2/#duration\n */\nexport function parseDuration(value: string): Duration {\n const match = iso8601Duration.exec(value)\n if (match == null)\n throw new ValidationError(\n `Unexpected duration: '${value}', should be in iso 8601 format`,\n ErrorOrigin.PARSING\n )\n\n const sign = match[1] === '-' ? -1 : 1\n return (\n sign *\n (parseFloat(match[2] || '0') * Y +\n parseFloat(match[3] || '0') * M +\n parseFloat(match[4] || '0') * D +\n parseFloat(match[5] || '0') * H +\n parseFloat(match[6] || '0') * I +\n parseFloat(match[7] || '0'))\n )\n}\n\n/**\n * Returns the iso 8601 string representation of a duration value.\n *\n * @param value A duration value, in seconds.\n */\nexport function stringifyDuration(value: Duration): string {\n const sign = value < 0 ? '-' : ''\n let abs = Math.abs(value)\n\n const years = Math.floor(abs / Y)\n abs -= years * Y\n const months = Math.floor(abs / M)\n const days = Math.floor((abs % M) / D)\n const hours = Math.floor((abs % D) / H)\n const minutes = Math.floor((abs % H) / I)\n const seconds = abs % I\n\n let date = ''\n if (years > 0) date += `${years}Y`\n if (months > 0) date += `${months}M`\n if (days > 0) date += `${days}D`\n let time = ''\n if (hours > 0) time += `${hours}H`\n if (minutes > 0) time += `${minutes}M`\n if (seconds > 0) time += `${roundToNearest(seconds, 0.001)}S`\n // A duration must carry at least one component, so a zero duration is\n // written as `PT0S`. The time designator is only written when a time\n // component follows it; a trailing `T` is not a valid duration.\n if (!date && !time) time = '0S'\n return `${sign}P${date}${time && `T${time}`}`\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ErrorOrigin, ValidationError } from '@amazon/vinyl-util'\n\nexport function throwParsingError(message: string): never {\n throw new ValidationError(message, ErrorOrigin.PARSING)\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Parser definitions for a dash manifest.\n * Attribute order does not matter, element order matters for writing.\n *\n * @module\n */\n\nimport type { actuateType, UriType } from '@amazon/vinyl-xml'\nimport {\n assertActuateEnum,\n attr,\n attrBoolean,\n attrDateTime,\n attrFloat,\n attrInt,\n attrString,\n charactersString,\n element,\n elements,\n type XmlRules,\n} from '@amazon/vinyl-xml'\nimport { ErrorOrigin, stringify } from '@amazon/vinyl-util'\nimport { isOneOf, number, type Validator } from '@amazon/vinyl-validation'\nimport { parseDuration, stringifyDuration } from '../duration/duration'\nimport { parseByteRange, stringifyByteRange } from '../media/byteRange'\nimport { parseRatio, stringifyRatio } from '../media/ratio'\nimport { parseFrameRate, stringifyFrameRate } from '../media/frameRate'\nimport type {\n AdaptationSetType,\n AlternativePresentationType,\n BaseURLType,\n ConditionalUintType,\n ContentComponentType,\n DashManifest,\n DescriptorType,\n EventStreamType,\n EventType,\n ImportedMpdType,\n MetricsType,\n MPDtype,\n MultipleSegmentBaseType,\n PeriodType,\n PresentationType,\n ProgramInformationType,\n RangeType,\n RepresentationBaseType,\n RepresentationType,\n SegmentBaseType,\n SegmentListType,\n SegmentTemplateType,\n SegmentTimelineType,\n SegmentTimelineTypeSType,\n SegmentURLType,\n SubRepresentationType,\n SubsetType,\n SwitchingType,\n SwitchingTypeType,\n URLType,\n VideoScanType,\n} from '../xmlns/mpeg/dash/schema/mpd/2011'\n\nexport const dashNamespaceUri = 'urn:mpeg:dash:schema:mpd:2011'\n\n/**\n * The XLink namespace of remote element `xlink:href` and `xlink:actuate`\n * attributes.\n */\nexport const XLINK_NAMESPACE_URI = 'http://www.w3.org/1999/xlink'\n\nexport function dashManifestXmlRules(): XmlRules<DashManifest> {\n const attrActuateType = attr<actuateType>(assertActuateEnum, stringify, {\n default: 'onRequest',\n namespaceUri: XLINK_NAMESPACE_URI,\n } as const)\n const attrHref = attrString({ namespaceUri: XLINK_NAMESPACE_URI })\n\n const descriptorType: XmlRules<DescriptorType> = {\n id: attrString,\n schemeIdUri: attrString({ required: true }),\n value: attrString,\n } as const\n\n const baseURLType: XmlRules<BaseURLType> = {\n availabilityTimeComplete: attrBoolean,\n availabilityTimeOffset: attrFloat,\n byteRange: attrString,\n serviceLocation: attrString,\n _content: charactersString,\n } as const\n\n const contentComponentType: XmlRules<ContentComponentType> = {\n contentType: attrString,\n id: attrInt,\n lang: attrString,\n par: attr(parseRatio, stringifyRatio),\n Accessibility: elements(descriptorType),\n Rating: elements(descriptorType),\n Role: elements(descriptorType),\n Viewpoint: elements(descriptorType),\n } as const\n\n const urlType: XmlRules<URLType> = {\n range: attr(parseByteRange, stringifyByteRange),\n sourceURL: attrString,\n } as const\n\n const uriType: XmlRules<UriType> = { _content: charactersString } as const\n\n const segmentBaseType: XmlRules<SegmentBaseType> = {\n Initialization: element(urlType),\n RepresentationIndex: element(urlType),\n availabilityTimeComplete: attrBoolean,\n availabilityTimeOffset: attrInt,\n indexRange: attr(parseByteRange, stringifyByteRange),\n indexRangeExact: attrBoolean({ default: false }),\n presentationTimeOffset: attrFloat,\n timescale: attrInt,\n } as const\n\n const segmentTimelineTypeSType: XmlRules<SegmentTimelineTypeSType> = {\n d: attrInt({ required: true }),\n n: attrInt,\n r: attrInt({ default: 0 }),\n t: attrInt,\n } as const\n\n const segmentTimelineType: XmlRules<SegmentTimelineType> = {\n S: elements(segmentTimelineTypeSType),\n } as const\n\n const multipleSegmentBaseType: XmlRules<MultipleSegmentBaseType> = {\n ...segmentBaseType,\n SegmentTimeline: element(segmentTimelineType),\n BitstreamSwitching: element(urlType),\n duration: attrInt,\n startNumber: attrInt,\n } as const\n\n const segmentURLType: XmlRules<SegmentURLType> = {\n index: attrString,\n indexRange: attr(parseByteRange, stringifyByteRange),\n media: attrString,\n mediaRange: attr(parseByteRange, stringifyByteRange),\n } as const\n\n const segmentListType: XmlRules<SegmentListType> = {\n ...multipleSegmentBaseType,\n actuate: attrActuateType,\n href: attrHref,\n SegmentURL: elements(segmentURLType),\n } as const\n\n const segmentTemplateType: XmlRules<SegmentTemplateType> = {\n ...multipleSegmentBaseType,\n bitstreamSwitching: attrString,\n index: attrString,\n initialization: attrString,\n media: attrString,\n } as const\n\n const subsetType: XmlRules<SubsetType> = {\n contains: attr(parseIntVector, stringifyIntVector, { required: true }),\n id: attrString,\n } as const\n\n const alternativePresentationType: XmlRules<AlternativePresentationType> = {\n uri: attrString,\n maxDuration: attrInt,\n earliestResolutionTimeOffset: attrInt,\n returnOffset: attrInt,\n clip: attrBoolean,\n startWithOffset: attrBoolean,\n } as const\n\n const eventType: XmlRules<EventType> = {\n duration: attrInt,\n id: attrInt,\n messageData: attrString,\n presentationTime: attrInt({ default: 0 }),\n contentEncoding: attrString,\n _content: charactersString,\n InsertPresentation: element(alternativePresentationType),\n ReplacePresentation: element(alternativePresentationType),\n } as const\n\n const eventStreamType: XmlRules<EventStreamType> = {\n Event: elements(eventType),\n actuate: attrActuateType,\n href: attrHref,\n messageData: attrString,\n schemeIdUri: attrString({ required: true }),\n timescale: attrInt,\n presentationTimeOffset: attrInt,\n value: attrString,\n } as const\n\n const switchingType: XmlRules<SwitchingType> = {\n interval: attrInt({ required: true }),\n type: attr(parseSwitchingTypeType, stringify),\n } as const\n\n const representationBaseType: XmlRules<RepresentationBaseType> = {\n FramePacking: elements(descriptorType),\n AudioChannelConfiguration: elements(descriptorType),\n ContentProtection: elements(descriptorType),\n EssentialProperty: elements(descriptorType),\n SupplementalProperty: elements(descriptorType),\n InbandEventStream: elements(eventStreamType),\n Switching: elements(switchingType),\n audioSamplingRate: attr(parseIntVector, stringifyIntVector),\n codecs: attrString,\n codingDependency: attrBoolean,\n frameRate: attr(parseFrameRate, stringifyFrameRate),\n height: attrInt,\n maximumSAPPeriod: attrInt,\n maxPlayoutRate: attrInt,\n mimeType: attrString,\n profiles: attr(parseProfiles, stringifyProfiles),\n sar: attr(parseRatio, stringifyRatio),\n scanType: attr(parseVideoScan, stringify),\n segmentProfiles: attrString,\n startWithSAP: attr(parseSap, stringify),\n width: attrInt,\n } as const\n\n const subRepresentationType: XmlRules<SubRepresentationType> = {\n ...representationBaseType,\n bandwidth: attrInt,\n contentComponent: attr(parseStringVector, stringifyStringVector),\n dependencyLevel: attr(parseIntVector, stringifyIntVector),\n level: attrInt,\n } as const\n\n const representationType: XmlRules<RepresentationType> = {\n ...representationBaseType,\n bandwidth: attrInt({ required: true }),\n bitrate: attrInt,\n dependencyId: attr(parseStringVector, stringifyStringVector),\n id: attrString({ required: true }),\n mediaStreamStructureId: attr(parseStringVector, stringifyStringVector),\n qualityRanking: attrInt,\n BaseURL: elements(baseURLType),\n SegmentBase: element(segmentBaseType),\n SegmentList: element(segmentListType),\n SegmentTemplate: element(segmentTemplateType),\n SubRepresentation: elements(subRepresentationType),\n } as const\n\n const adaptationSetType: XmlRules<AdaptationSetType> = {\n ...representationBaseType,\n Accessibility: elements(descriptorType),\n Role: elements(descriptorType),\n Rating: elements(descriptorType),\n Viewpoint: elements(descriptorType),\n ContentComponent: elements(contentComponentType),\n BaseURL: elements(baseURLType),\n SegmentBase: element(segmentBaseType),\n SegmentList: element(segmentListType),\n SegmentTemplate: element(segmentTemplateType),\n Representation: elements(representationType),\n actuate: attrActuateType,\n bitstreamSwitching: attrBoolean,\n contentType: attrString,\n group: attrInt,\n href: attrHref,\n id: attrInt,\n lang: attrString,\n maxBandwidth: attrInt,\n maxFrameRate: attr(parseFrameRate, stringifyFrameRate),\n maxHeight: attrInt,\n maxWidth: attrInt,\n minBandwidth: attrInt,\n minFrameRate: attr(parseFrameRate, stringifyFrameRate),\n minHeight: attrInt,\n minWidth: attrInt,\n par: attr(parseRatio, stringifyRatio),\n segmentAlignment: attr(parseConditionalUint, stringify, {\n default: false,\n }),\n selectionPriority: attrInt({\n default: 1,\n }),\n subsegmentAlignment: attr(parseConditionalUint, stringify, {\n default: false,\n }),\n subsegmentStartsWithSAP: attr(parseSap, stringify, { default: 0 }),\n } as const\n\n const rangeType: XmlRules<RangeType> = {\n duration: attr(parseDuration, stringifyDuration),\n starttime: attr(parseDuration, stringifyDuration),\n } as const\n\n const metricsType: XmlRules<MetricsType> = {\n metrics: attrString({ required: true }),\n Range: elements(rangeType),\n Reporting: elements(descriptorType, { minOccurs: 1 }),\n } as const\n\n const importedMpdType: XmlRules<ImportedMpdType> = {\n earliestResolutionTimeOffset: attrFloat,\n _content: charactersString,\n } as const\n\n const periodType: XmlRules<PeriodType> = {\n BaseURL: elements(baseURLType),\n SegmentBase: element(segmentBaseType),\n SegmentList: element(segmentListType),\n SegmentTemplate: element(segmentTemplateType),\n AssetIdentifier: element(descriptorType),\n EventStream: elements(eventStreamType),\n AdaptationSet: elements(adaptationSetType),\n Subset: elements(subsetType),\n SupplementalProperty: elements(descriptorType),\n ImportedMPD: element(importedMpdType),\n actuate: attrActuateType,\n bitstreamSwitching: attrBoolean({ default: false }),\n duration: attr(parseDuration, stringifyDuration),\n href: attrHref,\n id: attrString,\n start: attr(parseDuration, stringifyDuration),\n } as const\n\n const programInformationType: XmlRules<ProgramInformationType> = {\n lang: attrString,\n moreInformationURL: attrString,\n Copyright: attrString,\n Source: attrString,\n Title: attrString,\n } as const\n\n const mpdType: XmlRules<MPDtype> = {\n ProgramInformation: elements(programInformationType),\n BaseURL: elements(baseURLType),\n Location: elements(uriType),\n Period: elements(periodType, { minOccurs: 1 }),\n Metrics: elements(metricsType),\n EssentialProperty: elements(descriptorType),\n SupplementalProperty: elements(descriptorType),\n UTCTiming: elements(descriptorType),\n availabilityEndTime: attrDateTime,\n availabilityStartTime: attrDateTime,\n id: attrString,\n maxSegmentDuration: attr(parseDuration, stringifyDuration),\n maxSubsegmentDuration: attr(parseDuration, stringifyDuration),\n mediaPresentationDuration: attr(parseDuration, stringifyDuration),\n minBufferTime: attr(parseDuration, stringifyDuration, {\n required: true,\n }),\n minimumUpdatePeriod: attr(parseDuration, stringifyDuration),\n profiles: attr(parseProfiles, stringifyProfiles, { required: true }),\n publishTime: attrDateTime,\n suggestedPresentationDelay: attr(parseDuration, stringifyDuration),\n timeShiftBufferDepth: attr(parseDuration, stringifyDuration),\n type: attr(parsePresentationTypeType, stringify, {\n default: 'static',\n } as const),\n } as const\n\n return {\n MPD: element(mpdType, {\n required: true,\n namespaceUri: dashNamespaceUri,\n }),\n } as const\n}\n\n/**\n * Parses a comma delimited list of profiles.\n * Profile values are not whitespace trimmed.\n *\n * @param str\n */\nexport function parseProfiles(str: string): readonly string[] {\n return str.split(',')\n}\n\n/**\n * Returns the string representation of a {@link FrameRate} value.\n *\n * @param value\n */\nexport function stringifyProfiles(value: readonly string[]): string {\n return value.join(',')\n}\n\nconst videoScanTypeValidator: Validator<VideoScanType> = /* @__PURE__ */ isOneOf(\n 'progressive',\n 'interlaced',\n 'unknown'\n)\n\n/**\n * @private\n */\nexport function parseVideoScan(str: string): VideoScanType {\n videoScanTypeValidator.assert(str, ErrorOrigin.PARSING)\n return str\n}\n\nconst switchingTypeTypeValidator: Validator<SwitchingTypeType> = /* @__PURE__ */ isOneOf(\n 'media',\n 'bitstream'\n)\n\n/**\n * @private\n */\nexport function parseSwitchingTypeType(str: string): SwitchingTypeType {\n switchingTypeTypeValidator.assert(str, ErrorOrigin.PARSING)\n return str\n}\n\nconst validateSap: Validator<number> = /* @__PURE__ */ /* @__PURE__ */ number().within(0, 6)\n\n/**\n * @private\n */\nexport function parseSap(str: string): number {\n const number = parseInt(str)\n validateSap.assert(number, ErrorOrigin.PARSING)\n return number\n}\n\n/**\n * Splits a string by whitespace.\n *\n * @private\n */\nexport function parseStringVector(str: string): readonly string[] {\n return str.split(/\\s+/)\n}\n\n/**\n * Returns the string representation of a string vector value.\n *\n * @param value\n */\nexport function stringifyStringVector(value: readonly string[]): string {\n return value.join(' ')\n}\n\n/**\n * Splits a string by whitespace and parses as int.\n *\n * @private\n */\nexport function parseIntVector(str: string): readonly number[] {\n return str.split(/\\s+/).map((subStr) => parseInt(subStr))\n}\n\n/**\n * Returns the string representation of an int vector value.\n *\n * @param value\n */\nexport function stringifyIntVector(value: readonly number[]): string {\n return value.join(' ')\n}\n\nconst presentationTypeValidator: Validator<PresentationType> = /* @__PURE__ */ isOneOf(\n 'static',\n 'dynamic',\n 'list'\n)\n\n/**\n * Asserts that the given string is one of the {@link PresentationType} enumerated values.\n * @param str\n */\nexport function parsePresentationTypeType(str: string): PresentationType {\n presentationTypeValidator.assert(str, ErrorOrigin.PARSING)\n return str\n}\n\n/**\n * Parses a string into true, false, or a number.\n *\n * @private\n */\nexport function parseConditionalUint(str: string): ConditionalUintType {\n const lower = str.toLowerCase()\n switch (lower) {\n case 'true':\n return true\n case 'false':\n return false\n default:\n return parseInt(str)\n }\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { parseIntSafe } from '@amazon/vinyl-util'\nimport { throwParsingError } from '../error/parsingError'\n\n/**\n * A range of bytes, [from, to (optional, inclusive)].\n */\nexport type ByteRange = readonly [number, number | null]\n\nconst byteRangeExp = /^(-?[0-9]+)-(-?[0-9]*)$/\n\nexport function parseByteRange(str: string): ByteRange {\n const match = str ? byteRangeExp.exec(str) : null\n if (!match) throwParsingError(`invalid byte range: '${str}'`)\n let start = parseInt(match[1])\n // Convert possibly-negative Int32 overflow value to its Uint32 equivalent\n // (reinterpret 32-bit signed integer bits as unsigned)\n if (start < 0) start >>>= 0\n let end = parseIntSafe(match[2])\n if (end != null && end < 0) end = end >>> 0\n return [start, end]\n}\n\n/**\n * Returns the string representation of a {@link ByteRange} value.\n *\n * @param value\n */\nexport function stringifyByteRange(value: ByteRange): string {\n const end = value[1]\n return `${value[0]}-${end == null ? '' : end}`\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { throwParsingError } from '../error/parsingError'\n\n/**\n * A numerator and denominator.\n */\nexport type Ratio = readonly [number, number]\n\n/**\n * The XSD specifies `[0-9]*`, and not `[0-9]+`, which would match `'23:'`\n * For missing dimensions, default to 1.\n */\nconst ratioRegExp = /^([0-9]*):([0-9]*)$/\n\n/**\n * Parses a string representing a ratio into [number, number].\n * The string must satisfy the pattern: `/^([0-9]*):([0-9]*)$/`\n * Examples:\n * ```\n * parseRatio('4:3') // [4, 3]\n * parseRatio('16:9') // [16, 9]\n * parseRatio('2:') // [2, 1]\n * ```\n *\n * @private\n */\nexport function parseRatio(str: string): Ratio {\n const match = str ? ratioRegExp.exec(str) : null\n if (!match) throwParsingError(`invalid ratio format: ${str}`)\n return [parseInt(match[1] || '1'), parseInt(match[2] || '1')]\n}\n\n/**\n * Returns the string representation of a {@link Ratio} value.\n *\n * @param value\n */\nexport function stringifyRatio(value: Ratio): string {\n return `${value[0]}:${value[1]}`\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { throwParsingError } from '../error/parsingError'\n\nexport type FrameRate = readonly [number, number]\n\nconst framerateRegexp = /^(\\d+)(?:\\/(\\d+))?$/\n\n/**\n * Parses a string into a {@link FrameRate}\n *\n * @private\n */\nexport function parseFrameRate(str: string): FrameRate {\n const match = str ? framerateRegexp.exec(str) : null\n if (!match) throwParsingError(`invalid frame rate: '${str}'`)\n return [parseInt(match[1]), parseInt(match[2] || '1')]\n}\n\n/**\n * Returns the string representation of a {@link FrameRate} value.\n *\n * @param value\n */\nexport function stringifyFrameRate(value: FrameRate): string {\n return value[1] === 1 ? value[0].toString() : `${value[0]}/${value[1]}`\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ReservedXmlRuleKeys } from '@amazon/vinyl-xml'\nimport {\n mapXmlRules,\n type Merged,\n mergeXmlRules,\n parseXml,\n ParseXmlHandlerImpl,\n stringifyXml,\n} from '@amazon/vinyl-xml'\nimport type { PlayreadyContentProtection } from '../xmlns/microsoft/playready'\nimport type { CencContentProtection } from '../xmlns/mpeg/cenc/2013'\nimport type {\n DashManifest,\n DescriptorType,\n} from '../xmlns/mpeg/dash/schema/mpd/2011'\nimport { dashManifestXmlRules } from './dashManifestXmlRules'\nimport { cencXmlRules } from './ext/drm/cencXmlRules'\nimport type { DashProtections } from './ext/drm/contentProtection'\nimport { createDashProtectionXmlRules } from './ext/drm/contentProtection'\nimport { playreadyXmlRules } from './ext/drm/playreadyXmlRules'\nimport {\n createDashScte35EventXmlRules,\n type DashScte35Events,\n} from './ext/events/scte35XmlRules'\nimport type { OptionalDeep } from '@amazon/vinyl-util'\n\n/**\n * Creates a Dash Manifest parser with supported extensions.\n *\n * @module\n */\n\nexport type DashDrmManifest = Merged<\n DashManifest & DashProtections<ContentProtection> & DashScte35Events\n>\n\nexport interface ContentProtection\n extends DescriptorType, CencContentProtection, PlayreadyContentProtection {}\n\nexport const dashDrmRules = /* @__PURE__ */ mergeXmlRules(\n /* @__PURE__ */ dashManifestXmlRules(),\n /* @__PURE__ */ createDashProtectionXmlRules(cencXmlRules),\n /* @__PURE__ */ createDashProtectionXmlRules(playreadyXmlRules),\n /* @__PURE__ */ createDashScte35EventXmlRules()\n)\n\nconst dashDrmRulesMapped = /* @__PURE__ */ mapXmlRules(dashDrmRules)\n\n/**\n * A Content handler for a dash manifest.\n */\nfunction dashManifestHandler() {\n return new ParseXmlHandlerImpl(dashDrmRulesMapped)\n}\n\n/**\n * Parses a Dash Manifest, according to the mpd:2011 schema.\n * @see https://raw.githubusercontent.com/Dash-Industry-Forum/MPEG-Conformance-and-reference-source/master/conformance/MPDValidator/schemas/DASH-MPD.xsd\n * @param manifest\n */\nexport function parseDashManifest(manifest: string): DashDrmManifest {\n return parseXml(manifest, dashManifestHandler())\n}\n\nexport function stringifyDashManifest(\n manifest: OptionalDeep<DashDrmManifest, ReservedXmlRuleKeys>\n): string {\n return stringifyXml(manifest, dashDrmRulesMapped)\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n parseStringVector,\n stringifyStringVector,\n} from '../../dashManifestXmlRules'\nimport type { XmlRules } from '@amazon/vinyl-xml'\nimport { attr, charactersString, element } from '@amazon/vinyl-xml'\nimport type { CencContentProtection } from '../../../xmlns/mpeg/cenc/2013'\nimport { CENC_NAMESPACE_URI } from '../../../xmlns/mpeg/cenc/2013'\n\n/**\n * A parser for ContentProtection elements using the cenc namespace.\n * @see https://github.com/sannies/rtp2dash/blob/master/src/main/resources/auxxsd/cenc.xsd\n */\nexport const cencXmlRules: XmlRules<CencContentProtection> = {\n default_KID: /* @__PURE__ */ attr(parseStringVector, stringifyStringVector, {\n namespaceUri: CENC_NAMESPACE_URI,\n }),\n pssh: /* @__PURE__ */ element(\n {\n _content: charactersString,\n },\n {\n namespaceUri: CENC_NAMESPACE_URI,\n }\n ),\n} as const\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Base64BinaryType } from '@amazon/vinyl-xml'\n\n/**\n * Cenc content protection xml types.\n *\n * @see https://github.com/sannies/rtp2dash/blob/master/src/main/resources/auxxsd/cenc.xsd\n * @module\n */\n\nexport const CENC_NAMESPACE_URI = 'urn:mpeg:cenc:2013'\n\n/**\n * A 128-bit integer written in canonical UUID notation.\n * Must be in the form:\n * `[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}`\n */\nexport type KeyIdType = string\n\nexport interface CencContentProtection {\n readonly default_KID?: readonly KeyIdType[]\n readonly pssh?: Base64BinaryType\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { element, elements, type XmlRules } from '@amazon/vinyl-xml'\nimport { dashNamespaceUri } from '../../dashManifestXmlRules'\n\n/**\n * ContentProtection extension point for Dash manifests.\n *\n * @module\n */\n\nexport interface WithProtections<T> {\n readonly ContentProtection?: readonly T[]\n}\n\nexport interface RepresentationTypeProtections<T> extends WithProtections<T> {\n readonly SubRepresentation?: readonly WithProtections<T>[]\n}\n\nexport interface AdaptationSetProtections<T> extends WithProtections<T> {\n readonly Representation?: readonly RepresentationTypeProtections<T>[]\n}\n\nexport interface PeriodProtections<T> {\n readonly AdaptationSet?: readonly AdaptationSetProtections<T>[]\n}\n\nexport interface MPDProtections<T> {\n readonly Period: readonly PeriodProtections<T>[]\n}\n\nexport interface DashProtections<T> {\n readonly MPD: MPDProtections<T>\n}\n\n/**\n * Creates a dash extension for content protection parsing rules.\n *\n * @param contentProtectionRules Rules to be used when processing `ContentProtection` elements.\n * @return Returns a rules map that should be merged with the dash manifest rules.\n */\nexport function createDashProtectionXmlRules<T extends object>(\n contentProtectionRules: XmlRules<T>\n): XmlRules<DashProtections<T>> {\n const withProtections: XmlRules<WithProtections<T>> = {\n ContentProtection: elements(contentProtectionRules),\n } as const\n\n return {\n MPD: element<MPDProtections<T>>(\n {\n Period: elements<PeriodProtections<T>>(\n {\n AdaptationSet: elements<AdaptationSetProtections<T>>({\n ...withProtections,\n Representation: elements<\n RepresentationTypeProtections<T>\n >({\n ...withProtections,\n SubRepresentation:\n elements<WithProtections<T>>(\n withProtections\n ),\n }),\n }),\n },\n {\n minOccurs: 1,\n }\n ),\n },\n { required: true, namespaceUri: dashNamespaceUri } as const\n ),\n } as const\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { charactersString, element, type XmlRules } from '@amazon/vinyl-xml'\nimport type { PlayreadyContentProtection } from '../../../xmlns/microsoft/playready'\nimport { PLAY_READY_NAMESPACE_URI } from '../../../xmlns/microsoft/playready'\n\nexport const playreadyXmlRules: XmlRules<PlayreadyContentProtection> = {\n pro: /* @__PURE__ */ element(\n {\n _content: charactersString,\n },\n {\n namespaceUri: PLAY_READY_NAMESPACE_URI,\n }\n ),\n} as const\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Base64BinaryType } from '@amazon/vinyl-xml'\n\n/**\n * Cenc content protection playready.\n *\n * @see https://learn.microsoft.com/en-us/playready/specifications/mpeg-dash-playready#21-dash-contentprotection-descriptor-elements\n * @module\n */\n\nexport const PLAY_READY_NAMESPACE_URI = 'urn:microsoft:playready'\n\nexport interface PlayreadyContentProtection {\n readonly pro?: Base64BinaryType\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n attrBoolean,\n attrInt,\n attrString,\n charactersString,\n element,\n elements,\n type XmlRules,\n} from '@amazon/vinyl-xml'\nimport { dashNamespaceUri } from '../../dashManifestXmlRules'\nimport {\n SCTE35_2016_NAMESPACE_URI,\n type Scte35BinaryType,\n type Scte35BreakDurationType,\n type Scte35ProgramType,\n type Scte35SegmentationDescriptorType,\n type Scte35SegmentationUpidType,\n type Scte35SpliceInsertType,\n type Scte35SpliceNullType,\n type Scte35TimeSignalType,\n type Scte35SignalType,\n type Scte35SpliceInfoSectionType,\n type Scte35SpliceTimeType,\n} from '../../../xmlns/scte/35/2016'\n\n/**\n * The SCTE-35 bodies of an MPD `Event`, per SCTE 214-1.\n */\nexport interface Scte35Event {\n /** The body of a `urn:scte:scte35:2014:xml+bin` event. */\n readonly Signal?: Scte35SignalType\n\n /** The body of a `urn:scte:scte35:2013:xml` event. */\n readonly SpliceInfoSection?: Scte35SpliceInfoSectionType\n}\n\nexport interface EventStreamScte35Events {\n readonly Event?: readonly Scte35Event[]\n}\n\nexport interface PeriodScte35Events {\n readonly EventStream?: readonly EventStreamScte35Events[]\n}\n\nexport interface MPDScte35Events {\n readonly Period: readonly PeriodScte35Events[]\n}\n\nexport interface DashScte35Events {\n readonly MPD: MPDScte35Events\n}\n\nconst options = { namespaceUri: SCTE35_2016_NAMESPACE_URI } as const\n\nconst spliceTimeType: XmlRules<Scte35SpliceTimeType> = {\n ptsTime: attrInt,\n} as const\n\nconst segmentationUpidType: XmlRules<Scte35SegmentationUpidType> = {\n segmentationUpidType: attrInt,\n segmentationUpidFormat: attrString,\n _content: charactersString,\n} as const\n\nconst segmentationDescriptorType: XmlRules<Scte35SegmentationDescriptorType> = {\n segmentationEventId: attrInt,\n segmentationEventCancelIndicator: attrBoolean,\n segmentationDuration: attrInt,\n segmentationTypeId: attrInt,\n segmentNum: attrInt,\n segmentsExpected: attrInt,\n SegmentationUpid: /* @__PURE__ */ elements(segmentationUpidType, options),\n} as const\n\nconst programType: XmlRules<Scte35ProgramType> = {\n SpliceTime: /* @__PURE__ */ element(spliceTimeType, options),\n} as const\n\nconst breakDurationType: XmlRules<Scte35BreakDurationType> = {\n autoReturn: attrBoolean,\n duration: attrInt,\n} as const\n\nconst spliceInsertType: XmlRules<Scte35SpliceInsertType> = {\n spliceEventId: attrInt,\n spliceEventCancelIndicator: attrBoolean,\n outOfNetworkIndicator: attrBoolean,\n spliceImmediateFlag: attrBoolean,\n uniqueProgramId: attrInt,\n availNum: attrInt,\n availsExpected: attrInt,\n Program: /* @__PURE__ */ element(programType, options),\n BreakDuration: /* @__PURE__ */ element(breakDurationType, options),\n} as const\n\nconst timeSignalType: XmlRules<Scte35TimeSignalType> = {\n SpliceTime: /* @__PURE__ */ element(spliceTimeType, options),\n} as const\n\nconst spliceNullType: XmlRules<Scte35SpliceNullType> = {} as const\n\nconst spliceInfoSectionType: XmlRules<Scte35SpliceInfoSectionType> = {\n ptsAdjustment: attrInt,\n tier: attrInt,\n SpliceNull: /* @__PURE__ */ element(spliceNullType, options),\n SpliceInsert: /* @__PURE__ */ element(spliceInsertType, options),\n TimeSignal: /* @__PURE__ */ element(timeSignalType, options),\n SegmentationDescriptor: /* @__PURE__ */ elements(segmentationDescriptorType, options),\n} as const\n\nconst binaryType: XmlRules<Scte35BinaryType> = {\n _content: charactersString,\n} as const\n\nconst signalType: XmlRules<Scte35SignalType> = {\n Binary: /* @__PURE__ */ element(binaryType, options),\n} as const\n\n/**\n * Parsing rules for SCTE-35 MPD events, in the SCTE-35 2016 XML namespace.\n */\nexport const scte35EventXmlRules: XmlRules<Scte35Event> = {\n Signal: /* @__PURE__ */ element(signalType, options),\n SpliceInfoSection: /* @__PURE__ */ element(spliceInfoSectionType, options),\n} as const\n\n/**\n * Creates the rules map for SCTE-35 MPD event bodies, to be merged with the\n * dash manifest rules.\n */\nexport function createDashScte35EventXmlRules(): XmlRules<DashScte35Events> {\n return {\n MPD: element<MPDScte35Events>(\n {\n Period: elements<PeriodScte35Events>(\n {\n EventStream: elements<EventStreamScte35Events>({\n Event: elements(scte35EventXmlRules),\n }),\n },\n { minOccurs: 1 }\n ),\n },\n { required: true, namespaceUri: dashNamespaceUri } as const\n ),\n } as const\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * SCTE-35 XML types, as carried in DASH MPD events per SCTE 214-1.\n *\n * Only the elements and attributes that describe ad avails are modeled.\n *\n * @see https://www.scte.org/standards/library/catalog/scte-35-digital-program-insertion-cueing-message/\n * @module\n */\n\nexport const SCTE35_2016_NAMESPACE_URI = 'http://www.scte.org/schemas/35/2016'\n\n/**\n * `scte35:Signal`, the event body of the `urn:scte:scte35:2014:xml+bin`\n * scheme: a binary `splice_info_section`, base64 encoded.\n */\nexport interface Scte35SignalType {\n readonly Binary?: Scte35BinaryType\n}\n\nexport interface Scte35BinaryType {\n /** The base64 encoded `splice_info_section`. */\n readonly _content?: string\n}\n\n/**\n * `scte35:SpliceInfoSection`, the event body of the `urn:scte:scte35:2013:xml`\n * scheme.\n */\nexport interface Scte35SpliceInfoSectionType {\n readonly ptsAdjustment?: number\n readonly tier?: number\n readonly SpliceNull?: Scte35SpliceNullType\n readonly SpliceInsert?: Scte35SpliceInsertType\n readonly TimeSignal?: Scte35TimeSignalType\n readonly SegmentationDescriptor?: readonly Scte35SegmentationDescriptorType[]\n}\n\nexport interface Scte35SpliceTimeType {\n readonly ptsTime?: number\n}\n\nexport interface Scte35SpliceInsertType {\n readonly spliceEventId?: number\n readonly spliceEventCancelIndicator?: boolean\n readonly outOfNetworkIndicator?: boolean\n readonly spliceImmediateFlag?: boolean\n readonly uniqueProgramId?: number\n readonly availNum?: number\n readonly availsExpected?: number\n readonly Program?: Scte35ProgramType\n readonly BreakDuration?: Scte35BreakDurationType\n}\n\nexport type Scte35SpliceNullType = Record<never, never>\n\nexport interface Scte35ProgramType {\n readonly SpliceTime?: Scte35SpliceTimeType\n}\n\nexport interface Scte35BreakDurationType {\n readonly autoReturn?: boolean\n readonly duration?: number\n}\n\nexport interface Scte35TimeSignalType {\n readonly SpliceTime?: Scte35SpliceTimeType\n}\n\nexport interface Scte35SegmentationDescriptorType {\n readonly segmentationEventId?: number\n readonly segmentationEventCancelIndicator?: boolean\n readonly segmentationDuration?: number\n readonly segmentationTypeId?: number\n readonly segmentNum?: number\n readonly segmentsExpected?: number\n readonly SegmentationUpid?: readonly Scte35SegmentationUpidType[]\n}\n\nexport interface Scte35SegmentationUpidType {\n readonly segmentationUpidType?: number\n /** `text` or `hexbinary` (the default). */\n readonly segmentationUpidFormat?: string\n readonly _content?: string\n}\n", "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const ContentProtectionScheme = {\n /**\n * CENC protection scheme. (Should not be used to create a key session)\n */\n CENC: 'urn:mpeg:dash:mp4protection:2011',\n\n /**\n * A simple, unencrypted content protection scheme. Not a full DRM solution.\n */\n CLEAR_KEY: 'urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e',\n\n /**\n * Apple's FairPlay.\n */\n FAIR_PLAY: 'urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2',\n\n /**\n * Open-standards community initiative by Marlin Developer Community.\n */\n MARLIN: 'urn:uuid:5e629af5-38da-4063-8977-97ffbd9902d4',\n\n /**\n * Microsoft's PlayReady.\n */\n PLAY_READY: 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95',\n\n /**\n * An old, unused PlayReady scheme id.\n */\n PLAY_READY_DEPRECATED: 'urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95',\n\n /**\n * Google's Widevine.\n */\n WIDEVINE: 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed',\n} as const\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAKA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAKP,IAAM,IAAI;AACV,IAAM,IAAI;AACV,IAAM,IAAI;AACV,IAAM,IAAI;AACV,IAAM,IAAI;AAUV,IAAM,kBACF;AAwBG,SAAS,cAAc,OAAyB;AACnD,QAAM,QAAQ,gBAAgB,KAAK,KAAK;AACxC,MAAI,SAAS;AACT,UAAM,IAAI;AAAA,MACN,yBAAyB,KAAK;AAAA,MAC9B,YAAY;AAAA,IAChB;AAEJ,QAAM,OAAO,MAAM,CAAC,MAAM,MAAM,KAAK;AACrC,SACI,QACC,WAAW,MAAM,CAAC,KAAK,GAAG,IAAI,IAC3B,WAAW,MAAM,CAAC,KAAK,GAAG,IAAI,IAC9B,WAAW,MAAM,CAAC,KAAK,GAAG,IAAI,IAC9B,WAAW,MAAM,CAAC,KAAK,GAAG,IAAI,IAC9B,WAAW,MAAM,CAAC,KAAK,GAAG,IAAI,IAC9B,WAAW,MAAM,CAAC,KAAK,GAAG;AAEtC;AAOO,SAAS,kBAAkB,OAAyB;AACvD,QAAM,OAAO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6CAA6B,iBAAiB;AAAA,EAC9C,8CAA8B;AAClD;AAEA,IAAM,qBAAqC,4BAAY,YAAY;AAKnE,SAAS,sBAAsB;AAC3B,SAAO,IAAI,oBAAoB,kBAAkB;AACrD;AAOO,SAAS,kBAAkB,UAAmC;AACjE,SAAO,SAAS,UAAU,oBAAoB,CAAC;AACnD;AAEO,SAAS,sBACZ,UACM;AACN,SAAO,aAAa,UAAU,kBAAkB;AACpD;;;AQpEO,IAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA,EAInC,MAAM;AAAA;AAAA;AAAA;AAAA,EAKN,WAAW;AAAA;AAAA;AAAA;AAAA,EAKX,WAAW;AAAA;AAAA;AAAA;AAAA,EAKX,QAAQ;AAAA;AAAA;AAAA;AAAA,EAKR,YAAY;AAAA;AAAA;AAAA;AAAA,EAKZ,uBAAuB;AAAA;AAAA;AAAA;AAAA,EAKvB,UAAU;AACd;",
6
+ "names": ["ErrorOrigin", "ValidationError", "ErrorOrigin", "ErrorOrigin", "number", "attr", "charactersString", "element", "attr", "element", "charactersString", "element", "elements", "elements", "element", "charactersString", "element", "element", "charactersString", "attrBoolean", "attrInt", "attrString", "charactersString", "element", "elements", "attrInt", "attrString", "charactersString", "attrBoolean", "elements", "element"]
7
7
  }