Interface: IntegrationElementEventMap
Map of events that are dispatched by the IntegrationElement. The IntegrationElement provides getters to read consent, content, page, currentTime, … state from.
See
IntegrationEvent for all event types as constants
Example
// using strings
integration.addEventListener('ready', () => {});
// using constants
await window.customElements.whenDefined('glomex-integration');
const { IntegrationEvent } = integration.constructor;
integration.addEventListener(IntegrationEvent.READY, () => {});
Events
adbufferingend
adbufferingend:
CustomEvent
<void
>
When the ad stopped buffering.
adbufferingstart
adbufferingstart:
CustomEvent
<void
>
When the ad started buffering.
adclick
adclick:
CustomEvent
<void
>
When the ad was clicked.
adcomplete
adcomplete:
CustomEvent
<void
>
When the ad completed.
adimpression
adimpression:
CustomEvent
<void
>
When the first frame of the ad got played back. See IntegrationElement#currentAd to get the current ad.
adpaused
adpaused:
CustomEvent
<void
>
When the ad paused.
adresumed
adresumed:
CustomEvent
<void
>
When the ad resumed.
adskipped
adskipped:
CustomEvent
<void
>
When the ad was skipped.
adtimeupdate
adtimeupdate:
CustomEvent
<void
>
When the ad’s time updates.
advolumechange
advolumechange:
CustomEvent
<void
>
When the ad’s volume changes. See IntegrationElement#adVolume to get the current volume.
contentbufferingend
contentbufferingend:
CustomEvent
<void
>
When content buffering ended.
contentbufferingstart
contentbufferingstart:
CustomEvent
<void
>
When content buffering started.
contenterror
contenterror:
CustomEvent
<{error
:MediaItemError
|MediaError
; }>
When a content error occurs upon loading or playing the content.
contentimpression
contentimpression:
CustomEvent
<void
>
When the first frame of the content got played back.
contentmarkerreached
contentmarkerreached:
CustomEvent
<{markerData
:unknown
;markerName
:string
; }>
When a marker is reached. See MediaItem#markers how to define own markers.
contentselect
contentselect:
CustomEvent
<{sessionId
:string
;source
:ContentSource
; }>
When content got selected. See IntegrationElement#content to get the current content.
contentstart
contentstart:
CustomEvent
<void
>
When content started initially (e.g. before ad break).
contentstop
contentstop:
CustomEvent
<{reason
:ContentStopReason
; }>
When content got stopped (e.g. loading another content or it ended normally). The reason is provided in the payload. It gets triggered after a potential postroll.
ended
ended:
Event
|CustomEvent
<void
>
When the content reached its end. This is equal to HTMLMediaElement.ended . See IntegrationElement#ended to check if the content ended.
integrationabort
integrationabort:
CustomEvent
<{error
:Error
; }>
When the integration got aborted because of a configuration / authorization error. It is not triggered when the content errors.
integrationadavailable
integrationadavailable:
CustomEvent
<void
>
When an ad is available.
integrationpassback
integrationpassback:
CustomEvent
<{reason
:string
; }>
When a passback is triggered because of no content or no ad. Only available when IntegrationElement#passback is set.
pause
pause:
Event
|CustomEvent
<void
>
When the content switches from playing to paused. This is equal to HTMLMediaElement.pause .
play
play:
Event
|CustomEvent
<void
>
When the content switches from paused to playing. This is equal to HTMLMediaElement.play .
playersetpresentationmode
playersetpresentationmode:
CustomEvent
<{mode
:PresentationMode
; }>
When the player’s presentation mode got changed.
playlistupdate
playlistupdate:
CustomEvent
<void
>
When the playlist is updated (e.g. new media item got added). See IntegrationElement#playlist to get the current playlist items.
ready
ready:
CustomEvent
<void
>
When the integration got initialized.
seeked
seeked:
Event
|CustomEvent
<void
>
When the content has seeked. This is equal to HTMLMediaElement.seeked .
seeking
seeking:
Event
|CustomEvent
<void
>
When the content is seeking. This is equal to HTMLMediaElement.seeking . See IntegrationElement#seeking to get the current seeking state.
timeupdate
timeupdate:
Event
|CustomEvent
<void
>
When the content’s time updates. This is equal to HTMLMediaElement.timeupdate . See IntegrationElement#currentTime to get the current time.
userupdateconsent
userupdateconsent:
CustomEvent
<void
>
When the user’s consent got updated. See IntegrationElement#consent to get the current consent.
volumechange
volumechange:
Event
|CustomEvent
<void
>
When the content’s volume changes. This is equal to HTMLMediaElement.volumechange . See IntegrationElement#volume to get the current volume.