This API call allows developers to listen for metadata embedded in the media file (e.g. dimensions or ID3 timed metadata in HLS streams).
.on('meta')
Triggered when playback enters the time range where new metadata becomes active. Metadata can be returned in one of the following formats listed below.
Date range
Fires when playback enters the section of an HLS stream tagged with #EXT-X-DATERANGE
{
"type": "meta",
"metadataType": "date-range",
"metadataTime": 10,
"metadata": {
"tag": "EXT-X-DATERANGE",
"content": "ID=309726842,PLANNED_DURATION=30.000,START_DATE=2018-10-30 20:45:29.216158+00:00,SCTE35-OUT=TBD",
"attributes": [{
"name": "ID",
"value": "309726842"
},
{
"name": "PLANNED_DURATION",
"value": 30
},
{
"name": "START_DATE",
"value": "2018-10-30 20:45:29.216158+00:00"
},
{
"name": "SCTE35-OUT",
"value": "TBD"
}
],
"start": 10,
"end": 40,
"startDate": "2018-10-30 20:45:29.216158+00:00",
"endDate": null,
"duration": 30.0
}
}
Value | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tagSee: Date range metadata object (meta) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of meta eventThis is always date-range for this event subcategory. |
type string | Category of player event This is always meta for this event. |
Date range metadata object (meta)
Value | Description |
---|---|
attributes array | EXT-X-DATERANGE:<attribute-list> |
content string | Content following the HLS tag |
duration number | Duration of the EXT-X-DATERANGE |
end number | End time of the cue in seconds, relative to currentTime of stream |
endDate string | EXT-X-DATERANGE end date in UTC |
start number | Start time of the cue in seconds, relative to currentTime of stream |
startDate string | EXT-X-DATERANGE start date in UTC |
tag string | Name of the HLS manifest tag This is always EXT-X-DATERANGE for this event. |
EMSG metadata
Fires when the meta event is happening in conjunction with meta start time
{
"type": "meta",
"metadataType": "emsg",
"metadataTime": 1594650340,
"metadata": {
"metadataType": "emsg",
"id": 159465034,
"schemeIdUri": "urn:scte:scte35:2013:xml",
"timescale": 90000,
"presentationTimeOffset": 900000,
"duration": 900000,
"start": 1594650340,
"end": 1594650350,
"messageData": {
"0": 60,
"1": 83,
"2": 112,
"3": 108,
...
"386": 62
}
}
}
Value | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tagSee: meta emsg metadata object |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of meta eventThis is always emsg for this event subcategory. |
type string | Category of player event This is always meta for this event. |
meta emsg metadata
Value | Description |
---|---|
duration number | Duration of the EXT-X-DATERANGE |
end number | End time of the cue in seconds, relative to currentTime of stream |
id number | Field identifying this instance of the message |
messageData array | Body of the message |
metadataType string | Subcategory of meta eventThis is always emsg for this event subcategory. |
presentationTimeOffset number | Offset that the event starts, relative to the start of the segment this is contained in (in units of timescale) |
start number | Start time of the cue in seconds, relative to currentTime of stream |
schemeIdUri string | Identifies the message scheme |
timescale number | Provides the timescale, in ticks per second |
ID3 metadata
Fires when playback enters the section of an HLS stream containing ID3 tags
{
"type": "meta",
"metadataType": "id3",
"metadataTime": 0,
"metadata": {
...
}
}
Value | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS ID3 tag |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of meta eventThis is always id3 for this event subcategory. |
type string | Category of player event This is always meta for this event. |
Media metadata
Fires when the initial metadata of a video has loaded
{
"type": "meta",
"metadataType": "media",
"duration": 60,
"height": 1280,
"width": 720,
"seekRange": {
"start": 0,
"end": 60
}
}
Value | Description |
---|---|
duration number | Length of the media asset |
height number | Height dimension of the media asset |
metadataType string | Subcategory of meta eventThis is always media for this event subcategory. |
seekRange object | Time range representing how much video is available to buffer in live stream or for seeking in DVR See: meta media seekRange object |
type string | Category of player event This is always meta for this event. |
width number | Width dimension of the media asset |
meta media seekRange
Value | Description |
---|---|
end number | End time of the time range in seconds, relative to currentTime of stream |
start number | Start time of the time range in seconds, relative to currentTime of stream |
Program-date-time metadata
Fires when playback enters the section of an HLS stream tagged with #EXT-X-PROGRAM-DATE-TIME
{
"type": "meta",
"metadataType": "program-date-time",
"programDateTime": "2018-09-28T16:50:46Z",
"metadataTime": 19.9,
"metadata": {
"programDateTime": "2018-09-28T16:50:46Z",
"start": 19.9,
"end": 29.9
}
}
Value | Description | Type |
---|---|---|
metadata | Object containing all of the information relevant to the HLS #EXT-X-PROGRAM-DATE-TIME tagend : (Number) End time of the cue in seconds, relative to currentTime of streamprogramDateTime : (String) Date and time of the program metadata in UTCstart : (Number) Start time of the cue in seconds, relative to currentTime of stream | Object |
metadataTime | Start time, in seconds, of the metadata cue | Number |
metadataType | Subcategory of meta eventThis is always program-date-time for this event subcategory. | String |
programDateTime | Date and time of the program metadata in UTC | String |
type | Category of player event This is always meta for this event. | String |
SCTE-35 metadata
Fires when playback enters a section of an HLS stream tagged with #EXT-X-CUE-OUT
, #EXT-X-CUE-IN
{
"type": "meta",
"metadataType": "scte-35",
"metadataTime": 10,
"metadata": {
"tag": "EXT-X-CUE-OUT",
"content": "...",
"start": 10,
"end": 40
}
}
Value | Description | Type |
---|---|---|
metadata | Object containing all of the information relevant to the HLS #EXT-X-CUE-OUT , #EXT-X-CUE-IN tagscontent : (String) Content following the HLS manifest tagend : (Number) End time of the cue in seconds, relative to currentTime of streamstart : (Number) Start time of the cue in seconds, relative to currentTime of streamtag : (String) Name of the HLS manifest tagThis is always EXT-X-CUE-OUT or EXT-X-CUE-IN for this event. | Object |
metadataTime | Start time, in seconds, of the metadata cue | Number |
metadataType | Subcategory of meta eventThis is always scte-35 for this event subcategory. | String |
type | Category of player event This is always meta for this event. | String |
Unknown metadata
Indicates that a meta event from a third-party media provider or legacy Flash has fired
{
"type": "meta",
"metadataType": "unknown",
...
}
Value | Description | Type |
---|---|---|
metadataType | Subcategory of meta eventThis is always unknown for this event subcategory. | String |
type | Category of player event This is always meta for this event. | String |
.on('metadataCueParsed')
Triggered once the metadata cue point is buffered
Date range metadata
Fires when the player buffers a section of an HLS stream tagged with #EXT-X-DATERANGE
{
"type": "metadataCueParsed",
"metadataType": "date-range",
"metadataTime": 10,
"metadata": {
"tag": "EXT-X-DATERANGE",
"content": "ID=309726842,PLANNED_DURATION=30.000,START_DATE=2018-10-30 20:45:29.216158+00:00,SCTE35-OUT=TBD",
"attributes": [
{
"name": "ID",
"value": "309726842"
},
{
"name": "PLANNED_DURATION",
"value": 30
},
{
"name": "START_DATE",
"value": "2018-10-30 20:45:29.216158+00:00"
},
{
"name": "SCTE35-OUT",
"value": "TBD"
}
],
"start": 10,
"end": 40,
"startDate": "2018-10-30 20:45:29.216158+00:00",
"endDate": null,
"duration": 30.0
}
}
Value | Description | Type |
---|---|---|
metadata | Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tagattributes : (Array) EXT-X-DATERANGE:<attribute-list> content : (String) Content following the HLS tagduration : (Number) Duration of the EXT-X-DATERANGE end : (Number) End time of the cue, in seconds, relative to currentTime of streamendDate : (String) EXT-X-DATERANGE end date in UTCstart : (Number) Start time of the cue, in seconds, relative to currentTime of streamstartDate : (String) EXT-X-DATERANGE start date in UTCtag : (String) Name of the HLS manifest tagThis is always EXT-X-DATERANGE for this event. | Object |
metadataTime | Start time, in seconds, of the metadata cue | Number |
metadataType | Subcategory of meta eventThis is always date-range for this event subcategory. | String |
type | Category of player event This is always metadataCueParsed for this event. | String |
EMSG metadata (metadataCueParsed)
{
"type": "metadataCueParsed",
"metadataType": "emsg",
"metadataTime": 1594650340,
"metadata": {
"metadataType": "emsg",
"id": 159465034,
"schemeIdUri": "urn:scte:scte35:2013:xml",
"timescale": 90000,
"presentationTimeOffset": 900000,
"duration": 900000,
"start": 1594650340,
"end": 1594650350,
"messageData": {
"0": 60,
"1": 83,
"2": 112,
"3": 108,
...
"386": 62
}
}
}
Value | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tagSee: metadata object |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of meta eventThis is always emsg for this event subcategory. |
type string | Category of player event This is always metadataCueParsed for this event. |
metadataCueParsed emsg metadata object
Value | Description |
---|---|
duration number | Duration of the EXT-X-DATERANGE |
end number | End time of the cue in seconds, relative to currentTime of stream |
id number | Field identifying this instance of the message |
messageData array | Body of the message |
metadataType string | Subcategory of meta eventThis is always emsg for this event subcategory. |
presentationTimeOffset number | Offset that the event starts, relative to the start of the segment this is contained in (in units of timescale) |
start number | Start time of the cue in seconds, relative to currentTime of stream |
schemeIdUri string | Identifies the message scheme |
timescale number | Provides the timescale, in ticks per second |
ID3 metadata
Fires when playback buffers a section of an HLS stream containing ID3 tags
{
"type": "metadataCueParsed",
"metadataType": "id3",
"metadataTime": 0,
"metadata": {
...
}
}
Value | Description | Type |
---|---|---|
metadata | Object containing all of the information relevant to the HLS ID3 tag | Object |
metadataTime | Start time, in seconds, of the metadata cue | Number |
metadataType | Subcategory of meta eventThis is always id3 for this event subcategory. | String |
type | Category of player event This is always metadataCueParsed for this event. | String |
Program-date-time metadata
Fires when the player buffers a section of an HLS stream tagged with #EXT-X-PROGRAM-DATE-TIME
{
"type": "metadataCueParsed",
"metadataType": "program-date-time",
"programDateTime": "2018-09-28T16:50:46Z",
"metadataTime": 19.9,
"metadata": {
"programDateTime": "2018-09-28T16:50:46Z",
"start": 19.9,
"end": 29.9
}
}
Value | Description | Type |
---|---|---|
metadata | Object containing all of the information relevant to the HLS #EXT-X-PROGRAM-DATE-TIME tagend : (Number) End time of the cue, in seconds, relative to currentTime of streamprogramDateTime : (String) Date and time of the program metadata in UTCstart : (Number) Start time of the cue, in seconds, relative to currentTime of stream | Object |
metadataTime | Start time, in seconds, of the metadata cue | Number |
metadataType | Subcategory of meta eventThis is always program-date-time for this event subcategory. | String |
programDateTime | Date and time of the program metadata in UTC | String |
type | Category of player event This is always metadataCueParsed for this event. | String |
SCTE-35 metadata
Fires when the player buffers a section of an HLS stream tagged with #EXT-X-CUE-OUT
, #EXT-X-CUE-IN
{
"type": "metadataCueParsed",
"metadataType": "scte-35",
"metadataTime": 10,
"metadata": {
"tag": "EXT-X-CUE-OUT",
"content": "...",
"start": 10,
"end": 40
}
}
Value | Description | Type |
---|---|---|
metadata | Object containing all of the information relevant to the HLS #EXT-X-CUE-OUT , #EXT-X-CUE-IN tagscontent : (String) Content following the HLS manifest tagend : (Number) End time of the cue, in seconds, relative to currentTime of streamstart : (Number) Start time of the cue, in seconds, relative to currentTime of streamtag : (String) Name of the HLS manifest tagThis is always EXT-X-CUE-OUT or EXT-X-CUE-IN for this event. | Object |
metadataTime | Start time, in seconds, of the metadata cue | Number |
metadataType | Subcategory of meta eventThis is always scte-35 for this event subcategory. | String |
type | Category of player event This is always metadataCueParsed for this event. | String |