Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
videojs-contrib-hls
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
e53563ee
authored
2013-12-11 18:44:12 -0500
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add comment support. Rename tags to tag.
1 parent
2b978132
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
src/m3u8/m3u8.pegjs
src/m3u8/m3u8.pegjs
View file @
e53563e
/***** Start *****/
start
= tags:
tag
s+ .* {
= tags:
line
s+ .* {
var obj = {};
tags.forEach(function(tag) { for (var p in tag) { obj[p] = tag[p]; }});
return obj;
}
tags
= tag:m3uTag _ { return tag; }
lines
= comment:comment _ { var obj = {}; obj["comment" + line] = comment; return obj; }
/ ! comment tag:tag _ { return tag; }
tag
= & comment
/ tag:m3uTag _ { return tag; }
/ tag:extinfTag _ { return tag; }
/ tag:targetDurationTag _ { return tag; }
/ tag:mediaSequenceTag _ { return tag; }
...
...
@@ -26,6 +31,9 @@ tags
/ tag:startTag _ { return tag; }
/ tag:versionTag _ { return tag; }
comment "comment"
= & "#" ! "#EXT" text:text+ { return text.join(); }
/***** Tags *****/
m3uTag
...
...
@@ -71,7 +79,7 @@ mediaTag
= tag:'#EXT-MEDIA' ":" attrs:mediaAttributes { return {media: attrs}; }
streamInfTag
= tag:'#EXT-X-STREAM-INF' ":" attrs:streamInfAttrs _ file:mediaFile {
= tag:'#EXT-X-STREAM-INF' ":" attrs:streamInfAttrs _ file:mediaFile
?
{
var fileObj = {};
fileObj[file] = {
attributes: attrs,
...
...
@@ -104,7 +112,8 @@ versionTag
/***** Helpers *****/
mediaFile
= file:[ -~]+ { return file.join(''); }
= & tag
/ ! tag file:[ -~]+ { return file.join(''); }
keyAttributes
= attrs:keyAttribute+
...
...
Please
register
or
sign in
to post a comment