Package com.brightcove.player.ads
Class ExoAdPlayer
java.lang.Object
com.brightcove.player.event.AbstractComponent
com.brightcove.player.ads.ExoAdPlayer
@ListensFor(events={"activityPaused","activityResumed","fragmentPaused","fragmentResumed","adBreakStarted","adBreakCompleted"})
@Emits(events={"adBreakStarted","adStarted","adCompleted","adBreakCompleted","adResumed","adPaused","adProgress","adError","willInterruptContent","willResumeContent","play"})
public final class ExoAdPlayer
extends AbstractComponent
implements AdPlayer<AdAsset>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.brightcove.player.ads.AdPlayer
AdPlayer.AdPlayerSettings, AdPlayer.Listener<T> -
Field Summary
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(AdPlayer.Listener<AdAsset> listener) Adds aAdPlayer.Listener.static ExoAdPlayercreate(android.view.ViewGroup viewGroup, EventEmitter eventEmitter, AdPlayer.AdPlayerSettings adPlayerSettings) Creates an ExoAdPlayer and adds a PlayerView in the providedViewGroup.static ExoAdPlayercreate(BaseVideoView baseVideoView) Creates an ExoAdPlayer and adds a PlayerView in the BaseVideoView.static ExoAdPlayercreate(BaseVideoView baseVideoView, AdPlayer.AdPlayerSettings adPlayerSettings) Creates an ExoAdPlayer and adds a PlayerView in the BaseVideoView.intvoidLoads an ad of type T.voidpauseAd()Pauses an ad.voidplayAd()Plays an ad.voidrelease()Releases theAdPlayer.voidremoveListener(AdPlayer.Listener<AdAsset> listener) Removes aAdPlayer.Listener.voidseekTo(long position) Seeks to the specified position.voidskipAd()Skips the current ad.voidstop()Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Method Details
-
create
Creates an ExoAdPlayer and adds a PlayerView in the BaseVideoView.Note: This method must be called from the UI thread.
- Parameters:
baseVideoView- where the Ad will be rendered.- Returns:
- a new instance of an ExoAdPlayer.
-
create
public static ExoAdPlayer create(@NonNull BaseVideoView baseVideoView, @Nullable AdPlayer.AdPlayerSettings adPlayerSettings) Creates an ExoAdPlayer and adds a PlayerView in the BaseVideoView.Note: This method must be called from the UI thread.
- Parameters:
baseVideoView- where the Ad will be rendered.adPlayerSettings- configuration object for the ad player- Returns:
- a new instance of an ExoAdPlayer.
-
create
public static ExoAdPlayer create(@NonNull android.view.ViewGroup viewGroup, @NonNull EventEmitter eventEmitter, @Nullable AdPlayer.AdPlayerSettings adPlayerSettings) Creates an ExoAdPlayer and adds a PlayerView in the providedViewGroup.Note: This method must be called from the UI thread.
- Parameters:
viewGroup- where the Ad will be rendered.eventEmitter- the event emitteradPlayerSettings- configuration object for the ad player- Returns:
- a new instance of an ExoAdPlayer.
-
loadAd
Description copied from interface:AdPlayerLoads an ad of type T. -
addListener
Description copied from interface:AdPlayerAdds aAdPlayer.Listener.- Specified by:
addListenerin interfaceAdPlayer<AdAsset>- Parameters:
listener- listener to be added.
-
removeListener
Description copied from interface:AdPlayerRemoves aAdPlayer.Listener.- Specified by:
removeListenerin interfaceAdPlayer<AdAsset>- Parameters:
listener- listener to be removed.
-
playAd
public void playAd()Description copied from interface:AdPlayerPlays an ad. -
pauseAd
public void pauseAd()Description copied from interface:AdPlayerPauses an ad. -
seekTo
public void seekTo(long position) Description copied from interface:AdPlayerSeeks to the specified position. -
release
public void release()Description copied from interface:AdPlayerReleases theAdPlayer. -
skipAd
public void skipAd()Description copied from interface:AdPlayerSkips the current ad. -
stop
public void stop() -
getAdPlayerViewVisibility
public int getAdPlayerViewVisibility()
-