TopGit tracks videojs/m3u8-parser on GitHub. The project has 523 stars. An m3u8 parser.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
The npm installation is preferred, but Bower works, too.
bower install --save m3u8-parser
Usage
var manifest = [
'#EXTM3U',
'#EXT-X-VERSION:3',
'#EXT-X-TARGETDURATION:6',
'#EXT-X-MEDIA-SEQUENCE:0',
'#EXT-X-DISCONTINUITY-SEQUENCE:0',
'#EXTINF:6,',
'0.ts',
'#EXTINF:6,',
'1.ts',
'#EXT-X-PROGRAM-DATE-TIME:2019-02-14T02:14:00.106Z',
'#EXTINF:6,',
'2.ts',
'#EXT-X-ENDLIST'
].join('\n');
var parser = new m3u8Parser.Parser();
parser.push(manifest);
parser.end();
var parsedManifest = parser.manifest;
Constructor Options
The constructor optinally takes an options object with two properties. These are needed when using #EXT-X-DEFINE for variable replacement.
var parser = new m3u8Parser.Parser({
uri: 'https://exmaple.com/video.m3u8?param_a=34¶m_b=abc',
mainDefinitions: {
param_c: 'def'
}
});
options.uristring The URL from which the playlist was fetched. If the request was redirected this should be the final URL. This is required if using QUERYSTRING rules with #EXT-X-DEFINE.
options.mainDefinitionsobject An object of definitions from the main playlist. This is required if using IMPORT rules with #EXT-X-DEFINE.
Parsed Output
The parser ouputs a plain javascript object with the following structure:
m3u8-parser supports 3 additional Media Segment Tags not present in the HLS specification.
EXT-X-CUE-OUT
The EXT-X-CUE-OUT indicates that the following media segment is a break in main content and the start of interstitial content. Its format is:
#EXT-X-CUE-OUT:<duration>
where duration is a decimal-floating-point or decimal-integer number that specifies the total duration of the interstitial in seconds.
EXT-X-CUE-OUT-CONT
The EXT-X-CUE-OUT-CONT indicates that the following media segment is a part of interstitial content and not the main content. Every media segment following a media segment with an EXT-X-CUE-OUT tag SHOULD have an EXT-X-CUE-OUT-CONT applied to it until there is an EXT-X-CUE-IN tag. A media segment between a EXT-X-CUE-OUT and EXT-X-CUE-IN segment without a EXT-X-CUE-OUT-CONT is assumed to be part of the interstitial. Its format is:
#EXT-X-CUE-OUT-CONT:<n>/<duration>
where n is a decimal-floating-point or decimal-integer number that specifies the time in seconds the first sample of the media segment lies within the interstitial content and duration is a decimal-floating-point or decimal-integer number that specifies the total duration of the interstitial in seconds. nSHOULD be the sum of EXTINF durations for all preceding media segments up to the EXT-X-CUE-OUT tag for the current interstitial. durationSHOULD match the duration specified in the EXT-X-CUE-OUT tag for the current interstitial.'
EXT-X-CUE-IN
The EXT-X-CUE-IN indicates the end of the interstitial and the return of the main content. Its format is:
#EXT-X-CUE-IN
There SHOULD be a closing EXT-X-CUE-IN tag for every EXT-X-CUE-OUT tag. If a second EXT-X-CUE-OUT tag is encountered before an EXT-X-CUE-IN tag, the client MAY choose to ignore the EXT-X-CUE-OUT and treat it as part of the interstitial, or reject the playlist.
To add a parser for a non-standard tag the parser object allows for the specification of custom tags using regular expressions. If a custom parser is specified, a custom object is appended to the manifest object.
Custom parsers may also extract data at a segment level by passing segment: true to the options object. Having a segment level custom parser will add a custom object to the segment data.
TopGit's metadata for videojs/m3u8-parser does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
What is videojs/m3u8-parser?
videojs/m3u8-parser (videojs/m3u8-parser) is a JavaScript project on GitHub. From the project's own README: An m3u8 parser.
Where do I read more about videojs/m3u8-parser?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/videojs/m3u8-parser is the definitive source.
Read full README in the tab above.
Curious whether m3u8-parser is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about m3u8-parser.