public class GoogleIMAVideoAdPlayer extends java.lang.Object implements com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer, AdPlayer.Listener<AdAsset>
Modifier and Type | Method and Description |
---|---|
void |
addCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback) |
com.google.ads.interactivemedia.v3.api.Ad |
getAd() |
com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate |
getAdProgress() |
com.google.ads.interactivemedia.v3.api.player.AdMediaInfo |
getCurrentAdMediaInfo()
Returns the current
AdMediaInfo , or null otherwise. |
int |
getCurrentPosition() |
int |
getVolume() |
boolean |
isPlaying() |
void |
loadAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo,
com.google.ads.interactivemedia.v3.api.AdPodInfo adPodInfo) |
void |
loadAd(java.lang.String url)
Deprecated.
|
void |
onAdCompleted(AdAsset ad)
Called when an Ad is completed.
|
void |
onAdPaused(AdAsset ad)
Called when an Ad is paused.
|
void |
onAdProgress(long position,
AdAsset ad)
Called when an ad has made progress.
|
void |
onAdResumed(AdAsset ad)
Called when an ad is resumed.
|
void |
onAdSkipped(AdAsset ad)
Called when an ad is skipped.
|
void |
onAdStarted(AdAsset ad)
Called when an Ad is started.
|
void |
onDurationChanged(long duration)
Called when an Ad duration has been changed.
|
void |
onError(AdAsset ad,
java.lang.Exception e)
Called when an error happened.
|
void |
pause()
Deprecated.
|
void |
pauseAd()
Deprecated.
|
void |
pauseAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo) |
void |
playAd()
Deprecated.
|
void |
playAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo) |
void |
release() |
void |
removeCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback) |
void |
resumeAd()
Deprecated.
Use
playAd(AdMediaInfo) } |
void |
seekTo(long adPosition) |
void |
setAd(com.google.ads.interactivemedia.v3.api.Ad imaAd) |
void |
skipAd() |
void |
start()
Deprecated.
|
void |
stopAd()
Deprecated.
|
void |
stopAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onError
public void setAd(@Nullable com.google.ads.interactivemedia.v3.api.Ad imaAd)
@Nullable public com.google.ads.interactivemedia.v3.api.Ad getAd()
public int getCurrentPosition()
@Deprecated public void start()
playAd(AdMediaInfo)
@Deprecated public void pause()
pauseAd(AdMediaInfo)
public boolean isPlaying()
public void seekTo(long adPosition)
public void release()
release
in interface com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
@Deprecated public void playAd()
playAd(AdMediaInfo)
@Deprecated public void loadAd(java.lang.String url)
loadAd(AdMediaInfo, AdPodInfo)
@Deprecated public void stopAd()
stopAd(AdMediaInfo)
@Deprecated public void pauseAd()
pauseAd(AdMediaInfo)
@Deprecated public void resumeAd()
playAd(AdMediaInfo)
}public void loadAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo, @Nullable com.google.ads.interactivemedia.v3.api.AdPodInfo adPodInfo)
loadAd
in interface com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
public void playAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo)
playAd
in interface com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
public void pauseAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo)
pauseAd
in interface com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
public void skipAd()
public void stopAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo)
stopAd
in interface com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
public void addCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback)
addCallback
in interface com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
public void removeCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback)
removeCallback
in interface com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
public com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate getAdProgress()
getAdProgress
in interface com.google.ads.interactivemedia.v3.api.player.AdProgressProvider
public int getVolume()
getVolume
in interface com.google.ads.interactivemedia.v3.api.player.VolumeProvider
public void onAdProgress(long position, @NonNull AdAsset ad)
AdPlayer.Listener
onAdProgress
in interface AdPlayer.Listener<AdAsset>
position
- the current position of the playback in milliseconds.ad
- the current ad being played.public void onDurationChanged(long duration)
AdPlayer.Listener
onDurationChanged
in interface AdPlayer.Listener<AdAsset>
duration
- the duration of the current Ad.public void onAdStarted(@NonNull AdAsset ad)
AdPlayer.Listener
onAdStarted
in interface AdPlayer.Listener<AdAsset>
ad
- the started Ad.public void onAdCompleted(@NonNull AdAsset ad)
AdPlayer.Listener
onAdCompleted
in interface AdPlayer.Listener<AdAsset>
ad
- the completed Ad.public void onAdPaused(@NonNull AdAsset ad)
AdPlayer.Listener
onAdPaused
in interface AdPlayer.Listener<AdAsset>
ad
- the paused ad.public void onAdResumed(@NonNull AdAsset ad)
AdPlayer.Listener
onAdResumed
in interface AdPlayer.Listener<AdAsset>
ad
- the resumed Ad.public void onAdSkipped(@NonNull AdAsset ad)
AdPlayer.Listener
onAdSkipped
in interface AdPlayer.Listener<AdAsset>
ad
- the skipped ad.public void onError(@NonNull AdAsset ad, @NonNull java.lang.Exception e)
AdPlayer.Listener
onError
in interface AdPlayer.Listener<AdAsset>
ad
- the ad that failed to play and originated the error.e
- exception.@Nullable public com.google.ads.interactivemedia.v3.api.player.AdMediaInfo getCurrentAdMediaInfo()
AdMediaInfo
, or null otherwise.