public interface InstreamAdPlayer
This interface is used for playing instream ad

Method Summary

All Methods
Instance Methods
Abstract Methods
Modifier and TypeMethod and Description
longgetAdDuration()
Gets ad video duration
longgetAdPosition()
Gets current ad video position
booleanisPlayingAd()
Gets value indicating whether player is playing ad
voidpauseAd()
Pauses playing ad
voidplayAd()
Starts playing ad
voidprepareAd(VideoAd videoAd)
Prepares player for playing video ad.
voidrelease()
Releases ad player object
voidresumeAd()
Resumes playing ad
voidsetInstreamAdPlayerListener(InstreamAdPlayerListener instreamAdPlayerListener)
Sets listener for ad player events.
voidsetVolume(float volume)
Sets ad player volume, with 0 being silence and 1 being maximum volume level
voidskipAd()
Skips playing ad
voidstopAd()
Stops playing ad

Method Detail

prepareAd

void prepareAd(@NonNull
               VideoAd videoAd)
Prepares player for playing video ad. Implement only this method for prepare Ad.
Parameters:
videoAd - object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks to InstreamAdPlayerListener

playAd

void playAd()
Starts playing ad

pauseAd

void pauseAd()
Pauses playing ad

resumeAd

void resumeAd()
Resumes playing ad

stopAd

void stopAd()
Stops playing ad

skipAd

void skipAd()
Skips playing ad

setVolume

void setVolume(float volume)
Sets ad player volume, with 0 being silence and 1 being maximum volume level
Parameters:
volume - volume level in range [0.0, 1.0]

release

void release()
Releases ad player object

setInstreamAdPlayerListener

void setInstreamAdPlayerListener(@Nullable
                                 InstreamAdPlayerListener instreamAdPlayerListener)
Sets listener for ad player events. For each event of the instream ad player, the corresponding callback must be called on this object.
Parameters:
instreamAdPlayerListener - Listener for ad player events

getAdDuration

long getAdDuration()
Gets ad video duration
Returns:
ad video position in millis

getAdPosition

long getAdPosition()
Gets current ad video position
Returns:
current ad video duration in millis

isPlayingAd

boolean isPlayingAd()
Gets value indicating whether player is playing ad
Returns:
value indicating whether player is playing ad