Skip to content

Commit

Permalink
docs: update usage example in README (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev authored Mar 24, 2021
1 parent 5dde0e9 commit f0da2cc
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,18 @@ mpd parser
npm install --save mpd-parser
```

The npm installation is preferred, but Bower works, too.

```sh
bower install --save mpd-parser
```

## Usage

```js
var manifest = [
'<>',
'<>',
].join('\n');
// get your manifest in whatever way works best
// for example, by reading the file from the filesystem in node
// or using fetch in a browser like so:

var parsedManifest = mpdParser.parse(manifest, manifestUrl);
const manifestUri = 'https://example.com/dash.xml';
const res = await fetch(manifestUri);
const manifest = await res.text();

var parsedManifest = mpdParser.parse(manifest, { manifestUri });
```

### Parsed Output
Expand Down

0 comments on commit f0da2cc

Please sign in to comment.