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
ConstructorsConstructorDescriptionVideoCreative(android.content.Context context, VideoCreativeModel model, OmAdSessionManager omAdSessionManager, InterstitialManager interstitialManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcomplete()voidCreate OM session for specific creative.voiddestroy()Specific creative cleanup.voiddisplay()Specific creative display.longlongvoidExecuted when window gains focus (e.g.voidExecuted when window loses focus (e.g.booleanbooleanbooleanbooleanbooleanbooleanisVideo()voidload()Specific creative load.voidmute()Mute creativevoidvoidonEvent(VideoAdEvent.Event trackingEvent) voidonFailure(AdException error) voidvoidvoidvoidonVolumeChanged(float volume) voidpause()Pause creative executionvoidresume()Resume creative executionprotected voidvoidskip()the user activated a skip control to skip the creative, which is a different control than the one used to close the creative.voidvoidExecuted after processing transaction and creating OmAdSession inAdViewManagervoidVideoAdEvent.Event to trackvoidunmute()UnMute creativeMethods inherited from class org.prebid.mobile.rendering.video.VideoCreativeProtocol
close, closeLinear, collapse, exitFullScreen, expand, fullScreen, onWindowFocusChanged, orientationChanged, rewind, touchMethods inherited from class org.prebid.mobile.rendering.models.AbstractCreative
addOmFriendlyObstruction, changeVisibilityTrackerState, getCreativeView, getCreativeViewListener, getResolutionListener, isBuiltInVideo, setCreativeView, setCreativeViewListener, setResolutionListener, startOmSession, trackVideoStateChange, updateAdView
-
Constructor Details
-
VideoCreative
public VideoCreative(android.content.Context context, VideoCreativeModel model, OmAdSessionManager omAdSessionManager, InterstitialManager interstitialManager) throws AdException - Throws:
AdException
-
-
Method Details
-
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
- Specified by:
onFailurein interfaceVideoCreativeViewListener
-
onEvent
- 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
- 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
Description copied from class:AbstractCreativeVideoAdEvent.Event to track- Overrides:
trackVideoEventin classAbstractCreative
-
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()
-