Class AbstractCreative

java.lang.Object
org.prebid.mobile.rendering.models.AbstractCreative
Direct Known Subclasses:
HTMLCreative, VideoCreativeProtocol

public abstract class AbstractCreative extends Object
  • Field Details

  • Constructor Details

  • 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

      public void trackVideoStateChange(InternalPlayerState state)
      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

      public void trackVideoEvent(VideoAdEvent.Event event)
      VideoAdEvent.Event to track
    • isBuiltInVideo

      public boolean isBuiltInVideo()
      Returns:
      if the current ad config suggests that this is a video
    • load

      public abstract void load() throws AdException
      Specific creative load.
      Throws:
      AdException
    • trackAdLoaded

      public abstract void trackAdLoaded()
      Executed after processing transaction and creating OmAdSession in AdViewManager
    • 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 by AdViewManager to 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 by AdViewManager to handle refresh on view visibility change
    • changeVisibilityTrackerState

      public void changeVisibilityTrackerState(boolean adWebViewWindowFocus)
      Changes the creativeVisibilityTracker state based on ad webView window focus. If ad webView has no window focus - creativeVisibilityTracker execution will be stopped. If ad webView has window focus - creativeVisibilityTracker execution will be restarted.
      Parameters:
      adWebViewWindowFocus - adWebView focus state
    • setResolutionListener

      public void setResolutionListener(CreativeResolutionListener resolutionListener)
    • getResolutionListener

      public CreativeResolutionListener getResolutionListener()
    • setCreativeViewListener

      public void setCreativeViewListener(CreativeViewListener creativeViewListener)
    • 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

      public CreativeModel getCreativeModel()
      Returns:
      CreativeModel which can be used to track events or to access specific creative ad configuration.
    • updateAdView

      public void updateAdView(android.view.View view)
    • getCreativeViewListener

      public CreativeViewListener getCreativeViewListener()
    • addOmFriendlyObstruction

      public void addOmFriendlyObstruction(InternalFriendlyObstruction friendlyObstruction)
    • startOmSession

      protected void startOmSession(OmAdSessionManager omAdSessionManager, android.view.View view)