-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a binary to convert mpd to m3u8 json in node (#129)
- Loading branch information
1 parent
8b58b39
commit 608aa9d
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env node | ||
/* eslint-disable no-console */ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const {parse} = require('../dist/mpd-parser.cjs.js'); | ||
|
||
const file = path.resolve(process.cwd(), process.argv[2]); | ||
const result = parse(fs.readFileSync(file, 'utf8'), { | ||
manifestUri: '' | ||
}); | ||
|
||
console.log(JSON.stringify(result, null, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
"type": "git", | ||
"url": "[email protected]:videojs/mpd-parser.git" | ||
}, | ||
"bin": { | ||
"mpd-to-m3u8-json": "bin/parse.js" | ||
}, | ||
"scripts": { | ||
"prenetlify": "npm run build", | ||
"netlify": "node scripts/netlify.js", | ||
|