OOPulseVideoAd

Objective-C

@protocol OOPulseVideoAd <OOPulseAd>

Swift

protocol OOPulseVideoAd : OOPulseAd

This is the protocol for video ads owned by a OOPulseSession.

This protocol is used to notify the session about events regarding this ad, and provides access to relevant properties.

You must notify this object of the following events:

Depending on your application some of the other methods may need to be called in response to user interaction.

Ad event notifications

  • Notify the session that the ad has started playing.

    This should only be called after your delegate has been instructed to play the ad through -[OOPulseSessionDelegate startAdPlaybackWithAd:timeout:].

    Declaration

    Objective-C

    - (void)adStarted;

    Swift

    func adStarted()
  • Notify the session that the ad has started playing and report the player volume. The player volume is needed to make sure Open Measurement tracking is accurate.

    This should only be called after your delegate has been instructed to play the ad through -[OOPulseSessionDelegate startAdPlaybackWithAd:timeout:] and the user-visible phase of the ad has begun.

    Declaration

    Objective-C

    - (void)adStarted:(CGFloat)playerVolume;

    Swift

    func adStarted(_ playerVolume: CGFloat)

    Parameters

    playerVolume

    Player volume in a range between 0 and 1. Default value is 1.

  • Notify the session that the ad has played to completion.

    After this, one of the following delegate methods may be triggered:

    Declaration

    Objective-C

    - (void)adFinished;

    Swift

    func adFinished()
  • Notify the session that the ad was skipped by the user.

    After this, one of the following delegate methods may be triggered:

    Declaration

    Objective-C

    - (void)adSkipped;

    Swift

    func adSkipped()
  • Notify the session that the ad playback position has changed, either as a result of seeking or normal playback.

    This may trigger preloadNextAdWithAd through -[OOPulseSessionDelegate preloadNextAdWithAd:] if all of the conditions below are fulfilled:

    1. Preload next ad feature is enabled for your Pulse account.
    2. There are more ads to be played in the current ad break.
    3. Time to preload next ad has been reached. This means that the remaining duration of current ad is less than or equal to what has been configured for preloading next ad.
    4. preloadNextAd has not already been triggered for the ad.

    Declaration

    Objective-C

    - (void)adPositionChanged:(NSTimeInterval)position;

    Swift

    func adPositionChanged(_ position: TimeInterval)

    Parameters

    position

    The ad position in seconds since start.

  • Notify the session that the ad has paused.

    Declaration

    Objective-C

    - (void)adPaused;

    Swift

    func adPaused()
  • Notify the session that the ad has resumed playback.

    Declaration

    Objective-C

    - (void)adResumed;

    Swift

    func adResumed()
  • Notify the session that, due to an error, the ad could not be played or that playback could not continue.

    Declaration

    Objective-C

    - (void)adFailedWithError:(OOPulseAdError)error;

    Swift

    func adFailedWithError(_ error: OOPulseAdError)

    Parameters

    error

    The OOPulseAdError that best describes the problem.

  • Notify all video listeners that the native video Player State has changed. This is related to viewability calculations when using OM SDK Integration.

    Declaration

    Objective-C

    - (void)playerStateChanged:(OOPlayerState)playerState;

    Swift

    func playerStateChanged(_ playerState: OOPlayerState)

    Parameters

    playerState

    The OOPlayerState that the video player has entered into.

  • Notify all video listeners that the native video player volume has changed.

    • This is related to viewability calculations when using OM SDK Integration. *
    • - parameter: videoPlayerVolume from the native video player with a range between 0 and 1

    Declaration

    Objective-C

    - (void)playerVolumeChanged:(CGFloat)videoPlayerVolume;

    Swift

    func playerVolumeChanged(_ videoPlayerVolume: CGFloat)

Ad properties

  • Returns an array of media files for this ad.

    Your application should choose the best media file to display based on size bandwidth, and format considerations.

    If none of the media files are supported by your video player, you should call -[OOPulseVideoAd adFailedWithError:] with OOPulseAdError.OOPulseAdErrorNoSupportedMediaFile.

    Declaration

    Objective-C

    - (NSArray<OOMediaFile *> *)mediaFiles;

    Swift

    func mediaFiles() -> [OOMediaFile]!

    Return Value

    A NSArray of OOMediaFile instances.

  • Determine whether or not a skip button for the ad may be displayed.

    If true, check the value of -[OOPulseVideoAd skipOffset], which is the amount of seconds from the start of the ad at which the button should first be displayed.

    When the viewer activates this button, call -[OOPulseVideoAd adSkipped].

    Declaration

    Objective-C

    - (BOOL)isSkippable;

    Swift

    func isSkippable() -> Bool
  • The amount of seconds from the start of the ad at which the button should first be displayed.

    If an OOPulseVideoAd is playing, and a call to -[OOPulseVideoAd isSkippable] returns YES, show a skip button after this amount of seconds has passed.

    Declaration

    Objective-C

    - (NSTimeInterval)skipOffset;

    Swift

    func skipOffset() -> TimeInterval
  • The ad variant type.

    Declaration

    Objective-C

    - (OOPulseAdVariant)variant;

    Swift

    func variant() -> OOPulseAdVariant
  • The ad id.

    Declaration

    Objective-C

    - (NSString *)identifier;

    Swift

    func identifier() -> String!
  • Indicates whether the ad is ready to be displayed.

    Declaration

    Objective-C

    - (BOOL)isReady;

    Swift

    func isReady() -> Bool
  • The maximum time in seconds the SDK waits for a ‘lazy’ ad to load (including potential passback candidate requests).

    Declaration

    Objective-C

    - (NSTimeInterval)maximumPreparationTime;

    Swift

    func maximumPreparationTime() -> TimeInterval
  • The maximum time in seconds the end user should be allowed to wait for an ad to load before the ad must be discarded.

    Declaration

    Objective-C

    - (NSTimeInterval)startTimeout;

    Swift

    func startTimeout() -> TimeInterval
  • The candidate ad number in the passback chain.

    Declaration

    Objective-C

    - (NSInteger)candidateNum;

    Swift

    func candidateNum() -> Int
  • The custom ad identifier set in the Ooyala Pulse UI.

    Declaration

    Objective-C

    - (NSString *)customIdentifier;

    Swift

    func customIdentifier() -> String!
  • The Identifier of the advertiser to which the ad belongs.

    Declaration

    Objective-C

    - (NSString *)advertiserIdentifier;

    Swift

    func advertiserIdentifier() -> String!
  • The Identifier of the campaign to which the ad belongs; supplied by Ooyala Pulse.

    Declaration

    Objective-C

    - (NSString *)campaignIdentifier;

    Swift

    func campaignIdentifier() -> String!
  • The custom Identifier of the campaign to which the ad belongs; set in the Ooyala Pulse UI.

    Declaration

    Objective-C

    - (NSString *)customCampaignIdentifier;

    Swift

    func customCampaignIdentifier() -> String!
  • The Identifier of the goal to which the ad belongs; supplied by Ooyala Pulse.

    Declaration

    Objective-C

    - (NSString *)goalIdentifier;

    Swift

    func goalIdentifier() -> String!
  • The custom Identifier of the goal to which the ad belongs; set in the Ooyala Pulse UI.

    Declaration

    Objective-C

    - (NSString *)customGoalIdentifier;

    Swift

    func customGoalIdentifier() -> String!
  • Whether or not the ad is part of an exclusive campaign.

    Declaration

    Objective-C

    - (BOOL)partOfAnExclusiveCampaign;

    Swift

    func partOfAnExclusiveCampaign() -> Bool
  • Whether or not to display a remaining time countdown when this ad is being displayed.

    Declaration

    Objective-C

    - (BOOL)showCountdown;

    Swift

    func showCountdown() -> Bool
  • Returns YES if this ad has passback ad sources available.

    Declaration

    Objective-C

    - (BOOL)hasPassback;

    Swift

    func hasPassback() -> Bool
  • A Boolean value that identifies a conditional ad. A value of true indicates that the ad is conditional and should be used in all cases where the inline executable unit (such as VPAID) is not an ad but is instead a framework for finding an ad; a value of false is the default value and indicates that an ad is available.

    Declaration

    Objective-C

    - (BOOL)isConditionalAd;

    Swift

    func isConditionalAd() -> Bool
  • A URL to any resource relating to an integrated survey.

    Declaration

    Objective-C

    - (NSURL *)survey;

    Swift

    func survey() -> URL!
  • An array containing all the OOAdSurvey elements, containing any resource relating to an integrated survey.

    Declaration

    Objective-C

    - (NSArray *)surveys;

    Swift

    func surveys() -> [Any]!
  • A string that provides a common name for the ad.

    Declaration

    Objective-C

    - (NSString *)title;

    Swift

    func title() -> String!
  • A string that provides the name of the advertiser as defined by the ad serving party.

    Declaration

    Objective-C

    - (NSString *)advertiser;

    Swift

    func advertiser() -> String!
  • A string value that describes a longer description of the ad.

    Declaration

    Objective-C

    - (NSString *)adDescription;

    Swift

    func adDescription() -> String!
  • Used to provide a value that represents a price that can be used by real-time bidding (RTB) systems.

    Declaration

    Objective-C

    - (OOAdPricing *)adPricing;

    Swift

    func adPricing() -> OOAdPricing!
  • An array of OOAdCategory objects containing the categories of the Ad and their responsible authorities.

    Declaration

    Objective-C

    - (NSArray *)categories;

    Swift

    func categories() -> [Any]!
  • An array containing the OOAdVerification elements, which are used to initiate a controlled container where code can be executed for collecting data to verify ad playback details.

    Declaration

    Objective-C

    - (NSArray<OOAdVerification *> *)adVerifications;

    Swift

    func adVerifications() -> [OOAdVerification]!
  • Bool that provides value for if omsdk is enabled

    Declaration

    Objective-C

    - (BOOL)isOmsdkEnabled;

    Swift

    func isOmsdkEnabled() -> Bool
  • Information about the system that serves the ad.

    Declaration

    Objective-C

    - (OOAdSystem *)adSystem;

    Swift

    func adSystem() -> OOAdSystem!
  • Returns an array of companion banners for this ad.

    Your application should choose the proper companion banner to display based on their zone identifier.

    Declaration

    Objective-C

    - (NSArray<id<OOPulseCompanionAd>> *)companions;

    Swift

    func companions() -> [any OOPulseCompanionAd]!

    Return Value

    A NSArray of objects conforming to the OOPulseCompanionAd protocol.

  • Returns condition of ad describe the conditions for when a particular VPInsertionPoint should be triggered..

    Declaration

    Objective-C

    - (VPCondition *)adCondition;

    Swift

    func adCondition() -> VPCondition!

    Return Value

    the condition