-
- All Implemented Interfaces:
-
com.brightcove.player.ads.AdPlayer
,com.brightcove.player.event.Component
@ListensFor(events = {EventType.ACTIVITY_PAUSED, EventType.ACTIVITY_RESUMED, EventType.FRAGMENT_PAUSED, EventType.FRAGMENT_RESUMED, EventType.AD_BREAK_STARTED, EventType.AD_BREAK_COMPLETED})@Emits(events = {EventType.AD_BREAK_STARTED, EventType.AD_STARTED, EventType.AD_COMPLETED, EventType.AD_BREAK_COMPLETED, EventType.AD_RESUMED, EventType.AD_PAUSED, EventType.AD_PROGRESS, EventType.AD_ERROR, EventType.WILL_INTERRUPT_CONTENT, EventType.WILL_RESUME_CONTENT, EventType.PLAY}) public final class ExoAdPlayer extends AbstractComponent implements AdPlayer<AdAsset>
Implementation of an AdPlayer using ExoPlayer.
ExoAdPlayer handles AdAsset as the type of Ads to be played.
-
-
Method Summary
Modifier and Type Method Description static ExoAdPlayer
create(@NonNull() BaseVideoView baseVideoView)
Creates an ExoAdPlayer and adds a PlayerView in the BaseVideoView. static ExoAdPlayer
create(@NonNull() BaseVideoView baseVideoView, @Nullable() AdPlayer.AdPlayerSettings adPlayerSettings)
Creates an ExoAdPlayer and adds a PlayerView in the BaseVideoView. static ExoAdPlayer
create(@NonNull() ViewGroup viewGroup, @NonNull() EventEmitter eventEmitter, @Nullable() AdPlayer.AdPlayerSettings adPlayerSettings)
Creates an ExoAdPlayer and adds a PlayerView in the provided ViewGroup. void
loadAd(@NonNull() AdAsset adAsset)
void
addListener(@NonNull() AdPlayer.Listener<AdAsset> listener)
void
removeListener(@NonNull() AdPlayer.Listener<AdAsset> listener)
void
playAd()
void
pauseAd()
void
seekTo(long position)
void
release()
void
skipAd()
void
stop()
int
getAdPlayerViewVisibility()
-
Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Methods inherited from class com.brightcove.player.ads.AdPlayer
loadAd, pauseAd, playAd, release, seekTo, skipAd
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
create
static ExoAdPlayer create(@NonNull() BaseVideoView baseVideoView)
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.
-
create
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
-
create
static ExoAdPlayer create(@NonNull() ViewGroup viewGroup, @NonNull() EventEmitter eventEmitter, @Nullable() AdPlayer.AdPlayerSettings adPlayerSettings)
Creates an ExoAdPlayer and adds a PlayerView in the provided ViewGroup.
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
-
addListener
void addListener(@NonNull() AdPlayer.Listener<AdAsset> listener)
-
removeListener
void removeListener(@NonNull() AdPlayer.Listener<AdAsset> listener)
-
playAd
void playAd()
-
pauseAd
void pauseAd()
-
seekTo
void seekTo(long position)
-
release
void release()
-
skipAd
void skipAd()
-
stop
void stop()
-
getAdPlayerViewVisibility
int getAdPlayerViewVisibility()
-
-
-
-