InstreamAdBinder

@objc(YMAInstreamAdBinder)
@objcMembers
public class InstreamAdBinder : NSObject

InstreamAdBinder automatically presents instream ads.

  • This object will be notified about the instream ad lifecycle.

    Declaration

    Swift

    public weak var delegate: InstreamAdBinderDelegate?
  • Initializes a new object of the InstreamAdBinder class.

    • ad: An ad loaded with InstreamAdLoader.
    • adPlayer: Player that manages ad playback.
    • videoPlayer: Player that manages content video playback.

    Declaration

    Swift

    public convenience init(
        ad: InstreamAd,
        adPlayer: InstreamAdPlayer,
        videoPlayer: VideoPlayer
    )
  • Binds InstreamAdBinder to the ad view and starts ad playback.

    Declaration

    Swift

    public func bind(with adView: InstreamAdView)
  • Unbinds binder from the ad view and frees resources.

    Declaration

    Swift

    public func unbind()
  • This method should be called if corresponding VideoPlayer can not be used anymore.

    Declaration

    Swift

    public func invalidateVideoPlayer()
  • This method should be called if corresponding InstreamAdPlayer can not be used anymore.

    Declaration

    Swift

    public func invalidateAdPlayer()
  • Preloads the ad. Use this method before calling bind.

    Declaration

    Swift

    public func prepareAd()