Player Events Reference
Thrown when the play method is invoked.
- currentTime : The current time of the player.
- type : ‘play’.
Declaration
Swift
public class PlayEvent : CurrentTimeEvent
Thrown when the player starts with the playback of media.
- currentTime : The current time of the player.
- type : ‘playing’.
Declaration
Swift
public class PlayingEvent : CurrentTimeEvent
Thrown when the pause method is invoked.
- currentTime : The current time of the player.
- type : ‘pause’.
Declaration
Swift
public class PauseEvent : CurrentTimeEvent
Thrown when new media data is added to the buffer of the player.
- currentTime : The current time of the player.
- type : ‘progress’.
Declaration
Swift
public class ProgressEvent : CurrentTimeEvent
Thrown when the duration of the video changes to a new value.
- duration : The new duration.
- type : ‘readystatechange’.
Declaration
Swift
public class DurationChangeEvent : EventProtocol
Thrown when the currentTime property of the player is set to a new value.
- currentTime : The current time of the player.
- type : ‘seeking’.
Declaration
Swift
public class SeekingEvent : CurrentTimeEvent
Thrown when the player has completed the setting of a new value to the currentTime property.
- currentTime : The current time of the player.
- type : ‘seeked’.
Declaration
Swift
public class SeekedEvent : CurrentTimeEvent
Thrown when the readyState of the player goes below a value of 3 – HAVE_ENOUGH_DATA.
- currentTime : The current time of the player.
- type : ‘waiting’.
Declaration
Swift
public class WaitingEvent : CurrentTimeEvent
Periodically thrown during playback to indicate that the currentTime property is changing to indicate the new playback position.
- currentTime : The current time of the player.
- type : ‘timeupdate’.
Declaration
Swift
public class TimeUpdateEvent : CurrentTimeEvent
Thrown when the players currentTime property has reached the end of the set source.
- currentTime : The current time of the player.
- type : ‘ended’.
Declaration
Swift
public class EndedEvent : CurrentTimeEvent
Thrown when the playbackRate property of the player is set to a new value.
- currentTime : The current time of the player.
- playbackRate : The new rate of playback.
- type : ‘ratechange’.
Declaration
Swift
public class RateChangeEvent : CurrentTimeEvent
Thrown when the readyState property of the player changes to a new value.
- currentTime : The current time of the player.
- readyState : The new ready state of the player (0-4).
- type : ‘readystatechange’.
Declaration
Swift
public class ReadyStateChangeEvent : ReadyStateEvent
Thrown the first time the readyState property goes from 0 – HAVE_NOTHING – to 1 – HAVE_METADATA.
- currentTime : The current time of the player.
- readyState : 1 – HAVE_METADATA.
- type : ‘readystatechange’.
Declaration
Swift
public class LoadedMetaDataEvent : ReadyStateEvent
Thrown the first time the readyState property goes from 1 – HAVE_METADATA – to 2 – HAVE_CURRENT_DATA.
- currentTime : The current time of the player.
- readyState : 2 – HAVE_CURRENT_DATA.
- type : ‘readystatechange’.
Declaration
Swift
public class LoadedDataEvent : ReadyStateEvent
Thrown to indicate that the player can now continue playback, usually after a ‘waiting’ event.
- currentTime : The current time of the player.
- readyState : 3 – HAVE_FUTURE_DATA.
- type : ‘readystatechange’.
Declaration
Swift
public class CanPlayEvent : ReadyStateEvent
Thrown to indicate that the player can now continue playback uninterrupted with a readyState property value of 4 – HAVE_ENOUGH_DATA.
- currentTime : The current time of the player.
- readyState : 4 – HAVE_ENOUGH_DATA.
- type : ‘readystatechange’.
Declaration
Swift
public class CanPlayThroughEvent : ReadyStateEvent
Thrown to indicate that an error has occurred in the player.
- error : A message indicating the cause of the error.
- errorObject: An object containing information about the error.
- type : ‘error’.
Declaration
Swift
public class ErrorEvent : EventProtocol
Thrown when the presentationMode has been changed. The new presentationMode can be retrieved via the presentationMode player’s property.
- type : ‘presentationmodechange’.
Declaration
Swift
public class PresentationModeChangeEvent : EventProtocol
Thrown when the volume property of the device is set to a new value.
- currentTime : The current time of the player.
- type : ‘volumechange’.
- volume : The new volume of the device (0-1).
Declaration
Swift
public class VolumeChangeEvent : CurrentTimeEvent
Thrown to indicate that the playing video has been resize.
- type : ‘resize’.
Declaration
Swift
public class ResizeEvent : EventProtocol
Thrown the first time the readyState property goes from 1 – HAVE_METADATA – to 2 – HAVE_CURRENT_DATA.
- currentTime : The current time of the player.
- readyState : 2 – HAVE_CURRENT_DATA.
- type : ‘readystatechange’.
Declaration
Swift
public class LoadStartEvent : CurrentTimeEvent
Thrown to indicate that the playing video has been destroyed.
- type : ‘destroy’.
Declaration
Swift
public class DestroyEvent : EventProtocol
ncG1vNJzZmismJq8sbjAspyrZZOZu2%2B%2FkmecrmWnmsC1eZBnmKaZqqS7osPSZ5qopV%2BZvKR7yKiqaKSRqbK0wI6Jo5qxladyc3ykr5ynrKNjtbW5yw%3D%3D