public interface

AdsLoader.EventListener

 androidx.media3.exoplayer.source.ads.AdsLoader.EventListener

Overview

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

Summary

Methods
public voidonAdClicked()

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

public voidonAdLoadError(AdsMediaSource.AdLoadException error, DataSpec dataSpec)

Called when there was an error loading ads.

public voidonAdPlaybackState(AdPlaybackState adPlaybackState)

Called when the ad playback state has been updated.

public voidonAdTapped()

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

Methods

public void onAdPlaybackState(AdPlaybackState 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.

public void onAdLoadError(AdsMediaSource.AdLoadException error, DataSpec dataSpec)

Called when there was an error loading ads.

Parameters:

error: The error.
dataSpec: The data spec associated with the load error.

public void onAdClicked()

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

public void onAdTapped()

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