JWAdBreak

@interface JWAdBreak : NSObject

JWAdBreak is an object providing info for an ad break in a video, played using JWPlayer. Single AdBreak or a set of multiple AdBreak should be fed to the JWAdConfig’s schedule array

  • Offset of the ad. Describes the point in time at which to play the ad. @Note Supported formats are:

    • pre: specifies that the ad should be played before the video content.
    • post: specifies that the ad should be played after the video content.
    • seconds - ‘50’
    • fractional seconds - ‘50.5’
    • percentage of the entire video - ‘50%’
    • hours, minutes, seconds, milliseconds : ‘hh:mm:ss.mmm’

    Declaration

    Objective-C

    @property (nonatomic, copy, readwrite) NSString *_Nonnull offset;
  • tag

    This option is the URL to the ad tag, which contains the VAST response.

    Declaration

    Objective-C

    @property (nonatomic, copy, readwrite, nullable) NSString *tag;
  • This option is the array of URLs to the ad tags, which contains the VAST response. tags array is used as a waterfall: if the first tag fails to play, the player falls back to the second in the list and so on, until it finds one that can be played.

    Note

    Only one add from the array is played, and the others are discarded.

    Declaration

    Objective-C

    @property (nonatomic, retain, readwrite, nullable) NSArray<NSString *> *tags;
  • This should be set to JWAdTypeNonlinear if you want to force the player to render a nonlinear ad in the ad response. Defaults to JWAdTypeLinear.

    Note

    Non-linear ads are not supported by Goolge IMA as of version B15. Setting this property to JWAdTypeNonlinear while using Google IMA will result in an assertion.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) JWAdType type;
  • Available for adBreaks within a VMAP retrieved from the JWPlayerDelegate’s onAdSchedule: callback.

    Note

    VAST only.

    See

    JWPlayerDelegate

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSDictionary *vmapInfo;
  • Factory method that creates a linear or non-linear AdBreak with tag and offset.

    Declaration

    Objective-C

    + (nonnull instancetype)adBreakWithTag:(nonnull NSString *)tag
                                    offset:(nonnull NSString *)offset
                                 nonLinear:(BOOL)nonLinear;

    Parameters

    tag

    This option is the URL to the ad tag, which contains the VAST response.

    offset

    Offset of the ad.

    nonLinear

    Boolean value that determines if adbreak is non-linear.

  • Factory method that creates a linear or non-linear AdBreak with waterfall tags and offset.

    Declaration

    Objective-C

    + (nonnull instancetype)adBreakWithTags:(nonnull NSArray *)tags
                                     offset:(nonnull NSString *)offset
                                  nonLinear:(BOOL)nonLinear;

    Parameters

    tags

    This option is the array of URLs to the ad tags, which contains the VAST response.

    offset

    Offset of the ad.

    nonLinear

    Boolean value that determines if adbreak is non-linear.

  • Factory method that creates an AdBreak with tag and offset.

    Declaration

    Objective-C

    + (nonnull instancetype)adBreakWithTag:(nonnull NSString *)tag
                                    offset:(nonnull NSString *)offset;

    Parameters

    tag

    This option is the URL to the ad tag, which contains the VAST response.

    offset

    Offset of the ad.

  • Factory method that creates an AdBreak with waterfall tags and offset.

    Declaration

    Objective-C

    + (nonnull instancetype)adBreakWithTags:(nonnull NSArray *)tags
                                     offset:(nonnull NSString *)offset;

    Parameters

    tags

    This option is the array of URLs to the ad tags, which contains the VAST response.

    offset

    Offset of the ad.

  • Inits an AdBreak with provided params.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithTags:(nonnull NSArray *)tags
                                  offset:(nonnull NSString *)offset;

    Parameters

    tags

    This option is the array of URLs to the ad tags, which contains the VAST response.

    offset

    Offset of the ad.