VideoPlayerDelegate

public protocol VideoPlayerDelegate : AnyObject

A set of methods which allow to respond to video player events.

  • playerReady(_:) Default implementation

    Tells the delegate that the video player is ready to play assets.

    Default Implementation

    Declaration

    Swift

    func playerReady(_ player: VideoPlayer)

    Parameters

    player

    The player object

  • Tells the delegate that the internal playback state of the video player has changed.

    Default Implementation

    Declaration

    Swift

    func player(_ player: VideoPlayer, didChangePlaybackStateFrom oldState: Richi.PlaybackState, to newState: Richi.PlaybackState)

    Parameters

    player

    The player object

    oldState

    The previous state the player transitioned from

    newState

    The new state the player transitioned to

  • Tells the delegate that the internal buffering state of the video player has changed.

    Default Implementation

    Declaration

    Swift

    func player(_ player: VideoPlayer, didChangeBufferingStateFrom oldState: Richi.BufferingState, to newState: Richi.BufferingState)

    Parameters

    player

    The player object

    oldState

    The previous state the player transitioned from

    newState

    The new state the player transitioned to

  • player(_:didChangeBufferTime:) Default implementation

    Tells the delegate that the buffering time has changed.

    Default Implementation

    Declaration

    Swift

    func player(_ player: VideoPlayer, didChangeBufferTime bufferTime: Double)

    Parameters

    player

    The player object

    bufferTime

    The time in seconds that the video has been buffered.

  • player(_:didFailWithError:) Default implementation

    Tells the delegate that the player did fail with the given error.

    Default Implementation

    Declaration

    Swift

    func player(_ player: VideoPlayer, didFailWithError error: Richi.Error)

    Parameters

    player

    The player object

    error

    The underlying error

  • player(_:didLoadAsset:) Default implementation

    Tells the delegate that the player has loaded the asset.

    Default Implementation

    Declaration

    Swift

    func player(_ player: VideoPlayer, didLoadAsset asset: Richi.Asset)

    Parameters

    player

    The player object

    asset

    The video asset which has been loaded

  • player(_:didChangeVideoSize:) Default implementation

    Tells the delegate that the video size of the current asset has changed.

    Default Implementation

    Declaration

    Swift

    func player(_ player: VideoPlayer, didChangeVideoSize size: CGSize)

    Parameters

    player

    The player object

    size

    The video asset’s size

  • playerWillStartFromBeginning(_:) Default implementation

    Tells the delegate that the player will start playback from the beginning.

    Default Implementation

    Declaration

    Swift

    func playerWillStartFromBeginning(_ player: VideoPlayer)

    Parameters

    player

    The player object

  • playerDidEnd(_:) Default implementation

    Tells the delegate that the playback of the current item did end.

    Default Implementation

    Declaration

    Swift

    func playerDidEnd(_ player: VideoPlayer)

    Parameters

    player

    The 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: VideoPlayer)

    Parameters

    player

    The player object

  • playerDidLoop(_:) Default implementation

    Tells the delegate that the playback of the current item did loop.

    Default Implementation

    Declaration

    Swift

    func playerDidLoop(_ player: VideoPlayer)

    Parameters

    player

    The player object