Package com.my.target

Class InstreamResearch

java.lang.Object
com.my.target.common.BaseAd
com.my.target.InstreamResearch

public class InstreamResearch extends BaseAd
Component for tracking video playback and visibility.
  • Method Details

    • newResearch

      @NonNull public static InstreamResearch newResearch(int slotId, int duration, @NonNull android.content.Context context)
      The static constructor of the object.
      Parameters:
      slotId - slot number
      duration - creative length in seconds. If the length is unknown (for example, streaming content), a value of 0 is acceptable.
      context - application context
      Returns:
      InstreamResearch object
    • load

      public void load()
      Method responsible for loading data. In case of successful loading, the onLoad method will be called on the object passed as a listener, in case of loading error or lack of data - the onNoData method (see InstreamResearch.InstreamResearchListener). Listener must be added before loading
      See Also:
    • registerPlayerView

      public void registerPlayerView(@NonNull android.view.View v)
      Method for registering the View in which the creative will be displayed. Visibility statistics will be calculated based on the data for this View.
      Parameters:
      v - view of the creative
    • unregisterPlayerView

      public void unregisterPlayerView()
      Method for deregistering View, clears references to View.
    • trackPause

      public void trackPause()
      Method for pause tracking. If the trackProgress method has never been called before, statistics will not be sent
    • trackResume

      public void trackResume()
      Method for tracking unpause. If the video is not paused, nothing will be sent
    • trackProgress

      public void trackProgress(float progress)
      Method for tracking video progress. If progress is less than the previous value, then rewind statistics will be sent, tracking MRC statistics will be reset. If two consecutive progress values differ by more than a second, MRC tracking will also be reset.
      Parameters:
      progress - progress in seconds with fractional part
    • trackMute

      public void trackMute(boolean mute)
      A method for tracking sound on / off.
      Parameters:
      mute - enable / disable sound flag
    • trackFullscreen

      public void trackFullscreen(boolean fullscreen)
      Method for tracking full screen mode on / off.
      Parameters:
      fullscreen - flag to enable / disable fullscreen mode
    • setListener

      public void setListener(@Nullable InstreamResearch.InstreamResearchListener listener)
      Method for setting the listener. May be null. Must be called before load()
      Parameters:
      listener - listener for research