@amazon/vinyl-mpd-parser 1.1.0 → 1.1.1

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 (2) hide show
  1. package/README.md +40 -0
  2. package/package.json +7 -7
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @amazon/vinyl-mpd-parser
2
+
3
+ [![Website](https://img.shields.io/badge/website-amazonmusic.github.io%2Fvinyl-blue)](https://amazonmusic.github.io/vinyl)
4
+ [![npm](https://img.shields.io/npm/v/@amazon/vinyl-mpd-parser.svg)](https://www.npmjs.com/package/@amazon/vinyl-mpd-parser)
5
+ [![size](https://img.shields.io/bundlejs/size/@amazon/vinyl-mpd-parser.svg?label=size)](https://bundlejs.com/?q=@amazon/vinyl-mpd-parser)
6
+
7
+ A fast, schema-validated DASH manifest parser for browser and Node. Parses
8
+ `.mpd` documents into a typed object that mirrors the MPEG-DASH 2011 schema,
9
+ with built-in support for the `cenc` and Microsoft PlayReady content protection
10
+ namespaces. Validates against the schema as it parses, surfacing the exact
11
+ source location for invalid documents.
12
+
13
+ ## Install
14
+
15
+ ```shell
16
+ npm install @amazon/vinyl-mpd-parser
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```typescript
22
+ import { parseDashManifest } from '@amazon/vinyl-mpd-parser'
23
+
24
+ const text = await (await fetch(mpdUri)).text()
25
+ const manifest = parseDashManifest(text)
26
+
27
+ for (const period of manifest.MPD.Period) {
28
+ for (const adaptationSet of period.AdaptationSet ?? []) {
29
+ console.log(adaptationSet.contentType, adaptationSet.Representation)
30
+ }
31
+ }
32
+ ```
33
+
34
+ The parser is built on top of [`@amazon/vinyl-xml`](../vinyl-xml). To extend the
35
+ rule set with additional namespaces, merge your own `XmlRules` into the parser
36
+ following the same pattern used internally for content protection.
37
+
38
+ ## License
39
+
40
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amazon/vinyl-mpd-parser",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A fast dash manifest parser for browser and Node.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -87,16 +87,16 @@
87
87
  "watch:release": "tsx buildSrc/build.ts --watch --release"
88
88
  },
89
89
  "devDependencies": {
90
- "@amazon/vinyl-build-utils": "^1.1.0",
91
- "@amazon/vinyl-jasmine-wrapper": "^1.1.0"
90
+ "@amazon/vinyl-build-utils": "^1.1.1",
91
+ "@amazon/vinyl-jasmine-wrapper": "^1.1.1"
92
92
  },
93
93
  "dependencies": {
94
- "@amazon/vinyl-util": "^1.1.0",
95
- "@amazon/vinyl-validation": "^1.1.0",
96
- "@amazon/vinyl-xml": "^1.1.0"
94
+ "@amazon/vinyl-util": "^1.1.1",
95
+ "@amazon/vinyl-validation": "^1.1.1",
96
+ "@amazon/vinyl-xml": "^1.1.1"
97
97
  },
98
98
  "browserslist": [
99
99
  "defaults, chrome 52, firefox 54, edge 15, safari 8"
100
100
  ],
101
- "gitHead": "ea13070fb52c1903723f08f31c356465d2f3279e"
101
+ "gitHead": "e5a3429d802564132b16808a5b8a8e15a023a548"
102
102
  }