@@ -73,6 +73,7 @@ function getTagCategory(tagName: string): TagCategory {
7373 return 'MasterPlaylist' ;
7474 case 'EXT-X-INDEPENDENT-SEGMENTS' :
7575 case 'EXT-X-START' :
76+ case 'EXT-X-DEFINE' :
7677 return 'MediaorMasterPlaylist' ;
7778 default :
7879 return 'Unknown' ;
@@ -247,6 +248,7 @@ function parseTagParam(name: string, param): TagParam {
247248 case 'EXT-X-PRELOAD-HINT' :
248249 case 'EXT-X-RENDITION-REPORT' :
249250 case 'EXT-X-SKIP' :
251+ case 'EXT-X-DEFINE' :
250252 return [ null , parseAttributeList ( param ) ] ;
251253 case 'EXTINF' :
252254 return [ parseEXTINF ( param ) , null ] ;
@@ -477,6 +479,11 @@ function parseMasterPlaylist(lines: Line[], params: Record<string, any>): Master
477479 utils . INVALIDPLAYLIST ( 'EXT-X-START: TIME-OFFSET attribute is REQUIRED' ) ;
478480 }
479481 playlist . start = { offset : attributes [ 'TIME-OFFSET' ] , precise : attributes [ 'PRECISE' ] || false } ;
482+ } else if ( name === 'EXT-X-DEFINE' ) {
483+ if ( ! playlist . defines ) {
484+ playlist . defines = [ ] ;
485+ }
486+ playlist . defines . push ( attributes ) ;
480487 }
481488 }
482489 if ( variantIsScored ) {
@@ -775,6 +782,11 @@ function parseMediaPlaylist(lines: Line[], params: Record<string, any>): MediaPl
775782 }
776783 prefetchFound = true ;
777784 segmentStart = - 1 ;
785+ } else if ( name === 'EXT-X-DEFINE' ) {
786+ if ( ! playlist . defines ) {
787+ playlist . defines = [ ] ;
788+ }
789+ playlist . defines . push ( attributes ) ;
778790 } else if ( typeof line === 'string' ) {
779791 // uri
780792 if ( segmentStart === - 1 ) {
0 commit comments