Class InstreamResearch
-
- All Implemented Interfaces:
public class InstreamResearch extends BaseAd
Component for tracking video playback and visibility.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceInstreamResearch.InstreamResearchListener
-
Method Summary
Modifier and Type Method Description voidload()Method responsible for loading data. static InstreamResearchnewResearch(int slotId, int duration, @NonNull() Context context)The static constructor of the object. voidregisterPlayerView(@NonNull() View v)Method for registering the View in which the creative will be displayed. voidsetListener(@Nullable() 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. -
-
Method Detail
-
load
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 InstreamResearchListener). Listener must be added before loading
-
newResearch
@NonNull() static InstreamResearch newResearch(int slotId, int duration, @NonNull() Context context)
The static constructor of the object.
- Parameters:
slotId- slot numberduration- creative length in seconds.context- application context- Returns:
InstreamResearch object
-
registerPlayerView
void registerPlayerView(@NonNull() 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
-
setListener
void setListener(@Nullable() InstreamResearch.InstreamResearchListener listener)
Method for setting the listener. May be null. Must be called before InstreamResearch.load()
- Parameters:
listener- listener for research
-
trackFullscreen
void trackFullscreen(boolean fullscreen)
Method for tracking full screen mode on / off.
- Parameters:
fullscreen- flag to enable / disable fullscreen mode
-
trackMute
void trackMute(boolean mute)
A method for tracking sound on / off.
- Parameters:
mute- enable / disable sound flag
-
trackPause
void trackPause()
Method for pause tracking. If the trackProgress method has never been called before, statistics will not be sent
-
trackProgress
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
-
trackResume
void trackResume()
Method for tracking unpause. If the video is not paused, nothing will be sent
-
unregisterPlayerView
void unregisterPlayerView()
Method for deregistering View, clears references to View.
-
-
-
-