Change output format for extinf.
Now, it'll use peg's line and column tracking. So, each extinf would output an object with property #EXTINF + line number.
Showing
2 changed files
with
2 additions
and
2 deletions
... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
8 | "scripts": { | 8 | "scripts": { |
9 | "test": "grunt qunit", | 9 | "test": "grunt qunit", |
10 | "prepublish": "npm run peg", | 10 | "prepublish": "npm run peg", |
11 | "peg": "pegjs src/m3u8/m3u8.pegjs src/m3u8/m3u8-generated.js", | 11 | "peg": "pegjs --track-line-and-column src/m3u8/m3u8.pegjs src/m3u8/m3u8-generated.js", |
12 | "testpeg": "npm run peg && node test/pegtest.js" | 12 | "testpeg": "npm run peg && node test/pegtest.js" |
13 | }, | 13 | }, |
14 | "devDependencies": { | 14 | "devDependencies": { | ... | ... |
... | @@ -34,7 +34,7 @@ m3uTag | ... | @@ -34,7 +34,7 @@ m3uTag |
34 | extinfTag | 34 | extinfTag |
35 | = tag:'#EXTINF' ":" duration:number "," _ title:text? _ byteRange:byteRangeTag? _ file:mediaFile { | 35 | = tag:'#EXTINF' ":" duration:number "," _ title:text? _ byteRange:byteRangeTag? _ file:mediaFile { |
36 | var fileObj = {}; | 36 | var fileObj = {}; |
37 | fileObj[file] = { | 37 | fileObj[tag + line] = { |
38 | byteRange: byteRange, | 38 | byteRange: byteRange, |
39 | title: title, | 39 | title: title, |
40 | duration: duration, | 40 | duration: duration, | ... | ... |
-
Please register or sign in to post a comment