IMAAdDisplayContainer

@interface IMAAdDisplayContainer : NSObject

The IMAAdDisplayContainer is responsible for managing the ad container view and companion ad slots used for ad playback.

  • View containing the video display and ad related UI. This view must be present in the view hierarchy in order to make ad or stream requests.

    Declaration

    Swift

    var adContainer: UIView! { get }

    Objective-C

    @property (readonly, strong, nonatomic) UIView *adContainer;
  • List of companion ad slots. Can be nil or empty.

    Declaration

    Swift

    var companionSlots: [Any]! { get }

    Objective-C

    @property (readonly, copy, nonatomic) NSArray *companionSlots;
  • Initializes IMAAdDisplayContainer for rendering the ad and displaying the ad UI without any companion slots.

    Declaration

    Swift

    init!(adContainer: UIView!)

    Objective-C

    - (instancetype)initWithAdContainer:(UIView *)adContainer;

    Parameters

    adContainer

    the UIView where the ad will be rendered. Fills the view’s bounds.

    Return Value

    the IMAAdDisplayContainer instance

  • Initializes IMAAdDisplayContainer for rendering the ad and displaying the ad UI.

    Declaration

    Swift

    init!(adContainer: UIView!, companionSlots: [Any]!)

    Objective-C

    - (instancetype)initWithAdContainer:(UIView *)adContainer
                         companionSlots:(NSArray *)companionSlots;

    Parameters

    adContainer

    the UIView where the ad will be rendered. Fills the view’s bounds.

    companionSlots

    the array of IMACompanionAdSlots. Can be nil or empty.

    Return Value

    the IMAAdDisplayContainer instance

  • Registers your application’s video playback controls that will overlay this container. Multiple controls may be registered with this method. WARNING: It is critical that this UI obscure as little ad space as possible so that viewabilty measurement isn’t impacted.

    Declaration

    Swift

    func registerVideoControlsOverlay(_ videoControlsOverlay: UIView!)

    Objective-C

    - (void)registerVideoControlsOverlay:(UIView *)videoControlsOverlay;

    Parameters

    videoControlsOverlay

    Small or mostly transparent video controls presented over the container.

  • Unregisters all previously registered video controls overlays.

    Declaration

    Swift

    func unregisterAllVideoControlsOverlays()

    Objective-C

    - (void)unregisterAllVideoControlsOverlays;