BMPAd

Objective-C

@protocol BMPAd <NSObject, _BMPJsonEncodable>

Swift

protocol Ad : _JsonEncodable

Defines basic properties available for every ad type

  • Determines whether an ad is linear, i.e. playback of main content needs to be paused for the ad.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isLinear;

    Swift

    var isLinear: Bool { get }

    Return Value

    Whether an ad is linear, i.e. playback of main content needs to be paused for the ad.

  • The width of the ad.

    Declaration

    Objective-C

    @property (nonatomic) NSInteger width;

    Swift

    var width: Int { get set }

    Return Value

    The width of the ad.

  • The height of the ad.

    Declaration

    Objective-C

    @property (nonatomic) NSInteger height;

    Swift

    var height: Int { get set }

    Return Value

    The height of the ad.

  • Identifier for the ad. This might be autogenerated.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSString *identifier;

    Swift

    var identifier: String? { get set }

    Return Value

    The identifier for the ad. This might be autogenerated.

  • The corresponding media file url for the ad.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSURL *mediaFileUrl;

    Swift

    var mediaFileUrl: URL? { get set }

    Return Value

    The corresponding media file url for the ad.

  • The url the user should be redirected to when clicking the ad.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSURL *clickThroughUrl;

    Swift

    var clickThroughUrl: URL? { get set }

    Return Value

    The url the user should be redirected to when clicking the ad.

  • Holds various additional ad data.

    See

    AdData

    Declaration

    Objective-C

    @property (nonatomic, nullable) id<BMPAdData> data;

    Swift

    var data: AdData? { get set }

    Return Value

    Various additional AdData.

  • Callback to track the opening of the clickThroughUrl in case a custom UI is used.

    This is only supported when using AdSourceType.bitmovin for the related AdSource. When our UIs are used, this will be handled automatically and should not be called manually.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) void (^)(void) clickThroughUrlOpened;

    Swift

    var clickThroughUrlOpened: (() -> Void)? { get }

    Return Value

    Callback to track the opening of the clickThroughUrl.