OOPulseSessionDelegate
Objective-C
@protocol OOPulseSessionDelegate <NSObject>
Swift
protocol OOPulseSessionDelegate : NSObjectProtocol
This delegate is used by OOPulseSession
to communicate with your application.
It will inform your application of the proper time to perform certain actions, or when some events have occurred.
-
When called you should start (or resume) playback of the content.
Declaration
Objective-C
- (void)startContentPlayback;
Swift
func startContentPlayback()
-
When called you should pause playback of the content (if it was playing), and prepare your user interface for video ad playback.
You will be notified of each ad to display through
-[OOPulseSessionDelegate startAdPlaybackWithAd:timeout:]
.Declaration
Objective-C
- (void)startAdBreak:(id<OOPulseAdBreak>)adBreak;
Swift
func start(_ adBreak: (any OOPulseAdBreak)!)
Parameters
adBreak
The
OOPulseAdBreak
that has started. -
When called you should start playback of the given ad.
You are responsible for notifying the ad when certain events have occurred.
Declaration
Objective-C
- (void)startAdPlaybackWithAd:(id<OOPulseVideoAd>)ad timeout:(NSTimeInterval)timeout;
Swift
func startAdPlayback(with ad: (any OOPulseVideoAd)!, timeout: TimeInterval)
Parameters
ad
The
OOPulseVideoAd
to be displayed.timeout
The time you have until the first frame of the ad has displayed. If this was not possible, you are responsible for calling
-[OOPulseVideoAd adFailedWithError:]
withOOPulseAdError.OOPulseAdErrorTimedOut
. -
When called, you should start preloading the given ad.
Declaration
Objective-C
- (void)preloadNextAdWithAd:(id<OOPulseVideoAd>)ad;
Swift
optional func preloadNextAd(with ad: (any OOPulseVideoAd)!)
Parameters
ad
The
OOPulseVideoAd
to be displayed next. -
When called you should display the provided pause ad.
You are responsible for notifying the ad when certain events have occurred.
Declaration
Objective-C
- (void)showPauseAd:(id<OOPulsePauseAd>)ad;
Swift
optional func show(_ ad: (any OOPulsePauseAd)!)
Parameters
ad
The
OOPulsePauseAd
to be displayed.
-
The session has ended.
No further delegate methods will be called.
Declaration
Objective-C
- (void)sessionEnded;
Swift
func sessionEnded()
-
An illegal operation has occurred.
Most likely protocol methods in
OOPulseSession
orOOPulseVideoAd
were called when they were not expected.One way to recover from this would be to stop the current session, and continue playing the content.
Declaration
Objective-C
- (void)illegalOperationOccurredWithError:(NSError *)error;
Swift
func illegalOperationOccurredWithError(_ error: (any Error)!)
Parameters
error
The error that occurred.