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 Object
implements com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer, AdPlayer.Listener<AdAsset>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
static final double
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
getAdType
(com.google.ads.interactivemedia.v3.api.AdPodInfo adPodInfo) com.google.ads.interactivemedia.v3.api.player.AdMediaInfo
Returns the currentAdMediaInfo
, or null otherwise.int
long
android.os.Handler
int
boolean
void
loadAd
(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo, com.google.ads.interactivemedia.v3.api.AdPodInfo adPodInfo) void
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
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.UseplayAd(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) 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
-
Field Details
-
IMA_PREROLL_POSITION
public static final double IMA_PREROLL_POSITION- See Also:
-
IMA_POSTROLL_POSITION
public static final double IMA_POSTROLL_POSITION- See Also:
-
-
Method Details
-
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.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.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:
release
in interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
playAd
Deprecated. -
loadAd
Deprecated. -
stopAd
Deprecated. -
pauseAd
Deprecated. -
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:
loadAd
in interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
playAd
public void playAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo) - Specified by:
playAd
in interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
pauseAd
public void pauseAd(com.google.ads.interactivemedia.v3.api.player.AdMediaInfo adMediaInfo) - Specified by:
pauseAd
in 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:
stopAd
in interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
addCallback
public void addCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback) - Specified by:
addCallback
in interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
removeCallback
public void removeCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback videoAdPlayerCallback) - Specified by:
removeCallback
in interfacecom.google.ads.interactivemedia.v3.api.player.VideoAdPlayer
-
getAdProgress
public com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate getAdProgress()- Specified by:
getAdProgress
in interfacecom.google.ads.interactivemedia.v3.api.player.AdProgressProvider
-
getVolume
public int getVolume()- Specified by:
getVolume
in interfacecom.google.ads.interactivemedia.v3.api.player.VolumeProvider
-
onAdProgress
Description copied from interface:AdPlayer.Listener
Called when an ad has made progress.- Specified by:
onAdProgress
in 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.Listener
Called when an Ad duration has been changed.- Specified by:
onDurationChanged
in interfaceAdPlayer.Listener<AdAsset>
- Parameters:
duration
- the duration of the current Ad.
-
onAdStarted
Description copied from interface:AdPlayer.Listener
Called when an Ad is started.- Specified by:
onAdStarted
in interfaceAdPlayer.Listener<AdAsset>
- Parameters:
ad
- the started Ad.
-
onAdCompleted
Description copied from interface:AdPlayer.Listener
Called when an Ad is completed.- Specified by:
onAdCompleted
in interfaceAdPlayer.Listener<AdAsset>
- Parameters:
ad
- the completed Ad.
-
onAdPaused
Description copied from interface:AdPlayer.Listener
Called when an Ad is paused.- Specified by:
onAdPaused
in interfaceAdPlayer.Listener<AdAsset>
- Parameters:
ad
- the paused ad.
-
onAdResumed
Description copied from interface:AdPlayer.Listener
Called when an ad is resumed.- Specified by:
onAdResumed
in interfaceAdPlayer.Listener<AdAsset>
- Parameters:
ad
- the resumed Ad.
-
onAdSkipped
Description copied from interface:AdPlayer.Listener
Called when an ad is skipped.- Specified by:
onAdSkipped
in interfaceAdPlayer.Listener<AdAsset>
- Parameters:
ad
- the skipped ad.
-
onError
Description copied from interface:AdPlayer.Listener
Called when an error happened.- Specified by:
onError
in interfaceAdPlayer.Listener<AdAsset>
- Parameters:
ad
- the ad that failed to play and originated the error.e
- exception.
-
getAdType
@RestrictTo(LIBRARY) public AdAsset.AdType getAdType(@Nullable com.google.ads.interactivemedia.v3.api.AdPodInfo adPodInfo) -
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
-
loadAd(AdMediaInfo, AdPodInfo)