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 (meta)
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
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tag
See: Data range metadata (meta) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of meta event
This is always date-range for this event subcategory.
|
type string | Category of player event
This is always meta for this event.
|
Date range metadata (meta)
Property | Description |
---|---|
attributes array | EXT-X-DATERANGE: |
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 |
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 (meta)
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
}
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tag
See: EMSG metadata (meta) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of meta event
This is always esmg for this event subcategory.
|
type string | Category of player event
This is always meta for this event.
|
EMSG metadata meta
Property | 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 event
This 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 |
schemeIdUri string | Identifies the message scheme |
timescale number | Provides the timescale, in ticks per second |
ID3 (meta)
Fires when playback enters the section of an HLS stream containing ID3 tags
{
"type": "meta",
"metadataType": "id3",
"metadataTime": 0,
"metadata": {
...
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS ID3 tag
See: ID3 metadata (meta) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of meta event
This is always id3 for this event subcategory.
|
type string | Category of player event
This is always meta for this event.
|
ID3 metadata (meta)
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
}
}
Property | Description |
---|---|
duration number | Length of the media asset |
height number | Height dimension of the media asset |
metadataType string | Subcategory of meta event
This 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: ID3 seekRange (meta) |
type string | Category of player event
This is always meta for this event.
|
width number | Width dimension of the media asset |
ID3 seekRange (meta)
Property | 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 (meta)
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
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-PROGRAM-DATE-TIME tag
See: Program-date-time metadata (meta) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of meta event
This is always program-date-time for this event subcategory.
|
programDateTime string | Date and time of the program metadata in UTC |
type string | Category of player event
This is always meta for this event.
|
Program-date-time metadata (meta)
Property | Description |
---|---|
end number | End time of the cue in seconds, relative to currentTime of stream |
programDateTime string | Date and time of the program metadata in UTC |
start number | Start time of the cue in seconds, relative to currentTime of stream |
SCTE-35 (meta)
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
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-CUE-OUT , #EXT-X-CUE-IN tags
See: SCTE-35 metadata (meta) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of meta event
This is always scte-35 for this event subcategory.
|
type string | Category of player event
This is always meta for this event.
|
SCTE-35 metadata (meta)
Property | Description |
---|---|
content string | Content following the HLS manifest tag |
end number | End time of the cue in seconds, relative to currentTime of stream |
start number | Start time of the cue in seconds, relative to currentTime of stream |
tag string | Name of the HLS manifest tag
This is always EXT-X-CUE-OUT or EXT-X-CUE-IN for this event.
|
Unknown (meta)
Indicates that a meta event from a third-party media provider or legacy Flash has fired
{
"type": "meta",
"metadataType": "unknown",
...
}
Property | Description |
---|---|
metadataType string | Subcategory of meta event
This is always unknown for this event subcategory.
|
type string | Category of player event
This is always meta for this event.
|
.on('metadataCueParsed')
Triggered once the metadata cue point is buffered
Date range (metadataCueParsed)
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
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tag
See: Data range metadata (metadataCueParsed) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of metadataCueParsed event
This is always date-range for this event subcategory.
|
type string | Category of player event
This is always meta for this event.
|
Date range metadata (metadataCueParsed)
Property | Description |
---|---|
attributes array | EXT-X-DATERANGE: |
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 (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
}
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tag
See: EMSG metadata (metadataCueParsed) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of metadataCueParsed event
This is always esmg for this event subcategory.
|
type string | Category of player event
This is always metadataCueParsed for this event.
|
EMSG metadata (metadataCueParsed)
Property | 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 metadataCueParsed event
This 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 (metadataCueParsed)
Fires when playback buffers a section of an HLS stream containing ID3 tags
{
"type": "metadataCueParsed",
"metadataType": "id3",
"metadataTime": 0,
"metadata": {
...
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS ID3 tag
See: ID3 metadata (metadataCueParsed) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of metadataCueParsed event
This is always id3 for this event subcategory.
|
type string | Category of player event
This is always metadataCueParsed for this event.
|
ID3 metadata (metadataCueParsed)
Fires when the initial metadata of a video has loaded
{
"type": "metadataCueParsed",
"metadataType": "media",
"duration": 60,
"height": 1280,
"width": 720,
"seekRange": {
"start": 0,
"end": 60
}
}
Property | Description |
---|---|
duration number | Length of the media asset |
height number | Height dimension of the media asset |
metadataType string | Subcategory of metadataCueParsed event
This 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: ID3 seekRange (metadataCueParsed) |
type string | Category of player event
This is always metadataCueParsed for this event.
|
width number | Width dimension of the media asset |
ID3 seekRange (metadataCueParsed)
Property | 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 (metadataCueParsed)
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
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-PROGRAM-DATE-TIME tag
See: Program-date-time metadata (metadataCueParsed) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of metadataCueParsed event
This is always program-date-time for this event subcategory.
|
programDateTime string | Date and time of the program metadata in UTC |
type string | Category of player event
This is always metadataCueParsed for this event.
|
Program-date-time metadata (metadataCueParsed)
Property | Description |
---|---|
end number | End time of the cue in seconds, relative to currentTime of stream |
programDateTime string | Date and time of the program metadata in UTC |
start number | Start time of the cue in seconds, relative to currentTime of stream |
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
}
}
Property | Description |
---|---|
metadata object | Object containing all of the information relevant to the HLS #EXT-X-CUE-OUT , #EXT-X-CUE-IN tags
See: SCTE-35 metadata (metadataCueParsed) |
metadataTime number | Start time, in seconds, of the metadata cue |
metadataType string | Subcategory of metadataCueParsed event
This is always scte-35 for this event subcategory.
|
type string | Category of player event
This is always metadataCueParsed for this event.
|
SCTE-35 metadata (metadataCueParsed)
Property | Description |
---|---|
content string | Content following the HLS manifest tag |
end number | End time of the cue in seconds, relative to currentTime of stream |
start number | Start time of the cue in seconds, relative to currentTime of stream |
tag string | Name of the HLS manifest tag
This is always EXT-X-CUE-OUT or EXT-X-CUE-IN for this event.
|