Interface AdPlayer.Listener<T>

Type Parameters:
T - the type of Ad handled by the AdPlayer.
All Known Implementing Classes:
GoogleIMAVideoAdPlayer, PulseAdView
Enclosing interface:
AdPlayer<T>

public static interface AdPlayer.Listener<T>
Represents the callbacks from an AdPlayer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when an Ad is completed.
    void
    Called when an Ad is paused.
    void
    onAdProgress(long position, T ad)
    Called when an ad has made progress.
    void
    Called when an ad is resumed.
    void
    Called when an ad is skipped.
    void
    Called when an Ad is started.
    void
    onDurationChanged(long duration)
    Called when an Ad duration has been changed.
    default void
    Deprecated.
    Use @link #onError(Object, Exception)}.
    void
    Called when an error happened.
  • Method Details

    • onAdProgress

      void onAdProgress(long position, @NonNull T ad)
      Called when an ad has made progress.
      Parameters:
      position - the current position of the playback in milliseconds.
      ad - the current ad being played.
    • onDurationChanged

      void onDurationChanged(long duration)
      Called when an Ad duration has been changed.
      Parameters:
      duration - the duration of the current Ad.
    • onAdStarted

      void onAdStarted(@NonNull T ad)
      Called when an Ad is started.
      Parameters:
      ad - the started Ad.
    • onAdCompleted

      void onAdCompleted(@NonNull T ad)
      Called when an Ad is completed.
      Parameters:
      ad - the completed Ad.
    • onAdPaused

      void onAdPaused(@NonNull T ad)
      Called when an Ad is paused.
      Parameters:
      ad - the paused ad.
    • onAdResumed

      void onAdResumed(@NonNull T ad)
      Called when an ad is resumed.
      Parameters:
      ad - the resumed Ad.
    • onAdSkipped

      void onAdSkipped(@NonNull T ad)
      Called when an ad is skipped.
      Parameters:
      ad - the skipped ad.
    • onError

      @Deprecated default void onError(@NonNull Exception e)
      Deprecated.
      Use @link #onError(Object, Exception)}.
      Called when an error happened.
      Parameters:
      e - exception.
    • onError

      void onError(@NonNull T ad, @NonNull Exception e)
      Called when an error happened.
      Parameters:
      ad - the ad that failed to play and originated the error.
      e - exception.