Interface InstreamAdPlayer
-
public interface InstreamAdPlayerThis interface is used for playing instream ad
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetAdDuration(VideoAd videoAd)Gets ad video durationlonggetAdPosition(VideoAd videoAd)Gets current ad video positionfloatgetVolume(VideoAd videoAd)Gets player volume level in range [0.0, 1.0]booleanisPlayingAd(VideoAd videoAd)Gets value indicating whether player is playing advoidpauseAd(VideoAd videoAd)Pauses playing advoidplayAd(VideoAd videoAd)Starts playing advoidprepareAd(VideoAd videoAd)Prepares player for playing video ad.voidreleaseAd(VideoAd videoAd)Releases ad player objectvoidresumeAd(VideoAd videoAd)Resumes playing advoidsetInstreamAdPlayerListener(InstreamAdPlayerListener instreamAdPlayerListener)Sets listener for ad player events.voidsetVolume(VideoAd videoAd, float volume)Sets ad player volume, with 0 being silence and 1 being maximum volume levelvoidskipAd(VideoAd videoAd)Skips playing advoidstopAd(VideoAd videoAd)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 toInstreamAdPlayerListener
-
playAd
void playAd(@NonNull VideoAd videoAd)Starts playing ad- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener
-
pauseAd
void pauseAd(@NonNull VideoAd videoAd)Pauses playing ad- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener
-
resumeAd
void resumeAd(@NonNull VideoAd videoAd)Resumes playing ad- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener
-
stopAd
void stopAd(@NonNull VideoAd videoAd)Stops playing ad- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener
-
skipAd
void skipAd(@NonNull VideoAd videoAd)Skips playing ad- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener
-
setVolume
void setVolume(@NonNull VideoAd videoAd, float volume)Sets ad player volume, with 0 being silence and 1 being maximum volume level- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListenervolume- volume level in range [0.0, 1.0]
-
getVolume
float getVolume(@NonNull VideoAd videoAd)Gets player volume level in range [0.0, 1.0]- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener- Returns:
- player volume level in range [0.0, 1.0]
-
releaseAd
void releaseAd(@NonNull VideoAd videoAd)Releases ad player object- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener
-
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(@NonNull VideoAd videoAd)Gets ad video duration- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener- Returns:
- ad video position in millis
-
getAdPosition
long getAdPosition(@NonNull VideoAd videoAd)Gets current ad video position- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener- Returns:
- current ad video duration in millis
-
isPlayingAd
boolean isPlayingAd(@NonNull VideoAd videoAd)Gets value indicating whether player is playing ad- Parameters:
videoAd- object providing information about the advertising video file to be played. videoAd should be passed back in all callbacks toInstreamAdPlayerListener- Returns:
- value indicating whether player is playing ad
-
-