# AdViewProvider

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/AdViewProvider.java+class:androidx.media3.common.AdViewProvider)

*** ** * ** ***


```
public interface AdViewProvider
```

<br />

Known direct subclasses [PlayerView](https://developer.android.com/reference/androidx/media3/ui/PlayerView)

|---|---|
| `https://developer.android.com/reference/androidx/media3/ui/PlayerView` | A high level view for `https://developer.android.com/reference/androidx/media3/common/Player` media playbacks. |

*** ** * ** ***

Provides information about views for the ad playback UI.

## Summary

| ### Public methods |
|---|---|
| `default https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo>` | `https://developer.android.com/reference/androidx/media3/common/AdViewProvider#getAdOverlayInfos()()` Returns a list of `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo` instances describing views that are on top of the ad view group, but that are essential for controlling playback and should be excluded from ad viewability measurements. |
| `abstract @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/view/ViewGroup.html` | `https://developer.android.com/reference/androidx/media3/common/AdViewProvider#getAdViewGroup()()` Returns the `https://developer.android.com/reference/android/view/ViewGroup.html` on top of the player that will show any ad UI, or `null` if playing audio-only ads. |

## Public methods

### getAdOverlayInfos

```
default List<AdOverlayInfo> getAdOverlayInfos()
```

Returns a list of `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo` instances describing views that are on top of the ad view group, but that are essential for controlling playback and should be excluded from ad viewability measurements.

Each view must be either a fully transparent overlay (for capturing touch events), or a small piece of transient UI that is essential to the user experience of playback (such as a button to pause/resume playback or a transient full-screen or cast button). For more information see the documentation for your ads loader.

### getAdViewGroup

```
abstract @Nullable ViewGroup getAdViewGroup()
```

Returns the `https://developer.android.com/reference/android/view/ViewGroup.html` on top of the player that will show any ad UI, or `null` if playing audio-only ads. Any views on top of the returned view group must be described by `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo` returned by `https://developer.android.com/reference/androidx/media3/common/AdViewProvider#getAdOverlayInfos()`, for accurate viewability measurement.