InstreamAdBinder
@objc(YMAInstreamAdBinder)
@objcMembers
@MainActor
public class InstreamAdBinder : NSObject
InstreamAdBinder automatically presents instream ads.
-
This object will be notified about the instream ad lifecycle.
Declaration
Swift
@MainActor 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
@MainActor public convenience init( ad: InstreamAd, adPlayer: InstreamAdPlayer, videoPlayer: VideoPlayer ) - ad: An ad loaded with
-
Binds
InstreamAdBinderto the ad view and starts ad playback.- adView:
InstreamAdViewthat contains ad and content player views.
Declaration
Swift
@MainActor public func bind(with adView: InstreamAdView) - adView:
-
Unbinds binder from the ad view and frees resources.
Declaration
Swift
@MainActor public func unbind() -
This method should be called if corresponding
VideoPlayercan not be used anymore.Declaration
Swift
@MainActor public func invalidateVideoPlayer() -
This method should be called if corresponding
InstreamAdPlayercan not be used anymore.Declaration
Swift
@MainActor public func invalidateAdPlayer() -
Preloads the ad. Use this method before calling
bind.Declaration
Swift
@MainActor public func prepareAd()