IMA SDK Team |
class ViewController: UIViewController, IMAAdsLoaderDelegate, IMAStreamManagerDelegate, IMAVideoDisplayDelegate { ************************************************************************************ var imaVideoDisplay = IMAAVPlayerVideoDisplay() private var isPlaying = Bool() { didSet { if isPlaying { imaVideoDisplay.play() self.playButton.isSelected = true } else { imaVideoDisplay.pause() self.playButton.isSelected = false } } } func requestStream() { imaVideoDisplay = IMAAVPlayerVideoDisplay(avPlayer: contentPlayer!) imaVideoDisplay.delegate = self ************************************************************************************ } func videoDisplayDidPause(_ videoDisplay: any IMAVideoDisplay) {/* This will fire when pausing through imaVideoDisplay*/} func videoDisplayDidResume(_ videoDisplay: any IMAVideoDisplay) {/*This will fire when resuming through imaVideoDisplay*/}
IMA SDK Team |