InstreamAdBinder
@objc(YMAInstreamAdBinder)
@objcMembers
public class InstreamAdBinder : NSObject
InstreamAdBinder automatically presents instream ads.
- delegate
- init(ad:adPlayer:videoPlayer:)
- bind(with:)
- unbind()
- invalidateVideoPlayer()
- invalidateAdPlayer()
- prepareAd()
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
.Declaration
Swift
public convenience init(
ad: InstreamAd,
adPlayer: InstreamAdPlayer,
videoPlayer: VideoPlayer
)
Binds InstreamAdBinder
to the ad view and starts ad playback.
adView:
InstreamAdView
that contains ad and content player views.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()