Package com.my.target.instreamads
Interface InstreamAdPlayer
public interface InstreamAdPlayer
This interface must be implemented in advertisement videoplayer.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCalls from this listener must be implemented in videoplayer for calculating video ad statistics -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Shutdown all connections and release all resourcesfloatRetrieving duration of current playing advertising videofloatRetrieving play time left of current playing advertising videoandroid.view.ViewgetView()voidCall player to pause current playing advoidplayAdVideo(android.net.Uri uri, int width, int height) Call player to play videofile or stream with predefined dimensionsvoidplayAdVideo(android.net.Uri uri, int width, int height, float position) Call player to play videofile or stream with predefined dimensionsvoidCall player to resume current playing advoidSets listener for ad playing eventsvoidsetVolume(float volume) Setting the volumevoidCall player to stop current video ad.
-
Method Details
-
getAdPlayerListener
-
setAdPlayerListener
Sets listener for ad playing events- Parameters:
listener- listener should be set
-
getAdVideoDuration
float getAdVideoDuration()Retrieving duration of current playing advertising video -
getAdVideoPosition
float getAdVideoPosition()Retrieving play time left of current playing advertising video -
getView
@NonNull android.view.View getView()- Returns:
- view, that hosts the player
-
playAdVideo
void playAdVideo(@NonNull android.net.Uri uri, int width, int height) Call player to play videofile or stream with predefined dimensions- Parameters:
uri- URI of video of streamwidth- width of video in pixelsheight- height of video in pixels
-
playAdVideo
void playAdVideo(@NonNull android.net.Uri uri, int width, int height, float position) Call player to play videofile or stream with predefined dimensions- Parameters:
uri- URI of video of streamwidth- width of video in pixelsheight- height of video in pixelsposition- position of video. Used after swap
-
pauseAdVideo
void pauseAdVideo()Call player to pause current playing ad -
resumeAdVideo
void resumeAdVideo()Call player to resume current playing ad -
stopAdVideo
void stopAdVideo()Call player to stop current video ad. This call means we don't plan start same video ad in this player -
destroy
void destroy()Shutdown all connections and release all resources -
setVolume
void setVolume(float volume) Setting the volume- Parameters:
volume- volume
-