Add discontinuity to the m3u8 parser
Showing
1 changed file
with
11 additions
and
0 deletions
... | @@ -273,6 +273,14 @@ | ... | @@ -273,6 +273,14 @@ |
273 | }); | 273 | }); |
274 | return; | 274 | return; |
275 | } | 275 | } |
276 | match = (/^#EXT-X-DISCONTINUITY/).exec(line); | ||
277 | if (match) { | ||
278 | this.trigger('data', { | ||
279 | type: 'tag', | ||
280 | tagType: 'discontinuity' | ||
281 | }); | ||
282 | return; | ||
283 | } | ||
276 | 284 | ||
277 | // unknown tag type | 285 | // unknown tag type |
278 | this.trigger('data', { | 286 | this.trigger('data', { |
... | @@ -399,6 +407,9 @@ | ... | @@ -399,6 +407,9 @@ |
399 | currentUri.attributes = mergeOptions(currentUri.attributes, | 407 | currentUri.attributes = mergeOptions(currentUri.attributes, |
400 | entry.attributes); | 408 | entry.attributes); |
401 | }, | 409 | }, |
410 | 'discontinuity': function() { | ||
411 | currentUri.discontinuity = true; | ||
412 | }, | ||
402 | 'targetduration': function() { | 413 | 'targetduration': function() { |
403 | if (!isFinite(entry.duration) || entry.duration < 0) { | 414 | if (!isFinite(entry.duration) || entry.duration < 0) { |
404 | this.trigger('warn', { | 415 | this.trigger('warn', { | ... | ... |
-
Please register or sign in to post a comment