MediaPlayerDelegate
public protocol MediaPlayerDelegate : AnyObject
A set of methods which allow to respond to media player events.
-
playerReady(_:Default implementation) Tells the delegate that the media player is ready to play assets.
Default Implementation
Declaration
Swift
func playerReady(_ player: MediaPlayer)Parameters
playerThe player object
-
player(_:Default implementationdidChangePlaybackStateFrom: to: ) Tells the delegate that the internal playback state of the media player has changed.
Default Implementation
Declaration
Swift
func player( _ player: MediaPlayer, didChangePlaybackStateFrom oldState: Richi.PlaybackState, to newState: Richi.PlaybackState )Parameters
playerThe player object
oldStateThe previous state the player transitioned from
newStateThe new state the player transitioned to
-
player(_:Default implementationdidChangeBufferingStateFrom: to: ) Tells the delegate that the internal buffering state of the media player has changed.
Default Implementation
Declaration
Swift
func player( _ player: MediaPlayer, didChangeBufferingStateFrom oldState: Richi.BufferingState, to newState: Richi.BufferingState )Parameters
playerThe player object
oldStateThe previous state the player transitioned from
newStateThe new state the player transitioned to
-
player(_:Default implementationdidChangeBufferTime: ) Tells the delegate that the buffering time has changed.
Default Implementation
Declaration
Swift
func player(_ player: MediaPlayer, didChangeBufferTime bufferTime: Double)Parameters
playerThe player object
bufferTimeThe time in seconds that the media has been buffered.
-
player(_:Default implementationdidFailWithError: ) Tells the delegate that the player did fail with the given error.
Default Implementation
Declaration
Swift
func player(_ player: MediaPlayer, didFailWithError error: Richi.Error)Parameters
playerThe player object
errorThe underlying error
-
player(_:Default implementationdidLoadAsset: ) Tells the delegate that the player has loaded the asset.
Default Implementation
Declaration
Swift
func player(_ player: MediaPlayer, didLoadAsset asset: Richi.Asset)Parameters
playerThe player object
assetThe media asset which has been loaded
-
playerDidEnd(_:Default implementation) Tells the delegate that the playback of the current item did end.
Default Implementation
Declaration
Swift
func playerDidEnd(_ player: MediaPlayer)Parameters
playerThe player object
-
playerDidPlayToEnd(_:Default implementation) Tells the delegate that the playback did play to end time.
Default Implementation
Declaration
Swift
func playerDidPlayToEnd(_ player: MediaPlayer)Parameters
playerThe player object
-
playerWillLoop(_:Default implementation) Tells the delegate that the playback of the current item is about to loop.
Default Implementation
Declaration
Swift
func playerWillLoop(_ player: MediaPlayer)Parameters
playerThe player object
-
playerDidLoop(_:Default implementation) Tells the delegate that the playback of the current item did loop.
Default Implementation
Declaration
Swift
func playerDidLoop(_ player: MediaPlayer)Parameters
playerThe player object
View on GitHub
MediaPlayerDelegate Protocol Reference