Back to Exoplayer

AdsLoader.EventListener (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/ads/AdsLoader.EventListener.html

latest2.1 KB
Original Source

Package com.google.android.exoplayer2.source.ads

Interface AdsLoader.EventListener


public static interfaceAdsLoader.EventListener

Listener for ads loader events. All methods are called on the main thread.

Method Summary

All Methods Instance Methods Default Methods | Modifier and Type | Method | Description | | --- | --- | --- | | default void | onAdClicked() | Called when the user clicks through an ad (for example, following a 'learn more' link). | | default void | onAdLoadError​(AdsMediaSource.AdLoadException error, DataSpec dataSpec) | Called when there was an error loading ads. | | default void | onAdPlaybackState​(AdPlaybackState adPlaybackState) | Called when the ad playback state has been updated. | | default void | onAdTapped() | Called when the user taps a non-clickthrough part of an ad. |

Method Detail

- 

onAdPlaybackState

default void onAdPlaybackState​([AdPlaybackState](AdPlaybackState.html "class in com.google.android.exoplayer2.source.ads")adPlaybackState)

Called when the ad playback state has been updated. The number of ad groups may not change after the first call. Parameters:adPlaybackState - The new ad playback state.

- 

onAdLoadError

default void onAdLoadError​([AdsMediaSource.AdLoadException](AdsMediaSource.AdLoadException.html "class in com.google.android.exoplayer2.source.ads")error,[DataSpec](../../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec)

Called when there was an error loading ads. Parameters:error - The error.dataSpec - The data spec associated with the load error.

- 

onAdClicked

default void onAdClicked()

Called when the user clicks through an ad (for example, following a 'learn more' link).

- 

onAdTapped

default void onAdTapped()

Called when the user taps a non-clickthrough part of an ad.