logo
THEOplayer
featuresMetricsPlayerPlayerConfigurationPlayerListplayersplayerSuiteVersionversionPlayerEventMapChromelessPlayertheoplayer
ABR
Ads
Caching
Content protection
Analytics
Casting
Media and Text Tracks
Miscellaneous
Source
Verizon Media
Events
SSAI
Network
Presentation
Player
UI
VR

THEOplayer > PlayerEventMap

PlayerEventMap interface

The events fired by the ChromelessPlayer.

Signature:

export interface PlayerEventMap 

Properties

Property

Type

Description

canplay

Event<'canplay'>

Fired when the player can resume playback of the media data.

canplaythrough

Event<'canplaythrough'>

Fired when the player can resume playback of the media data and buffering is unlikely.

contentprotectionerror

ContentProtectionErrorEvent

Fired when an error related to content protection occurs.

contentprotectionsuccess

Event<'contentprotectionsuccess'>

Fired when the key is usable for decryption.

currentsourcechange

Event<'currentsourcechange'>

Fired when the current source, which is chosen from ChromelessPlayer.source.sources, changes.

destroy

Event<'destroy'>

Fired when the the player is destroyed.

dimensionchange

Event<'dimensionchange'>

Fired when the dimensions of the HTML element changes.

durationchange

Event<'durationchange'>

Fired when ChromelessPlayer.duration changes.

emptied

Event<'emptied'>

Fired when the player's source is cleared.

encrypted

Event<'encrypted'>

Fired when the player encounters key system initialization data in the media data.

ended

Event<'ended'>

Fired when playback has stopped because the end of the media resource was reached.

error

Event<'error'>

Fired when an error occurs.

loadeddata

Event<'loadeddata'>

Fired when the player can render the media data at the current playback position for the first time.

loadedmetadata

Event<'loadedmetadata'>

Fired when the player determines the duration and dimensions of the media resource.

loadstart

Event<'loadstart'>

Fired when the player starts loading the manifest.

manifestupdate

Event<'manifestupdate'>

Fired when the manifest is updated.

pause

Event<'pause'>

Fired when ChromelessPlayer.paused changes to true.

play

Event<'play'>

Fired when ChromelessPlayer.paused changes to false.

playing

Event<'playing'>

Fired when playback is ready to start after having been paused or delayed due to lack of media data.

progress

Event<'progress'>

Fired when the player loaded media data.

ratechange

Event<'ratechange'>

Fired when ChromelessPlayer.playbackRate changes.

readystatechange

Event<'readystatechange'>

Fired when ChromelessPlayer.readyState changes.

representationchange

Event<'representationchange'>

Fired when the current representation changes.

resize

Event<'resize'>

Fired when either ChromelessPlayer.videoWidth or ChromelessPlayer.videoHeight changes.

seeked

Event<'seeked'>

Fired when ChromelessPlayer.seeking changes to false after the current playback position was changed.

seeking

Event<'seeking'>

Fired when ChromelessPlayer.seeking changes to true, and the player has started seeking to a new position.

segmentnotfound

Event<'segmentnotfound'>

Fired when a segment can not be found.

sourcechange

Event<'sourcechange'>

Fired when ChromelessPlayer.source changes.

timeupdate

Event<'timeupdate'>

Fired when the current playback position changed as part of normal playback or in an especially interesting way, for example discontinuously.

volumechange

Event<'volumechange'>

Fired when ChromelessPlayer.volume changes.

waiting

Event<'waiting'>

Fired when playback has stopped because the next frame is not available, but the player expects that frame to become available in due course.

Property Details

canplay

Fired when the player can resume playback of the media data.

Signature:

canplay: Event<'canplay'>;

Remarks


- In comparison to canplaythrough, the player estimates that if playback were to be started now, the media resource could not be rendered at the current playback rate up to its end without having to stop for further buffering of content.
- See HTML media - network state events.

canplaythrough

Fired when the player can resume playback of the media data and buffering is unlikely.

Signature:

canplaythrough: Event<'canplaythrough'>;

Remarks


- In comparison to canplay, the player estimates that if playback were to be started now, the media resource could be rendered at the current playback rate all the way to its end without having to stop for further buffering.
- See HTML media - network state events.

contentprotectionerror

Fired when an error related to content protection occurs.

Signature:

contentprotectionerror: ContentProtectionErrorEvent;

contentprotectionsuccess

Fired when the key is usable for decryption.

Signature:

contentprotectionsuccess: Event<'contentprotectionsuccess'>;

Remarks


- A key is usable if the CDM is certain the key can decrypt one or more blocks of media data.
- See Encrypted Media Extension - usable for decryption.

currentsourcechange

Fired when the current source, which is chosen from ChromelessPlayer.source.sources, changes.

Signature:

currentsourcechange: Event<'currentsourcechange'>;

destroy

Fired when the the player is destroyed.

Signature:

destroy: Event<'destroy'>;

Remarks


- Available since v2.33.3.

dimensionchange

Fired when the dimensions of the HTML element changes.

Signature:

dimensionchange: Event<'dimensionchange'>;

Remarks


- See Element.getBoundingClientRect().

durationchange

Fired when ChromelessPlayer.duration changes.

Signature:

durationchange: Event<'durationchange'>;

Remarks


- Fired after ChromelessPlayer.readyState has loaded metadata, or when the last segment is appended and there is a mismatch with the original duration.

emptied

Fired when the player's source is cleared.

Signature:

emptied: Event<'emptied'>;

Remarks


- See HTML media - network state events.

encrypted

Fired when the player encounters key system initialization data in the media data.

Signature:

encrypted: Event<'encrypted'>;

Remarks


- See Encrypted Media Extensions.

ended

Fired when playback has stopped because the end of the media resource was reached.

Signature:

ended: Event<'ended'>;

error

Fired when an error occurs.

Signature:

error: Event<'error'>;

loadeddata

Fired when the player can render the media data at the current playback position for the first time.

Signature:

loadeddata: Event<'loadeddata'>;

Remarks


- See HTML media - network state events.

loadedmetadata

Fired when the player determines the duration and dimensions of the media resource.

Signature:

loadedmetadata: Event<'loadedmetadata'>;

Remarks


- See HTML media - network state events.
- The seekable range should be available as soon as the duration is known. However, certain browsers (e.g. Safari) do not make it available until the loadeddata event is fired.

loadstart

Fired when the player starts loading the manifest.

Signature:

loadstart: Event<'loadstart'>;

Remarks


- See HTML media - network state events.

manifestupdate

Fired when the manifest is updated.

Signature:

manifestupdate: Event<'manifestupdate'>;

pause

Fired when ChromelessPlayer.paused changes to true.

Signature:

pause: Event<'pause'>;

Remarks


- Fired after the pause() method has returned.

play

Fired when ChromelessPlayer.paused changes to false.

Signature:

play: Event<'play'>;

Remarks


- Either fired after the play() method has returned, or when the ChromelessPlayer.autoplay attribute has caused playback to begin.

playing

Fired when playback is ready to start after having been paused or delayed due to lack of media data.

Signature:

playing: Event<'playing'>;

progress

Fired when the player loaded media data.

Signature:

progress: Event<'progress'>;

Remarks


- For DASH streams, the event is fired every 350ms or for every byte received whichever is least frequent.
- See HTML media - network state events.

ratechange

Fired when ChromelessPlayer.playbackRate changes.

Signature:

ratechange: Event<'ratechange'>;

readystatechange

Fired when ChromelessPlayer.readyState changes.

Signature:

readystatechange: Event<'readystatechange'>;

representationchange

Fired when the current representation changes.

Signature:

representationchange: Event<'representationchange'>;

resize

Fired when either ChromelessPlayer.videoWidth or ChromelessPlayer.videoHeight changes.

Signature:

resize: Event<'resize'>;

seeked

Fired when ChromelessPlayer.seeking changes to false after the current playback position was changed.

Signature:

seeked: Event<'seeked'>;

seeking

Fired when ChromelessPlayer.seeking changes to true, and the player has started seeking to a new position.

Signature:

seeking: Event<'seeking'>;

segmentnotfound

Fired when a segment can not be found.

Signature:

segmentnotfound: Event<'segmentnotfound'>;

Remarks


- Only fired on DASH streams.

sourcechange

Fired when ChromelessPlayer.source changes.

Signature:

sourcechange: Event<'sourcechange'>;

timeupdate

Fired when the current playback position changed as part of normal playback or in an especially interesting way, for example discontinuously.

Signature:

timeupdate: Event<'timeupdate'>;

volumechange

Fired when ChromelessPlayer.volume changes.

Signature:

volumechange: Event<'volumechange'>;

waiting

Fired when playback has stopped because the next frame is not available, but the player expects that frame to become available in due course.

Signature:

waiting: Event<'waiting'>;
github
Make sure to follow us on GitHub!
THEO-logo-white
twitter
facebook
linkedin
Copyright © 2020. All Rights Reserved.
Leuven
New York
Singapore
Barcelona