T
- the type of Ad handled by the AdPlayer
.public static interface AdPlayer.Listener<T>
AdPlayer
.Modifier and Type | Method and Description |
---|---|
void |
onAdCompleted(T ad)
Called when an Ad is completed.
|
void |
onAdPaused(T ad)
Called when an Ad is paused.
|
void |
onAdProgress(long position,
T ad)
Called when an ad has made progress.
|
void |
onAdResumed(T ad)
Called when an ad is resumed.
|
void |
onAdSkipped(T ad)
Called when an ad is skipped.
|
void |
onAdStarted(T ad)
Called when an Ad is started.
|
void |
onDurationChanged(long duration)
Called when an Ad duration has been changed.
|
default void |
onError(java.lang.Exception e)
Deprecated.
Use @link #onError(Object, Exception)}.
|
void |
onError(T ad,
java.lang.Exception e)
Called when an error happened.
|
void onAdProgress(long position, @NonNull T ad)
position
- the current position of the playback in milliseconds.ad
- the current ad being played.void onDurationChanged(long duration)
duration
- the duration of the current Ad.void onAdStarted(@NonNull T ad)
ad
- the started Ad.void onAdCompleted(@NonNull T ad)
ad
- the completed Ad.void onAdPaused(@NonNull T ad)
ad
- the paused ad.void onAdResumed(@NonNull T ad)
ad
- the resumed Ad.void onAdSkipped(@NonNull T ad)
ad
- the skipped ad.@Deprecated default void onError(@NonNull java.lang.Exception e)
e
- exception.void onError(@NonNull T ad, @NonNull java.lang.Exception e)
ad
- the ad that failed to play and originated the error.e
- exception.