Skip to main content
Version: 6.13.0

Introduction

The Player API is the top-level API. This API exposes:

  • basic functions to manipulate video playback, such as start and pause;
  • properties to check states and values, such as the playhead position;
  • events to track changes.

The list below overviews how-to articles related to the Player API.

Events

As a developer, you can programmatically attach event listeners to different APIs. Event listeners are often used to implement a custom UI or to implement a custom analytics integration.

The THEOplayer API exposes many events across different interfaces, as can be seen in the graphic below. Furthermore, most events exist in all SDKs (Web, iOS-based, Android-based and Roku).

THEOplayer API Interfaces and Events

The table below gives an overview of a subset of the available events per interface in the THEOplayer Web SDK.

InterfaceEventDescription
PlayercanplayFired when the player can resume playback of the media data.
PlayercanplaythroughFired when the player can resume playback of the media data and buffering is unlikely.
PlayercontentprotectionerrorFired when an error related to content protection occurs.
PlayercontentprotectionsuccessFired when the key is usable for decryption.
PlayercurrentsourcechangeFired when the current source, which is chosen from ChromelessPlayer.source.sources, changes.
PlayerdestroyFired when the the player is destroyed.
PlayerdimensionchangeFired when the dimensions of the HTML element changes.
PlayerdurationchangeFired when ChromelessPlayer.duration changes.
PlayeremptiedFired when the player's source is cleared.
PlayerencryptedFired when the player encounters key system initialization data in the media data.
PlayerendedFired when playback has stopped because the end of the media resource was reached.
PlayererrorFired when an error occurs.
PlayerloadeddataFired when the player can render the media data at the current playback position for the first time.
PlayerloadedmetadataFired when the player determines the duration and dimensions of the media resource.
PlayerloadstartFired when the player starts loading the manifest.
PlayermanifestupdateFired when the manifest is updated.
PlayerpauseFired when ChromelessPlayer.paused changes to true.
PlayerplayFired when ChromelessPlayer.paused changes to false.
PlayerplayingFired when playback is ready to start after having been paused or delayed due to lack of media data.
PlayerprogressFired when the player loaded media data.
PlayerratechangeFired when ChromelessPlayer.playbackRate changes.
PlayerreadystatechangeFired when ChromelessPlayer.readyState changes.
PlayerrepresentationchangeFired when the current representation changes.
PlayerresizeFired when either ChromelessPlayer.videoWidth or ChromelessPlayer.videoHeight changes.
PlayerseekedFired when ChromelessPlayer.seeking changes to false after the current playback position was changed.
PlayerseekingFired when ChromelessPlayer.seeking changes to true, and the player has started seeking to a new position.
PlayersegmentnotfoundFired when a segment can not be found.
PlayersourcechangeFired when ChromelessPlayer.source changes.
PlayertimeupdateFired when the current playback position changed as part of normal playback or in an especially interesting way, for example discontinuously.
PlayervolumechangeFired when ChromelessPlayer.volume changes.
PlayerwaitingFired when playback has stopped because the next frame is not available, but the player expects that frame to become available in due course.
PlayercurrentTimeThe current playback position of the media, in seconds.
PlayercurrentProgramDateTimeThe current playback position of the media, as a timestamp.
PlayermutedWhether audio is muted.
Player......
Ads (Client-Side)adbeginFired when an ad begins.
Ads (Client-Side)adbreakbeginFired when an ad break begins.
Ads (Client-Side)adbreakchangeFired when an ad break changes.
Ads (Client-Side)adbreakendFired when an ad break ends.
Ads (Client-Side)adbufferingFired when the ad has stalled playback to buffer.
Ads (Client-Side)addadFired when an ad is added.
Ads (Client-Side)addadbreakFired when an ad break is added.
Ads (Client-Side)adendFired when an ad ends.
Ads (Client-Side)aderrorFired when an ad errors.
Ads (Client-Side)adfirstquartileFired when an ad reaches the first quartile.
Ads (Client-Side)adimpressionFired when an ad counts as an impression.
Ads (Client-Side)adloadedFired when an ad is loaded.
Ads (Client-Side)admetadataFired when an ads list is loaded.
Ads (Client-Side)admidpointFired when an ad reaches the mid point.
Ads (Client-Side)adskipFired when an ad is skipped.
Ads (Client-Side)adthirdquartileFired when an ad reaches the third quartile.
Ads (Client-Side)removeadbreakFired when an ad break is removed.
Ads (Client-Side)updateadFired when an ad is updated.
Ads (Client-Side)updateadbreakFired when an AdBreak is updated.
Vendor CaststatechangeFired when the state changes.
ChromecasterrorFired when an error occurs while casting or trying to cast.
Track ListaddtrackFired when a track is added.
Track ListchangeFired when a track is activated or deactivated.
Track ListremovetrackFired when a track is removed.
TrackchangeFired when a media track's enabled or a text track's changes.
TrackupdateFired when the track updates.
Media TrackactivequalitychangedFired when the media track's active quality changes.
Media TrackqualityunavailableFired when a quality of the track becomes unavailable.
Media TracktargetqualitychangedFired when the media track's target quality changes.
Text TrackaddcueFired when a cue is added to the track.
Text TrackcuechangeFired when a cue of the track changes.
Text TrackentercueFired when a cue of the track enters.
Text TrackerrorFired when an error occurred while loading or parsing the track.
Text TrackexitcueFired when a cue of the track exits.
Text TrackreadystatechangeFired when the text track's changes.
Text TrackremovecueFired when a cue of the track is removed.
Text TracktypechangeFired when the text track's changes.
Text Track CueenterFired when the cue is entered.
Text Track CueexitFired when the cue is exited.
Text Track CueupdateFired when the cue is updated.
PresentationerrorFired when an error occurs.
PresentationpresentationmodechangeFired when the presentation mode changes.
VRdirectionchangeFired when the VR.direction changes.
VRerrorFired when an error occurs.
VRstatechangeFired when the VR.state changes.
VRstereochangeFired when the VR.stereo changes.
Verizon MediaassetinforesponseFired when an asset info response is received.
Verizon MediapingerrorFired when an error or invalid response is received from the Ping API.
Verizon MediapingresponseFired when a Ping response is received.
Verizon MediapreplayresponseFired when a Preplay response is received.
Verizon MediaadsThe Verizon Media SSAI API.
Verizon MediaassetsList of Verizon Media assets.
Verizon Media Ad Break ListaddadbreakFired when the ad break is added.
Verizon Media Ad Break ListremoveadbreakFired when the ad break is removed.
Verizon Media Ad BreakadbreakbeginFired when the ad break begins.
Verizon Media Ad BreakadbreakendFired when the ad break ends.
Verizon Media Ad BreakadbreakskipFired when the ad break is skipped.
Verizon Media Ad BreakupdateadbreakFired when the ad break is updated.
Verizon Media AdadbeginFired when an ad begins.
Verizon Media AdadcompleteFired when the ad is completed.
Verizon Media AdadendFired when the ad ends.
Verizon Media AdadfirstquartileFired when the ad reaches the first quartile.
Verizon Media AdadmidpointFired when the ad reaches the mid point.
Verizon Media AdadthirdquartileFired when the ad reaches the third quartile.

Our APIs are continuously evolving, and so is our list of events. Refer to our API references of our SDKs to go through the latest sets of events: