Register friendly obstructions (Android)

Register custom controls as friendly obstructions when using OMID with Google IMA ads in your Android app.

If you use the IAB Open Measurement Interface Definition (OMID) and run Google IMA ads, all custom video controls that overlay the media element must be registered as friendly obstructions. Friendly obstructions are views -- such as video controls -- that are essential to the user’s experience but do not impact viewability.

The JWFriendlyAdObstructions class enables you to register fully transparent overlays or small buttons. Once registered, your custom video controls are excluded from the ad viewability measurements that the Open Measurement SDK calculates.

The following table lists the views that can and cannot be registered.

PermittedNot Permitted
• Transparent overlay used to capture user taps

• Transient buttons such as the following:
      ◦ Pause
      ◦ Play
      ◦ Fullscreen
      ◦ Cast/AirPlay
      ◦ Collapse
      ◦ Progress/Seek
      ◦ Other playback-related actions
• Watermarks
• Pop-ups
• Dialogs
• Non-transient buttons
• Other obscuring views

Register friendly obstructions

Use the following steps and code sample to register a custom video control as a friendly ad obstruction:

  1. Add the custom view, for example customControlbar, to your app.
  2. Use getJWFriendlyAdObstructions() to get a reference to the list of friendly ad obstructions.
  3. Add the custom view to the JWFriendlyAdObstructions list.

mPlayerView = findViewById(;
View customControlbar = findViewById(;

// Add our custom controlbar to the list of friendly ad obstructions
friendlyAdObstructions = mPlayerView.getJWFriendlyAdObstructions();

List<AdBreak> adSchedules = new ArrayList<>();

AdBreak adBreak = new AdBreak.Builder()

ImaAdvertisingConfig imaAdvertisingConfig = new ImaAdvertisingConfig.Builder()

PlaylistItem playlistItem = new PlaylistItem.Builder()

List<PlaylistItem> playlist = new ArrayList<>();

PlayerConfig config = new PlayerConfig.Builder()