Class GoogleIMAVideoAdPlayer

  • All Implemented Interfaces:

    public class GoogleIMAVideoAdPlayer
    extends java.lang.Object
    implements, AdPlayer.Listener<AdAsset>
    • Method Detail

      • setAd

        public void setAd​(@Nullable
      • getAd

        public getAd()
      • getCurrentPosition

        public int getCurrentPosition()
      • getCurrentPositionLong

        public long getCurrentPositionLong()
      • start

        public void start()
        Starts or resumes playback. If playback had previously been paused, playback will continue from where it was paused. If playback had been stopped, or never started before, playback will start at the beginning.
      • isPlaying

        public boolean isPlaying()
        Whether the ad player is playing.
      • seekTo

        public void seekTo​(long adPosition)
      • release

        public void release()
        Specified by:
        release in interface
      • loadAd

        public void loadAd​( adMediaInfo,
        Specified by:
        loadAd in interface
      • playAd

        public void playAd​( adMediaInfo)
        Specified by:
        playAd in interface
      • pauseAd

        public void pauseAd​( adMediaInfo)
        Specified by:
        pauseAd in interface
      • skipAd

        public void skipAd()
      • stopAd

        public void stopAd​( adMediaInfo)
        Specified by:
        stopAd in interface
      • addCallback

        public void addCallback​( videoAdPlayerCallback)
        Specified by:
        addCallback in interface
      • removeCallback

        public void removeCallback​( videoAdPlayerCallback)
        Specified by:
        removeCallback in interface
      • getAdProgress

        public getAdProgress()
        Specified by:
        getAdProgress in interface
      • getVolume

        public int getVolume()
        Specified by:
        getVolume in interface
      • onAdProgress

        public void onAdProgress​(long position,
                                 AdAsset ad)
        Description copied from interface: AdPlayer.Listener
        Called when an ad has made progress.
        Specified by:
        onAdProgress in interface AdPlayer.Listener<AdAsset>
        position - the current position of the playback in milliseconds.
        ad - the current ad being played.
      • onDurationChanged

        public void onDurationChanged​(long duration)
        Description copied from interface: AdPlayer.Listener
        Called when an Ad duration has been changed.
        Specified by:
        onDurationChanged in interface AdPlayer.Listener<AdAsset>
        duration - the duration of the current Ad.
      • onError

        public void onError​(@NonNull
                            AdAsset ad,
                            java.lang.Exception e)
        Description copied from interface: AdPlayer.Listener
        Called when an error happened.
        Specified by:
        onError in interface AdPlayer.Listener<AdAsset>
        ad - the ad that failed to play and originated the error.
        e - exception.
      • getCurrentAdMediaInfo

        public getCurrentAdMediaInfo()
        Returns the current AdMediaInfo, or null otherwise.
      • getMainHandler

        public android.os.Handler getMainHandler()