Package com.brightcove.ima
Class GoogleIMAVideoAdPlayer
- java.lang.Object
-
- com.brightcove.ima.GoogleIMAVideoAdPlayer
-
- All Implemented Interfaces:
AdPlayer.Listener<AdAsset>,com.google.ads.interactivemedia.v3.api.player.AdProgressProvider,com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer,com.google.ads.interactivemedia.v3.api.player.VolumeProvider
public class GoogleIMAVideoAdPlayer extends java.lang.Object implements com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer, AdPlayer.Listener<AdAsset>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback)com.google.ads.interactivemedia.v3.api.AdgetAd()com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdategetAdProgress()com.google.ads.interactivemedia.v3.api.player.AdMediaInfogetCurrentAdMediaInfo()Returns the currentAdMediaInfo, or null otherwise.intgetCurrentPosition()longgetCurrentPositionLong()ExoAdPlayergetExoAdPlayer()android.os.HandlergetMainHandler()intgetVolume()booleanisPlaying()voidloadAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo, com.google.ads.interactivemedia.v3.api.AdPodInfo adPodInfo)voidloadAd(java.lang.String url)Deprecated.voidonAdCompleted(AdAsset ad)Called when an Ad is completed.voidonAdPaused(AdAsset ad)Called when an Ad is paused.voidonAdProgress(long position, AdAsset ad)Called when an ad has made progress.voidonAdResumed(AdAsset ad)Called when an ad is resumed.voidonAdSkipped(AdAsset ad)Called when an ad is skipped.voidonAdStarted(AdAsset ad)Called when an Ad is started.voidonDurationChanged(long duration)Called when an Ad duration has been changed.voidonError(AdAsset ad, java.lang.Exception e)Called when an error happened.voidpause()Deprecated.voidpauseAd()Deprecated.voidpauseAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo)voidplayAd()Deprecated.voidplayAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo)voidrelease()voidremoveCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback)voidresumeAd()Deprecated.UseplayAd(AdMediaInfo)}voidseekTo(long adPosition)voidsetAd(com.google.ads.interactivemedia.v3.api.Ad imaAd)voidskipAd()voidstart()Deprecated.voidstopAd()Deprecated.voidstopAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.brightcove.player.ads.AdPlayer.Listener
onError
-
-
-
-
Method Detail
-
setAd
public void setAd(@Nullable com.google.ads.interactivemedia.v3.api.Ad imaAd)
-
getAd
@Nullable public com.google.ads.interactivemedia.v3.api.Ad getAd()
-
getCurrentPosition
public int getCurrentPosition()
-
getCurrentPositionLong
public long getCurrentPositionLong()
-
start
@Deprecated public void start()
Deprecated.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.
-
pause
@Deprecated public void pause()
Deprecated.Pauses playback.
-
isPlaying
public boolean isPlaying()
- Returns:
- Whether the ad player is playing.
-
seekTo
public void seekTo(long adPosition)
-
release
public void release()
- Specified by:
releasein interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
playAd
@Deprecated public void playAd()
Deprecated.
-
loadAd
@Deprecated public void loadAd(java.lang.String url)
Deprecated.
-
stopAd
@Deprecated public void stopAd()
Deprecated.
-
pauseAd
@Deprecated public void pauseAd()
Deprecated.
-
resumeAd
@Deprecated public void resumeAd()
Deprecated.UseplayAd(AdMediaInfo)}
-
loadAd
public void loadAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo, @Nullable com.google.ads.interactivemedia.v3.api.AdPodInfo adPodInfo)- Specified by:
loadAdin interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
playAd
public void playAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo)
- Specified by:
playAdin interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
pauseAd
public void pauseAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo)
- Specified by:
pauseAdin interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
skipAd
public void skipAd()
-
stopAd
public void stopAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo)
- Specified by:
stopAdin interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
addCallback
public void addCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback)
- Specified by:
addCallbackin interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
removeCallback
public void removeCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback)
- Specified by:
removeCallbackin interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
getAdProgress
public com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate getAdProgress()
- Specified by:
getAdProgressin interfacecom.google.ads.interactivemedia.v3.api.player.AdProgressProvider
-
getVolume
public int getVolume()
- Specified by:
getVolumein interfacecom.google.ads.interactivemedia.v3.api.player.VolumeProvider
-
onAdProgress
public void onAdProgress(long position, @NonNull AdAsset ad)Description copied from interface:AdPlayer.ListenerCalled when an ad has made progress.- Specified by:
onAdProgressin interfaceAdPlayer.Listener<AdAsset>- Parameters:
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.ListenerCalled when an Ad duration has been changed.- Specified by:
onDurationChangedin interfaceAdPlayer.Listener<AdAsset>- Parameters:
duration- the duration of the current Ad.
-
onAdStarted
public void onAdStarted(@NonNull AdAsset ad)Description copied from interface:AdPlayer.ListenerCalled when an Ad is started.- Specified by:
onAdStartedin interfaceAdPlayer.Listener<AdAsset>- Parameters:
ad- the started Ad.
-
onAdCompleted
public void onAdCompleted(@NonNull AdAsset ad)Description copied from interface:AdPlayer.ListenerCalled when an Ad is completed.- Specified by:
onAdCompletedin interfaceAdPlayer.Listener<AdAsset>- Parameters:
ad- the completed Ad.
-
onAdPaused
public void onAdPaused(@NonNull AdAsset ad)Description copied from interface:AdPlayer.ListenerCalled when an Ad is paused.- Specified by:
onAdPausedin interfaceAdPlayer.Listener<AdAsset>- Parameters:
ad- the paused ad.
-
onAdResumed
public void onAdResumed(@NonNull AdAsset ad)Description copied from interface:AdPlayer.ListenerCalled when an ad is resumed.- Specified by:
onAdResumedin interfaceAdPlayer.Listener<AdAsset>- Parameters:
ad- the resumed Ad.
-
onAdSkipped
public void onAdSkipped(@NonNull AdAsset ad)Description copied from interface:AdPlayer.ListenerCalled when an ad is skipped.- Specified by:
onAdSkippedin interfaceAdPlayer.Listener<AdAsset>- Parameters:
ad- the skipped ad.
-
onError
public void onError(@NonNull AdAsset ad, @NonNull java.lang.Exception e)Description copied from interface:AdPlayer.ListenerCalled when an error happened.- Specified by:
onErrorin interfaceAdPlayer.Listener<AdAsset>- Parameters:
ad- the ad that failed to play and originated the error.e- exception.
-
getCurrentAdMediaInfo
@Nullable public com.google.ads.interactivemedia.v3.api.player.AdMediaInfo getCurrentAdMediaInfo()
Returns the currentAdMediaInfo, or null otherwise.
-
getMainHandler
public android.os.Handler getMainHandler()
-
getExoAdPlayer
public ExoAdPlayer getExoAdPlayer()
-
-