Player Events
-
The types of Player events.
See moreDeclaration
Swift
public struct PlayerEventTypes
-
Fired when
See morePlayerEventTypes.SOURCE_CHANGE
occurs for theTHEOplayer
.Declaration
Swift
@objc(THEOplayerSourceChangeEvent) public class SourceChangeEvent : PlayerEvent
-
The base event for all events that change the
See moreReadyState
of the player.Declaration
Swift
@objc(THEOplayerReadyStateEvent) public class ReadyStateEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.PLAY
occurs for theTHEOplayer
.Remark
- The player is no longer paused.
- Triggered when play() has returned or when autoplay has caused playback to begin.
Declaration
Swift
@objc(THEOplayerPlayEvent) public class PlayEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.PLAYING
occurs for theTHEOplayer
.Remark
- Playback is ready to start after having been paused or delayed due to lack of media data.
- Even if this event fires, the player might still not be potentially playing, e.g. if the player is paused for user interaction or paused for in-band content.
Declaration
Swift
@objc(THEOplayerPlayingEvent) public class PlayingEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.PAUSE
occurs for theTHEOplayer
.Declaration
Swift
@objc(THEOplayerPauseEvent) public class PauseEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.PROGRESS
occurs for theTHEOplayer
.Remark
- Triggered when the player is fetching media data.
- For progress in time, please see
TimeUpdateEvent
.
Declaration
Swift
@objc(THEOplayerProgressEvent) public class ProgressEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.DURATION_CHANGE
occurs for theTHEOplayer
.Remark
- One of the cases where the duration is updated, is when you set a new source.
Declaration
Swift
@objc(THEOplayerDurationChangeEvent) public class DurationChangeEvent : PlayerEvent
-
Fired when
PlayerEventTypes.SEEKING
occurs for theTHEOplayer
.Remark
- This event means that the player is currently seeking, thus
THEOplayer.seeking
will return true.
Declaration
Swift
@objc(THEOplayerSeekingEvent) public class SeekingEvent : CurrentTimeEvent
- This event means that the player is currently seeking, thus
-
Fired when
PlayerEventTypes.SEEKED
occurs for theTHEOplayer
.Remark
- This event means that the player has completed seeking, thus
THEOplayer.seeking
will return false.
Declaration
Swift
@objc(THEOplayerSeekedEvent) public class SeekedEvent : CurrentTimeEvent
- This event means that the player has completed seeking, thus
-
Fired when
PlayerEventTypes.WAITING
occurs for theTHEOplayer
.Remark
- Playback has stopped because the next frame is not available, but the user agent expects that frame to become available in due course.
ReadyState
is equal to or less than HAVE_CURRENT_DATA, andTHEOplayer.paused
is false.
Declaration
Swift
@objc(THEOplayerWaitingEvent) public class WaitingEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.TIME_UPDATE
occurs for theTHEOplayer
.Remark
- Periodically thrown during playback to indicate that the currentTime property is changing to indicate the new playback position.
- Will be kept up-to-date in case of discontinuous playback, e.g. because of a seek.
Declaration
Swift
@objc(THEOplayerTimeUpdateEvent) public class TimeUpdateEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.ENDED
occurs for theTHEOplayer
.Remark
- currentTime has reached the end of the current source.
Declaration
Swift
@objc(THEOplayerEndedEvent) public class EndedEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.RATE_CHANGE
occurs for theTHEOplayer
.Remark
- The effective playback rate changes, which is the speed at which the media resource plays, as a multiple of its intrinsic speed.
Declaration
Swift
@objc(THEOplayerRateChangeEvent) public class RateChangeEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.READY_STATE_CHANGE
occurs for theTHEOplayer
.Remark
- For all possible values, see
ReadyState
.
Declaration
Swift
@objc(THEOplayerReadyStateChangeEvent) public class ReadyStateChangeEvent : ReadyStateEvent
- For all possible values, see
-
Fired when
PlayerEventTypes.LOADED_META_DATA
occurs for theTHEOplayer
.Remark
- The player has just determined the duration and dimensions of the media resource.
- Thrown the first time the readyState property goes from 0: HAVE_NOTHING to 1: HAVE_METADATA.
- Additionally, the text tracks are ready.
Declaration
Swift
@objc(THEOplayerLoadedMetaDataEvent) public class LoadedMetaDataEvent : ReadyStateEvent
-
Fired when
PlayerEventTypes.LOADED_DATA
occurs for theTHEOplayer
.Remark
- The player is able to render the content for the first time, from the current position.
- Thrown the first time the readyState property goes from 1: HAVE_METADATA to 2: HAVE_CURRENT_DATA.
Declaration
Swift
@objc(THEOplayerLoadedDataEvent) public class LoadedDataEvent : ReadyStateEvent
-
Fired when
PlayerEventTypes.CAN_PLAY
occurs for theTHEOplayer
.Remark
- The player already has some data and can play, with a readyState property value of 3: HAVE_FUTURE_DATA.
- The player does not have sufficient future data to guarantee a smooth playthrough.
- With the current playback rate, until the end of the stream, the player might have to stop for further buffering of the media data.
- Fired to indicate that the player can now continue playback, usually after a ‘waiting’ event.
Declaration
Swift
@objc(THEOplayerCanPlayEvent) public class CanPlayEvent : ReadyStateEvent
-
Fired when
PlayerEventTypes.CAN_PLAY_THROUGH
occurs for theTHEOplayer
.Remark
- The player has sufficient data to offer a smooth playthrough.
- With the current playback rate, until the end of the stream, the player won’t have to stop for further buffering of the media data.
- Fired to indicate that the player can now continue playback uninterrupted with a readyState property value of 4: HAVE_ENOUGH_DATA.
Declaration
Swift
@objc(THEOplayerCanPlayThroughEvent) public class CanPlayThroughEvent : ReadyStateEvent
-
Fired when
See morePlayerEventTypes.ERROR
occurs for theTHEOplayer
.Declaration
Swift
@objc(THEOplayerErrorEvent) public class ErrorEvent : PlayerEvent
-
Fired when
PlayerEventTypes.PRESENTATION_MODE_CHANGE
occurs for theTHEOplayer
.Remark
- Can be triggered when switching from inline to fullscreen, or the other way around.
Declaration
Swift
@objc(THEOplayerPresentationModeChangeEvent) public class PresentationModeChangeEvent : PlayerEvent
-
Fired when
See morePlayerEventTypes.VOLUME_CHANGE
occurs for theTHEOplayer
.Declaration
Swift
@objc(THEOplayerVolumeChangeEvent) public class VolumeChangeEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.RESIZE
occurs for theTHEOplayer
.Remark
- The playing video has been resized.
Declaration
Swift
@objc(THEOplayerResizeEvent) public class ResizeEvent : PlayerEvent
-
Fired when
PlayerEventTypes.LOAD_START
occurs for theTHEOplayer
.Remark
- The player begins looking for media data, as part of the resource selection algorithm.
Declaration
Swift
@objc(THEOplayerLoadStartEvent) public class LoadStartEvent : CurrentTimeEvent
-
Fired when
PlayerEventTypes.DESTROY
occurs for theTHEOplayer
.Remark
- After receiving this event, the player should not be used anymore.
Declaration
Swift
@objc(THEOplayerDestroyEvent) public class DestroyEvent : PlayerEvent