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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceInstreamResearch.InstreamResearchListener
-
Field Summary
-
Fields inherited from class com.my.target.common.BaseAd
adConfig, metricFactory
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidload()Method responsible for loading data.static InstreamResearchnewResearch(int slotId, int duration, android.content.Context context)The static constructor of the object.voidregisterPlayerView(android.view.View v)Method for registering the View in which the creative will be displayed.voidsetListener(InstreamResearch.InstreamResearchListener listener)Method for setting the listener.voidtrackFullscreen(boolean fullscreen)Method for tracking full screen mode on / off.voidtrackMute(boolean mute)A method for tracking sound on / off.voidtrackPause()Method for pause tracking.voidtrackProgress(float progress)Method for tracking video progress.voidtrackResume()Method for tracking unpause.voidunregisterPlayerView()Method for deregistering View, clears references to View.-
Methods inherited from class com.my.target.common.BaseAd
getCustomParams, isLoadCalled, setAdNetworkConfig
-
-
-
-
Method Detail
-
newResearch
@NonNull public static InstreamResearch newResearch(int slotId, int duration, @NonNull android.content.Context context)
The static constructor of the object.- Parameters:
slotId- slot numberduration- 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 (seeInstreamResearch.InstreamResearchListener). Listener must be added before loading- See Also:
setListener(InstreamResearchListener)
-
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 beforeload()- Parameters:
listener- listener for research
-
-