JWFriendlyAdObstructions

@interface JWFriendlyAdObstructions : NSObject

This interface allows to register views considered as friendly obstructions.

Note

Applicable to the Google IMA ad client only.

Friendly obstructions are views such as video controls that are essential to the user’s experience but do not impact viewability. Once registered as such, these controls are excluded from ad viewability measurements. These controls must only be fully transparent overlays or small buttons. Any other non-control views must not be registered.

When ad viewability via the OMSDK is calculated, all views overlaying the media element are considered obstructions and reduce the viewability rate.

You may register:

  • A transparent overlay used to capture user taps.

  • Transient buttons such as:

   1. Pause

   2. Play

   3. Fullscreen

   4. Cast/AirPlay

   5. Collapse

   6. Progress/Seek

   7. Other playback relevant actions

You must NOT register:

  • Watermarks

  • Pop ups

  • Dialogs

  • Non-transient buttons

  • Other obscuring views

For more information, see Open Measurement in the IMA SDK

  • List of views registered as friendly obstructions

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSArray<UIView *> *views;
  • Initializes an friendly obstructions instance with the given player. Must add every view that overlay the ads.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPlayer:(nonnull JWPlayerController *)player;

    Parameters

    player

    The JWPlayerController that you want to asociate

    Return Value

    A JWFriendlyAdObstructions instance

  • Register your custom video playback view that will overlay the ad container.

    Declaration

    Objective-C

    - (void)registerView:(UIView *_Nonnull)view;

    Parameters

    view

    The UI element appearing over the ad container.

  • Registers an array of custom video playback views that will overlay the ad container.

    Declaration

    Objective-C

    - (void)registerViews:(NSArray<UIView *> *_Nonnull)views;

    Parameters

    views

    The UI elements array appearing over the ad container.

  • Unregsiter a previously registered view that is not longer appearing over the ad container.

    Declaration

    Objective-C

    - (void)unregisterView:(UIView *_Nonnull)view;

    Parameters

    view

    The UI element to remove and is not longer over the ad container.

  • Unregsiter all previously registered views.

    Declaration

    Objective-C

    - (void)unregisterAllViews;