InstreamAdPlayer
@objc(YMAInstreamAdPlayer)
public protocol InstreamAdPlayer
This protocol is used for playing instream ads.
-
Delegate object. For each event that happend during the playback, the corresponding callback must be called on this object.
Declaration
Swift
weak var delegate: InstreamAdPlayerDelegate? { get set }
-
Indicates whether the player is playing an ad.
Declaration
Swift
var isPlaying: Bool { get }
-
Ad video duration in seconds.
Declaration
Swift
var duration: TimeInterval { get }
-
Ad video position in seconds.
Declaration
Swift
var position: TimeInterval { get }
-
Prepares player to play passed media file.
Declaration
Swift
func prepareAd(with videoAd: VideoAd)
Parameters
videoAd
Object providing information about current advertising. This object should be passed back in all callbacks to InstreamAdPlayerDelegate.
-
Starts the ad.
Declaration
Swift
func playAd()
-
Pauses the ad.
Declaration
Swift
func pauseAd()
-
Resumes the ad.
Declaration
Swift
func resumeAd()
-
Stops the ad.
Declaration
Swift
func stopAd()
-
Sets ad player volume to the passed value.
Declaration
Swift
func setVolume(_ level: Double)
Parameters
level
level of volume to set. The value should be between 0 and 1.