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 |
| metadataTime number | Start time, in seconds, of the metadata cue |
| metadataType string | Subcategory of This is always |
| type string | Category of player event This is always |
Date range metadata (meta)
| Property | 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 |
| startDate string | EXT-X-DATERANGE start date in UTC |
| tag string | Name of the HLS manifest tag This is always |
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 See: EMSG metadata (meta) |
| metadataTime number | Start time, in seconds, of the metadata cue |
| metadataType string | Subcategory of This is always |
| type string | Category of player event This is always |
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 This is always |
| 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 This is always |
| type string | Category of player event This is always |
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 This is always |
| 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 |
| 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 |
| metadataTime number | Start time, in seconds, of the metadata cue |
| metadataType string | Subcategory of This is always |
| programDateTime string | Date and time of the program metadata in UTC |
| type string | Category of player event This is always |
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 |
| metadataTime number | Start time, in seconds, of the metadata cue |
| metadataType string | Subcategory of This is always |
| type string | Category of player event This is always |
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 |
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 This is always |
| type string | Category of player event This is always |
.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 |
| metadataTime number | Start time, in seconds, of the metadata cue |
| metadataType string | Subcategory of This is always |
| type string | Category of player event This is always |
Date range metadata (metadataCueParsed)
| Property | 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 |
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 |
| metadataTime number | Start time, in seconds, of the metadata cue |
| metadataType string | Subcategory of This is always |
| type string | Category of player event This is always |
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 This is always |
| 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 |
| metadataTime number | Start time, in seconds, of the metadata cue |
| metadataType string | Subcategory of This is always |
| type string | Category of player event This is always |
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 This is always |
| seekRange object | Time range representing how much video is available to buffer in live stream or for seeking in DVR |
| type string | Category of player event This is always |
| 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 |
| metadataTime number | Start time, in seconds, of the metadata cue |
| metadataType string | Subcategory of This is always |
| programDateTime string | Date and time of the program metadata in UTC |
| type string | Category of player event This is always |
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 |
| metadataTime number | Start time, in seconds, of the metadata cue |
| metadataType string | Subcategory of This is always |
| type string | Category of player event This is always |
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 |
