Package com.brightcove.ima
Class GoogleIMAComponent
java.lang.Object
com.brightcove.player.event.AbstractComponent
com.brightcove.ima.GoogleIMAComponent
- All Implemented Interfaces:
Component
,com.google.ads.interactivemedia.v3.api.AdErrorEvent.AdErrorListener
,com.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener
,com.google.ads.interactivemedia.v3.api.AdsLoader.AdsLoadedListener
,com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider
@Emits(events={"adBreakCompleted","adCompleted","adError","adPaused","adProgress","adResumed","adBreakStarted","adStarted","completed","error","pause","play","willInterruptContent","willResumeContent","registerPlugin","setCuePoints","adsManagerLoaded","adsRequestForVideo","didFailToPlayAd","showSeekControls","hideSeekControls"})
@ListensFor(events={"activityCreated","activityPaused","activityResumed","activitySaveInstanceState","activityStarted","activityDestroyed","completed","cuePoint","fragmentCreatedView","fragmentPaused","fragmentResumed","fragmentSaveInstanceState","fragmentStarted","fragmentDestroyed","play","progress","seekTo","willChangeVideo","videoDurationChanged","adsManagerLoaded","didFailToPlayAd","showMediaControls"})
public class GoogleIMAComponent
extends AbstractComponent
implements com.google.ads.interactivemedia.v3.api.AdErrorEvent.AdErrorListener, com.google.ads.interactivemedia.v3.api.AdsLoader.AdsLoadedListener, com.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener, com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens
-
Constructor Summary
ConstructorDescriptionGoogleIMAComponent
(BaseVideoView baseVideoView, EventEmitter eventEmitter) Deprecated.GoogleIMAComponent
(BaseVideoView baseVideoView, EventEmitter eventEmitter, boolean useAdRules) Deprecated.Please use theGoogleIMAComponent.Builder
insteadGoogleIMAComponent
(BaseVideoView baseVideoView, EventEmitter eventEmitter, boolean useAdRules, com.google.ads.interactivemedia.v3.api.AdsRenderingSettings adsRenderingSettings) Deprecated.Please use theGoogleIMAComponent.Builder
insteadGoogleIMAComponent
(BaseVideoView baseVideoView, EventEmitter eventEmitter, boolean useAdRules, com.google.ads.interactivemedia.v3.api.ImaSdkSettings imaSdkSettings) Deprecated.Please use theGoogleIMAComponent.Builder
insteadGoogleIMAComponent
(BaseVideoView baseVideoView, EventEmitter eventEmitter, boolean useAdRules, com.google.ads.interactivemedia.v3.api.ImaSdkSettings imaSdkSettings, com.google.ads.interactivemedia.v3.api.AdsRenderingSettings adsRenderingSettings) Deprecated.Please use theGoogleIMAComponent.Builder
insteadGoogleIMAComponent
(BaseVideoView baseVideoView, EventEmitter eventEmitter, com.google.ads.interactivemedia.v3.api.ImaSdkSettings imaSdkSettings) Deprecated.Please use theGoogleIMAComponent.Builder
instead -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCallback
(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback callback) com.google.ads.interactivemedia.v3.api.AdDisplayContainer
Returns the currentAdDisplayContainer
, or null if it has not been created yet.int
int
Deprecated.long
com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate
int
List<com.google.ads.interactivemedia.v3.api.AdsRequest>
com.google.ads.interactivemedia.v3.api.ImaSdkSettings
Returns the currentGoogleIMAVideoAdPlayer
, or null if it has not been created yet.void
Deprecated.It's no longer necessary to call this method.boolean
void
onAdError
(com.google.ads.interactivemedia.v3.api.AdErrorEvent event) void
onAdEvent
(com.google.ads.interactivemedia.v3.api.AdEvent event) void
onAdsManagerLoaded
(com.google.ads.interactivemedia.v3.api.AdsManagerLoadedEvent event) void
void
void
Creates a request to reload the Ads.void
removeCallback
(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback callback) void
setAdPosition
(int adPosition) Deprecated.void
setAdPosition
(long adPosition) void
setContentPosition
(int position) Deprecated.void
setContentPosition
(long position) void
setSpringServeMacrosMap
(HashMap<String, Object> springServeMacros) void
void
void
updateAdTargetingValues
(Map<String, String> adTargetingValues) Updates the key/value pairs used for audience segment targeting.void
useAdRules
(boolean useAdRules) Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Field Details
-
ADS_REQUESTS
- See Also:
-
AD_EVENT
- See Also:
-
AD_TAG_URL
- See Also:
-
ADS_MANAGER
- See Also:
-
AD_PLAYHEAD_POSITION
- See Also:
-
AD_WAS_PLAYING
- See Also:
-
imaAnalytics
-
-
Constructor Details
-
GoogleIMAComponent
Deprecated.Please use theGoogleIMAComponent.Builder
instead- Parameters:
baseVideoView
- The Brightcove video view.eventEmitter
- The current event emitter.
-
GoogleIMAComponent
@Deprecated public GoogleIMAComponent(BaseVideoView baseVideoView, EventEmitter eventEmitter, boolean useAdRules, com.google.ads.interactivemedia.v3.api.ImaSdkSettings imaSdkSettings, com.google.ads.interactivemedia.v3.api.AdsRenderingSettings adsRenderingSettings) Deprecated.Please use theGoogleIMAComponent.Builder
instead- Parameters:
baseVideoView
- The Brightcove video view.eventEmitter
- The current event emitter.useAdRules
- Whether to use Ad Rules instead of cue points.imaSdkSettings
- Application specified settings for the IMA SDK.adsRenderingSettings
- AdsRenderingSettings used when initializing AdsManager.
-
GoogleIMAComponent
@Deprecated public GoogleIMAComponent(BaseVideoView baseVideoView, EventEmitter eventEmitter, boolean useAdRules, com.google.ads.interactivemedia.v3.api.ImaSdkSettings imaSdkSettings) Deprecated.Please use theGoogleIMAComponent.Builder
instead- Parameters:
baseVideoView
- The Brightcove video view.eventEmitter
- The current event emitter.useAdRules
- Whether to use Ad Rules instead of cue points.imaSdkSettings
- Application specified settings for the IMA SDK.
-
GoogleIMAComponent
@Deprecated public GoogleIMAComponent(BaseVideoView baseVideoView, EventEmitter eventEmitter, boolean useAdRules, com.google.ads.interactivemedia.v3.api.AdsRenderingSettings adsRenderingSettings) Deprecated.Please use theGoogleIMAComponent.Builder
instead- Parameters:
baseVideoView
- The Brightcove video view.eventEmitter
- The current event emitter.useAdRules
- Whether to use Ad Rules instead of cue points.adsRenderingSettings
- AdsRenderingSettings used when initializing AdsManager.
-
GoogleIMAComponent
@Deprecated public GoogleIMAComponent(BaseVideoView baseVideoView, EventEmitter eventEmitter, boolean useAdRules) Deprecated.Please use theGoogleIMAComponent.Builder
instead- Parameters:
baseVideoView
- The Brightcove video view.eventEmitter
- The current event emitter.useAdRules
- Whether to use Ad Rules instead of cue points.
-
GoogleIMAComponent
@Deprecated public GoogleIMAComponent(BaseVideoView baseVideoView, EventEmitter eventEmitter, com.google.ads.interactivemedia.v3.api.ImaSdkSettings imaSdkSettings) Deprecated.Please use theGoogleIMAComponent.Builder
instead- Parameters:
baseVideoView
- The Brightcove video view.eventEmitter
- The current event emitter.imaSdkSettings
- Application specified settings for the IMA SDK.
-
-
Method Details
-
updateAdTargetingValues
Updates the key/value pairs used for audience segment targeting. These values will be appended to the Ad Tag Url as part of the "cust_param" query parameter. The "cust_param" values will be encoded. For example, if you provide the following map:Map<String, String> audienceSegmentTargetingValues = new HashMap<>(); audienceSegmentTargetingValues.put("section", "sports"); audienceSegmentTargetingValues.put("multi", "baseball,tennis");
"&cust_params=section%3Dsports%26multi%3Dbaseball%2Ctennis"
-
getCurrentAdIndex
public int getCurrentAdIndex() -
getCurrentAdsRequests
-
getVideoAdPlayer
Returns the currentGoogleIMAVideoAdPlayer
, or null if it has not been created yet. -
getAdDisplayContainer
@Nullable public com.google.ads.interactivemedia.v3.api.AdDisplayContainer getAdDisplayContainer()Returns the currentAdDisplayContainer
, or null if it has not been created yet. -
initializeAdsRequests
Deprecated.It's no longer necessary to call this method. The initialization of Ad Rules happens automatically now. -
getAdPosition
public int getAdPosition() -
setAdPosition
Deprecated. -
setAdPosition
public void setAdPosition(long adPosition) -
getContentPosition
Deprecated. -
getContentPositionLong
public long getContentPositionLong() -
setContentPosition
Deprecated. -
setContentPosition
public void setContentPosition(long position) -
skipCurrentAd
public void skipCurrentAd() -
isPlayingAd
public boolean isPlayingAd() -
reloadAdsRequest
public void reloadAdsRequest()Creates a request to reload the Ads.This method will re-initialize the Ads Manager and will emit the GoogleIMAEventType.ADS_MANAGER_LOADED event again.
NOTE: This method works only when the GoogleIMAComponent is NOT using Google Ad Rules.
-
skipCurrentAds
public void skipCurrentAds() -
onAdError
public void onAdError(com.google.ads.interactivemedia.v3.api.AdErrorEvent event) - Specified by:
onAdError
in interfacecom.google.ads.interactivemedia.v3.api.AdErrorEvent.AdErrorListener
-
addCallback
public void addCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback callback) -
removeCallback
public void removeCallback(com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback callback) -
onAdsManagerLoaded
public void onAdsManagerLoaded(com.google.ads.interactivemedia.v3.api.AdsManagerLoadedEvent event) - Specified by:
onAdsManagerLoaded
in interfacecom.google.ads.interactivemedia.v3.api.AdsLoader.AdsLoadedListener
-
setSpringServeMacrosMap
-
onAdEvent
public void onAdEvent(com.google.ads.interactivemedia.v3.api.AdEvent event) - Specified by:
onAdEvent
in interfacecom.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener
-
onContentPauseRequested
public void onContentPauseRequested() -
onContentResumeRequested
public void onContentResumeRequested() -
useAdRules
public void useAdRules(boolean useAdRules) -
getImaSdkSettings
public com.google.ads.interactivemedia.v3.api.ImaSdkSettings getImaSdkSettings() -
getContentProgress
public com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate getContentProgress()- Specified by:
getContentProgress
in interfacecom.google.ads.interactivemedia.v3.api.player.ContentProgressProvider
-
GoogleIMAComponent.Builder
instead