InstreamAdPlayerDelegate

@objc(YMAInstreamAdPlayerDelegate)
public protocol InstreamAdPlayerDelegate

Ad player delegate. For each event that happend during the ad playback, the corresponding callback must be called on this object.

  1. instreamAdPlayer(_:didPrepare:)
  2. instreamAdPlayer(_:didStart:)
  3. instreamAdPlayer(_:didPause:)
  4. instreamAdPlayer(_:didResume:)
  5. instreamAdPlayer(_:didComplete:)
  6. instreamAdPlayer(_:didStop:)
  7. instreamAdPlayer(_:didFailVideoAd:withError:)
  8. instreamAdPlayer(_:videoAd:didUpdated:)

instreamAdPlayer(_:didPrepare:)

Fire this callback when instream ad player is ready to present the mediaFile.

  • player: The ad player.
  • videoAd: Prepared video ad.
  • Declaration

    Swift

    func instreamAdPlayer(_ player: InstreamAdPlayer, didPrepare videoAd: VideoAd)

    instreamAdPlayer(_:didStart:)

    Fire this callback when instream ad player started the mediaFile.

  • player: The ad player.
  • videoAd: Started video ad.
  • Declaration

    Swift

    func instreamAdPlayer(_ player: InstreamAdPlayer, didStart videoAd: VideoAd)

    instreamAdPlayer(_:didPause:)

    Fire this callback when instream ad player paused the mediaFile.

  • player: The ad player.
  • videoAd: Paused video ad.
  • Declaration

    Swift

    func instreamAdPlayer(_ player: InstreamAdPlayer, didPause videoAd: VideoAd)

    instreamAdPlayer(_:didResume:)

    Fire this callback when instream ad player resumed the mediaFile.

  • player: The ad player.
  • videoAd: Resumed video ad.
  • Declaration

    Swift

    func instreamAdPlayer(_ player: InstreamAdPlayer, didResume videoAd: VideoAd)

    instreamAdPlayer(_:didComplete:)

    Fire this callback when instream ad player completed the mediaFile.

  • player: The ad player.
  • videoAd: Completed video ad.
  • Declaration

    Swift

    func instreamAdPlayer(_ player: InstreamAdPlayer, didComplete videoAd: VideoAd)

    instreamAdPlayer(_:didStop:)

    Fire this callback when instream ad player stopped the mediaFile.

  • player: The ad player.
  • videoAd: Stopped video ad.
  • Declaration

    Swift

    func instreamAdPlayer(_ player: InstreamAdPlayer, didStop videoAd: VideoAd)

    instreamAdPlayer(_:didFailVideoAd:withError:)

    Fire this callback if an error occures in instream ad player while preparing or playing the mediaFile.

  • player: The ad player.
  • videoAd: Video ad that failed to play.
  • Declaration

    Swift

    func instreamAdPlayer(
        _ player: InstreamAdPlayer,
        didFailVideoAd videoAd: VideoAd,
        withError error: InstreamAdPlayerError
    )

    instreamAdPlayer(_:videoAd:didUpdated:)

    Fire this callback when instream ad player volume was updated.

  • player: The ad player.
  • videoAd: Muted video ad.
  • volume: Volume value that was set to the player
  • Declaration

    Swift

    func instreamAdPlayer(_ player: InstreamAdPlayer, videoAd: VideoAd, didUpdated volume: Double)