Metadata Events

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
    }
}
PropertyDescription
metadata object

Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tag



See: Data range metadata (meta)

metadataTime numberStart 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)

PropertyDescription
attributes arrayEXT-X-DATERANGE:<attribute-list>
content stringContent following the HLS tag
duration numberDuration of the EXT-X-DATERANGE
end numberEnd time of the cue in seconds, relative to currentTime of stream
endDate stringEXT-X-DATERANGE end date in UTC
start numberStart time of the cue in seconds, relative to
startDate stringEXT-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
        }
    }
}
PropertyDescription
metadata object

Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tag



See: EMSG metadata (meta)

metadataTime numberStart 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

PropertyDescription
duration numberDuration of the EXT-X-DATERANGE
end numberEnd time of the cue in seconds, relative to currentTime of stream
id numberField identifying this instance of the message
messageData arrayBody of the message
metadataType string

Subcategory of meta event



This is always emsg for this event subcategory.

presentationTimeOffset numberOffset that the event starts, relative to the start of the segment this is contained in (in units of timescale)
start numberStart time of the cue in seconds, relative to
schemeIdUri stringIdentifies the message scheme
timescale numberProvides 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": {
    ...          
  }
}
PropertyDescription
metadata object

Object containing all of the information relevant to the HLS ID3 tag



See: ID3 metadata (meta)

metadataTime numberStart 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
  }
}
PropertyDescription
duration numberLength of the media asset
height numberHeight 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 numberWidth dimension of the media asset
ID3 seekRange (meta)
PropertyDescription
end numberEnd time of the time range in seconds, relative to currentTime of stream
start numberStart 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
  }
}
PropertyDescription
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 numberStart time, in seconds, of the metadata cue
metadataType string

Subcategory of meta event



This is always program-date-time for this event subcategory.

programDateTime stringDate 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)

PropertyDescription
end numberEnd time of the cue in seconds, relative to currentTime of stream
programDateTime stringDate and time of the program metadata in UTC
start numberStart 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
  }
}
PropertyDescription
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 numberStart 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)

PropertyDescription
content stringContent following the HLS manifest tag
end numberEnd time of the cue in seconds, relative to currentTime of stream
start numberStart 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",
  ...
}
PropertyDescription
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
  }     
}
PropertyDescription
metadata object

Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tag



See: Data range metadata (metadataCueParsed)

metadataTime numberStart 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)

PropertyDescription
attributes arrayEXT-X-DATERANGE:<attribute-list>
content stringContent following the HLS tag
duration numberDuration of the EXT-X-DATERANGE
end numberEnd time of the cue in seconds, relative to currentTime of stream
endDate stringEXT-X-DATERANGE end date in UTC
start numberStart time of the cue in seconds, relative to currentTime of stream
startDate stringEXT-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
        }
    }
}
PropertyDescription
metadata object

Object containing all of the information relevant to the HLS #EXT-X-DATERANGE tag



See: EMSG metadata (metadataCueParsed)

metadataTime numberStart 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)

PropertyDescription
duration numberDuration of the EXT-X-DATERANGE
end numberEnd time of the cue in seconds, relative to currentTime of stream
id numberField identifying this instance of the message
messageData arrayBody of the message
metadataType string

Subcategory of metadataCueParsed event



This is always emsg for this event subcategory.

presentationTimeOffset numberOffset that the event starts, relative to the start of the segment this is contained in (in units of timescale)
start numberStart time of the cue in seconds, relative to currentTime of stream
schemeIdUri stringIdentifies the message scheme
timescale numberProvides 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": {
    ...          
  }
}
PropertyDescription
metadata object

Object containing all of the information relevant to the HLS ID3 tag



See: ID3 metadata (metadataCueParsed)

metadataTime numberStart 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
  }
}
PropertyDescription
duration numberLength of the media asset
height numberHeight 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 numberWidth dimension of the media asset

ID3 seekRange (metadataCueParsed)
PropertyDescription
end numberEnd time of the time range in seconds, relative to currentTime of stream
start numberStart 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
  }
}
PropertyDescription
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 numberStart time, in seconds, of the metadata cue
metadataType string

Subcategory of metadataCueParsed event



This is always program-date-time for this event subcategory.

programDateTime stringDate 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)

PropertyDescription
end numberEnd time of the cue in seconds, relative to currentTime of stream
programDateTime stringDate and time of the program metadata in UTC
start numberStart 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
  }
}
PropertyDescription
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 numberStart 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)

PropertyDescription
content stringContent following the HLS manifest tag
end numberEnd time of the cue in seconds, relative to currentTime of stream
start numberStart 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.


© 2007- Longtail Ad Solutions, Inc.