Class AbstractCreative
java.lang.Object
org.prebid.mobile.rendering.models.AbstractCreative
- Direct Known Subclasses:
HTMLCreative,VideoCreativeProtocol
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WeakReference<android.content.Context> protected CreativeVisibilityTrackerprotected InterstitialManagerprotected WeakReference<OmAdSessionManager> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCreative(android.content.Context context, CreativeModel model, OmAdSessionManager omAdSessionManager, InterstitialManager interstitialManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOmFriendlyObstruction(InternalFriendlyObstruction friendlyObstruction) voidchangeVisibilityTrackerState(boolean adWebViewWindowFocus) Changes thecreativeVisibilityTrackerstate based on ad webView window focus.abstract voidCreate OM session for specific creative.voiddestroy()Specific creative cleanup.abstract voiddisplay()Specific creative display.android.view.Viewlonglongabstract voidExecuted when window gains focus (e.g.abstract voidExecuted when window loses focus (e.g.booleanabstract booleanabstract booleanbooleanbooleanabstract booleanabstract booleanisVideo()abstract voidload()Specific creative load.voidmute()Mute creativevoidpause()Pause creative executionvoidresume()Resume creative executionvoidsetCreativeView(android.view.View creativeView) Sets currently used creative view for specific creative.voidsetCreativeViewListener(CreativeViewListener creativeViewListener) voidsetResolutionListener(CreativeResolutionListener resolutionListener) protected voidstartOmSession(OmAdSessionManager omAdSessionManager, android.view.View view) abstract voidabstract voidExecuted after processing transaction and creating OmAdSession inAdViewManagervoidVideoAdEvent.Event to trackvoidTrack video state change to OmEventTrackervoidunmute()UnMute creativevoidupdateAdView(android.view.View view)
-
Field Details
-
contextReference
-
weakOmAdSessionManager
-
interstitialManager
-
creativeVisibilityTracker
-
-
Constructor Details
-
AbstractCreative
public AbstractCreative(android.content.Context context, CreativeModel model, OmAdSessionManager omAdSessionManager, InterstitialManager interstitialManager) throws AdException - Throws:
AdException
-
-
Method Details
-
isDisplay
public abstract boolean isDisplay() -
isVideo
public abstract boolean isVideo() -
isResolved
public abstract boolean isResolved() -
isEndCard
public abstract boolean isEndCard() -
pause
public void pause()Pause creative execution -
resume
public void resume()Resume creative execution -
unmute
public void unmute()UnMute creative -
mute
public void mute()Mute creative -
isPlaying
public boolean isPlaying()- Returns:
- Whether the creative is playing
-
trackVideoStateChange
Track video state change to OmEventTracker- Parameters:
state- to track
-
isInterstitialClosed
public boolean isInterstitialClosed()- Returns:
- if current creative is serving as interstitial that was closed
-
getMediaDuration
public long getMediaDuration()- Returns:
- media duration in ms
-
getVideoSkipOffset
public long getVideoSkipOffset()- Returns:
- video skip offset in ms
-
trackVideoEvent
VideoAdEvent.Event to track -
isBuiltInVideo
public boolean isBuiltInVideo()- Returns:
- if the current ad config suggests that this is a video
-
load
Specific creative load.- Throws:
AdException
-
trackAdLoaded
public abstract void trackAdLoaded()Executed after processing transaction and creating OmAdSession inAdViewManager -
display
public abstract void display()Specific creative display. -
createOmAdSession
public abstract void createOmAdSession()Create OM session for specific creative. Each creative must create appropriate OM AdSession (e.g. for HTML and Native) -
startViewabilityTracker
public abstract void startViewabilityTracker() -
destroy
public void destroy()Specific creative cleanup. Creative must cleanup it's internal state. -
handleAdWindowFocus
public abstract void handleAdWindowFocus()Executed when window gains focus (e.g. when app is resumed from background) Used byAdViewManagerto handle refresh on view visibility change -
handleAdWindowNoFocus
public abstract void handleAdWindowNoFocus()Executed when window loses focus (e.g. when app is going in background). Used byAdViewManagerto handle refresh on view visibility change -
changeVisibilityTrackerState
public void changeVisibilityTrackerState(boolean adWebViewWindowFocus) Changes thecreativeVisibilityTrackerstate based on ad webView window focus. If ad webView has no window focus -creativeVisibilityTrackerexecution will be stopped. If ad webView has window focus -creativeVisibilityTrackerexecution will be restarted.- Parameters:
adWebViewWindowFocus- adWebView focus state
-
setResolutionListener
-
getResolutionListener
-
setCreativeViewListener
-
setCreativeView
public void setCreativeView(android.view.View creativeView) Sets currently used creative view for specific creative.- Parameters:
creativeView- individual creative view. E.g. webView for HTMLCreative.
-
getCreativeView
public android.view.View getCreativeView()- Returns:
- individual creative view. E.g. webView for HTMLCreative.
-
getCreativeModel
- Returns:
CreativeModelwhich can be used to track events or to access specific creative ad configuration.
-
updateAdView
public void updateAdView(android.view.View view) -
getCreativeViewListener
-
addOmFriendlyObstruction
-
startOmSession
-