PlayerEventObserver
@objc public protocol PlayerEventObserver
Protocol used to receive player events.
-
Callback called when the player is going to handle the url.
Declaration
Swift
optional func willHandleUrl(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the player experiences an error.
Declaration
Swift
optional func onAmpError(ampPlayer: AmpPlayer, error: PlayerError)
Parameters
ampPlayer
The instance of the player that sends the event.
error
The error sent.
-
Callback called when the playback state of the player changes.
Declaration
Swift
optional func onAmpPlaybackStateChanged(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the buffering state of the player changes.
Declaration
Swift
optional func onAmpBufferingStateChanged(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the position of the player changes.
Declaration
Swift
optional func onAmpPositionChange(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the seconds of the player changes.
Declaration
Swift
optional func onAmpTimeChange(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the position of the player changes.
Declaration
Swift
optional func onAmpCuepointReached(ampPlayer: AmpPlayer, atTime: Double)
Parameters
ampPlayer
The instance of the player that sends the event.
atTime
The time of the cuepoint reached.
-
Callback called when the playback of the player ends.
Declaration
Swift
optional func onAmpPlaybackEnded(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the player is going to be replayed.
Declaration
Swift
optional func onAmpReplay(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the player handled the UIApplicationWillResignActiveNotification notification.
Declaration
Swift
optional func onHandledResignActive(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the player handled the UIApplicationDidBecomeActiveNotification notification.
Declaration
Swift
optional func onHandledDidBecomeActive(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the streams information changes.
Declaration
Swift
optional func onStreamInformationChanged(ampPlayer: AmpPlayer, streamInfo: StreamInfo)
Parameters
ampPlayer
The instance of the player that sends the event.
streamInfo
The struct representing the Stream’s Information.
-
Callback called when the player is going to be stopped.
Declaration
Swift
optional func willStop(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the player logs are enabled.
Declaration
Swift
optional func onEnabledLogs(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the player logs are disabled.
Declaration
Swift
optional func onDisabledLogs(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when a time metadata (ID3Tag) is reached.
Declaration
Swift
optional func onTimedMetadata(ampPlayer: AmpPlayer, metadata:[AVMetadataItem])
Parameters
ampPlayer
The instance of the player that sends the event.
metadata
The array of metadata reached
-
Callback called when seek begin
Declaration
Swift
optional func onSeekBegan()
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when seek end
Declaration
Swift
optional func onSeekEnd()
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when the player view is tapped.
Declaration
Swift
optional func onAmpTap(ampPlayerManager: AmpPlayerManager)
Parameters
ampPlayerManager
The instance of the player that sends the event.
-
Callback called when the player view is double tapped.
Declaration
Swift
optional func onAmpDoubleTap(ampPlayerManager: AmpPlayerManager)
Parameters
ampPlayerManager
The instance of the player that sends the event.
-
Callback called when the player enters fullscreen.
Declaration
Swift
optional func onEnterFullscreen(ampPlayerManager: AmpPlayerManager)
Parameters
ampPlayerManager
The instance of the player that sends the event.
-
Callback called when the player exits fullscreen.
Declaration
Swift
optional func onExitFullscreen(ampPlayerManager: AmpPlayerManager)
Parameters
ampPlayerManager
The instance of the player that sends the event.
-
Callback called when the player is going to enter fullscreen, before animation starts.
Declaration
Swift
optional func willEnterFullscreen(ampPlayerManager: AmpPlayerManager)
Parameters
ampPlayerManager
The instance of the player that sends the event.
newFrame
The new frame that the player is going to reach.
-
Callback called when the player is going to exit fullscreen, before animation starts.
Declaration
Swift
optional func willExitFullscreen(ampPlayerManager: AmpPlayerManager)
Parameters
ampPlayerManager
The instance of the player that sends the event.
newFrame
The new frame that the player is going to reach.
-
Callback called when the player rotates.
Declaration
Swift
optional func onPlayerRotate(ampPlayerManager: AmpPlayerManager)
Parameters
ampPlayerManager
The instance of the player that sends the event.
orientation
The current orientation.