PlayerEventObserver
public protocol PlayerEventObserver
Protocol used to receive player events.
-
Callback called when the player is going to handle the url.
Declaration
Swift
func willHandleUrl(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the player experiences an error.
Declaration
Swift
func onError(ampPlayer: AmpPlayer, error: PlayerError)
Parameters
akamaiPlayer
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
func onPlaybackStateChanged(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the buffering state of the player changes.
Declaration
Swift
func onBufferingStateChanged(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the position of the player changes.
Declaration
Swift
func onPositionChange(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the position of the player changes.
Declaration
Swift
func onCuepointReached(ampPlayer: AmpPlayer, atTime: Double)
Parameters
akamaiPlayer
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
func onPlaybackEnded(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the player is going to be replayed.
Declaration
Swift
func onReplay(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the player view is tapped.
Declaration
Swift
func onTap(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the player view is double tapped.
Declaration
Swift
func onDoubleTap(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the player enters fullscreen.
Declaration
Swift
func onEnterFullscreen(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the player exits fullscreen.
Declaration
Swift
func onExitFullscreen(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the player is going to enter fullscreen, before animation starts.
Declaration
Swift
func willEnterFullscreen(ampPlayer: AmpPlayer, newFrame: CGRect)
Parameters
akamaiPlayer
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
func willExitFullscreen(ampPlayer: AmpPlayer, newFrame: CGRect)
Parameters
ampPlayer
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 handled the UIApplicationWillResignActiveNotification notification.
Declaration
Swift
func onHandledResignActive(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the player handled the UIApplicationDidBecomeActiveNotification notification.
Declaration
Swift
func onHandledDidBecomeActive(ampPlayer: AmpPlayer)
Parameters
akamaiPlayer
The instance of the player that sends the event.
-
Callback called when the streams information changes.
Declaration
Swift
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
func willStop(ampPlayer: AmpPlayer)
Parameters
ampPlayer
The instance of the player that sends the event.
-
Callback called when a time metadata (ID3Tag) is reached.
Declaration
Swift
func onTimeMetadata(ampPlayer: AmpPlayer, metadata:[AVMetadataItem])
Parameters
ampPlayer
The instance of the player that sends the event.
metadata
The array of metadata reached
-
Callback called when the player rotates.
Declaration
Swift
func onPlayerRotate(ampPlayerManager: AmpPlayerManager, orientation: UIInterfaceOrientation, newFrame: CGRect)
Parameters
ampPlayer
The instance of the player that sends the event.
orientation
The current orientation.