Class VideoCreative
- java.lang.Object
-
- org.prebid.mobile.rendering.models.AbstractCreative
-
- org.prebid.mobile.rendering.video.VideoCreativeProtocol
-
- org.prebid.mobile.rendering.video.VideoCreative
-
- All Implemented Interfaces:
InterstitialManagerVideoDelegate,VideoCreativeViewListener,VASTInterface
- Direct Known Subclasses:
RewardedVideoCreative
public class VideoCreative extends VideoCreativeProtocol implements VideoCreativeViewListener, InterstitialManagerVideoDelegate
-
-
Field Summary
-
Fields inherited from class org.prebid.mobile.rendering.models.AbstractCreative
contextReference, creativeVisibilityTracker, interstitialManager, weakOmAdSessionManager
-
-
Constructor Summary
Constructors Constructor Description VideoCreative(android.content.Context context, VideoCreativeModel model, OmAdSessionManager omAdSessionManager, InterstitialManager interstitialManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcomplete()voidcreateOmAdSession()Create OM session for specific creative.voiddestroy()Specific creative cleanup.voiddisplay()Specific creative display.VideoCreativeModelgetCreativeModel()longgetMediaDuration()longgetVideoSkipOffset()voidhandleAdWindowFocus()Executed when window gains focus (e.g. when app is resumed from background) Used byAdViewManagerto handle refresh on view visibility changevoidhandleAdWindowNoFocus()Executed when window loses focus (e.g. when app is going in background).booleanisDisplay()booleanisEndCard()booleanisInterstitialClosed()booleanisPlaying()booleanisResolved()booleanisVideo()voidload()Specific creative load.voidmute()Mute creativevoidonDisplayCompleted()voidonEvent(VideoAdEvent.Event trackingEvent)voidonFailure(AdException error)voidonPlayerStateChanged(InternalPlayerState state)voidonReadyForDisplay()voidonVideoInterstitialClosed()voidonVolumeChanged(float volume)voidpause()Pause creative executionvoidresume()Resume creative executionprotected voidshowCallToAction()voidskip()the user activated a skip control to skip the creative, which is a different control than the one used to close the creative.voidstartViewabilityTracker()voidtrackAdLoaded()Executed after processing transaction and creating OmAdSession inAdViewManagervoidtrackVideoEvent(VideoAdEvent.Event event)VideoAdEvent.Event to trackvoidunmute()UnMute creative-
Methods inherited from class org.prebid.mobile.rendering.video.VideoCreativeProtocol
close, closeLinear, collapse, exitFullScreen, expand, fullScreen, onWindowFocusChanged, orientationChanged, rewind, touch
-
Methods inherited from class org.prebid.mobile.rendering.models.AbstractCreative
addOmFriendlyObstruction, changeVisibilityTrackerState, getCreativeView, getCreativeViewListener, getResolutionListener, isBuiltInVideo, setCreativeView, setCreativeViewListener, setResolutionListener, startOmSession, trackVideoStateChange, updateAdView
-
-
-
-
Constructor Detail
-
VideoCreative
public VideoCreative(android.content.Context context, VideoCreativeModel model, OmAdSessionManager omAdSessionManager, InterstitialManager interstitialManager) throws AdException- Throws:
AdException
-
-
Method Detail
-
load
public void load()
Description copied from class:AbstractCreativeSpecific creative load.- Specified by:
loadin classAbstractCreative
-
display
public void display()
Description copied from class:AbstractCreativeSpecific creative display.- Overrides:
displayin classVideoCreativeProtocol
-
skip
public void skip()
Description copied from interface:VASTInterfacethe user activated a skip control to skip the creative, which is a different control than the one used to close the creative.- Specified by:
skipin interfaceVASTInterface- Overrides:
skipin classVideoCreativeProtocol
-
onReadyForDisplay
public void onReadyForDisplay()
- Specified by:
onReadyForDisplayin interfaceVideoCreativeViewListener
-
onDisplayCompleted
public void onDisplayCompleted()
- Specified by:
onDisplayCompletedin interfaceVideoCreativeViewListener
-
onFailure
public void onFailure(AdException error)
- Specified by:
onFailurein interfaceVideoCreativeViewListener
-
onEvent
public void onEvent(VideoAdEvent.Event trackingEvent)
- Specified by:
onEventin interfaceVideoCreativeViewListener
-
trackAdLoaded
public void trackAdLoaded()
Description copied from class:AbstractCreativeExecuted after processing transaction and creating OmAdSession inAdViewManager- Specified by:
trackAdLoadedin classAbstractCreative
-
onVolumeChanged
public void onVolumeChanged(float volume)
- Specified by:
onVolumeChangedin interfaceVideoCreativeViewListener
-
onPlayerStateChanged
public void onPlayerStateChanged(InternalPlayerState state)
- Specified by:
onPlayerStateChangedin interfaceVideoCreativeViewListener
-
isInterstitialClosed
public boolean isInterstitialClosed()
- Overrides:
isInterstitialClosedin classAbstractCreative- Returns:
- if current creative is serving as interstitial that was closed
-
getMediaDuration
public long getMediaDuration()
- Overrides:
getMediaDurationin classAbstractCreative- Returns:
- media duration in ms
-
handleAdWindowFocus
public void handleAdWindowFocus()
Description copied from class:AbstractCreativeExecuted when window gains focus (e.g. when app is resumed from background) Used byAdViewManagerto handle refresh on view visibility change- Specified by:
handleAdWindowFocusin classAbstractCreative
-
resume
public void resume()
Description copied from class:AbstractCreativeResume creative execution- Specified by:
resumein interfaceVASTInterface- Overrides:
resumein classVideoCreativeProtocol
-
isPlaying
public boolean isPlaying()
- Overrides:
isPlayingin classAbstractCreative- Returns:
- Whether the creative is playing
-
handleAdWindowNoFocus
public void handleAdWindowNoFocus()
Description copied from class:AbstractCreativeExecuted when window loses focus (e.g. when app is going in background). Used byAdViewManagerto handle refresh on view visibility change- Specified by:
handleAdWindowNoFocusin classAbstractCreative
-
pause
public void pause()
Description copied from class:AbstractCreativePause creative execution- Specified by:
pausein interfaceVASTInterface- Overrides:
pausein classVideoCreativeProtocol
-
mute
public void mute()
Description copied from class:AbstractCreativeMute creative- Specified by:
mutein interfaceVASTInterface- Overrides:
mutein classVideoCreativeProtocol
-
unmute
public void unmute()
Description copied from class:AbstractCreativeUnMute creative- Specified by:
unmutein interfaceVASTInterface- Overrides:
unmutein classVideoCreativeProtocol
-
createOmAdSession
public void createOmAdSession()
Description copied from class:AbstractCreativeCreate OM session for specific creative. Each creative must create appropriate OM AdSession (e.g. for HTML and Native)- Specified by:
createOmAdSessionin classAbstractCreative
-
startViewabilityTracker
public void startViewabilityTracker()
- Specified by:
startViewabilityTrackerin classAbstractCreative
-
destroy
public void destroy()
Description copied from class:AbstractCreativeSpecific creative cleanup. Creative must cleanup it's internal state.- Overrides:
destroyin classAbstractCreative
-
isDisplay
public boolean isDisplay()
- Specified by:
isDisplayin classAbstractCreative
-
isVideo
public boolean isVideo()
- Specified by:
isVideoin classAbstractCreative
-
isResolved
public boolean isResolved()
- Specified by:
isResolvedin classAbstractCreative- Returns:
- true if
preloadedVideoFilePathis not empty and file exists in filesDir, false otherwise.
-
isEndCard
public boolean isEndCard()
- Specified by:
isEndCardin classAbstractCreative
-
onVideoInterstitialClosed
public void onVideoInterstitialClosed()
- Specified by:
onVideoInterstitialClosedin interfaceInterstitialManagerVideoDelegate
-
getVideoSkipOffset
public long getVideoSkipOffset()
- Overrides:
getVideoSkipOffsetin classAbstractCreative- Returns:
- video skip offset in ms
-
trackVideoEvent
public void trackVideoEvent(VideoAdEvent.Event event)
Description copied from class:AbstractCreativeVideoAdEvent.Event to track- Overrides:
trackVideoEventin classAbstractCreative
-
getCreativeModel
public VideoCreativeModel getCreativeModel()
- Overrides:
getCreativeModelin classAbstractCreative- Returns:
CreativeModelwhich can be used to track events or to access specific creative ad configuration.
-
complete
protected void complete()
-
showCallToAction
protected void showCallToAction()
-
-