Interface InstreamAdPlayer
-
public interface InstreamAdPlayer
This interface is used for playing instream ad
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getAdDuration(VideoAd videoAd)
Gets ad video durationlong
getAdPosition(VideoAd videoAd)
Gets current ad video positionfloat
getVolume(VideoAd videoAd)
Gets player volume level in range [0.0, 1.0]boolean
isPlayingAd(VideoAd videoAd)
Gets value indicating whether player is playing advoid
pauseAd(VideoAd videoAd)
Pauses playing advoid
playAd(VideoAd videoAd)
Starts playing advoid
prepareAd(VideoAd videoAd)
Prepares player for playing video ad.void
releaseAd(VideoAd videoAd)
Releases ad player objectvoid
resumeAd(VideoAd videoAd)
Resumes playing advoid
setInstreamAdPlayerListener(InstreamAdPlayerListener instreamAdPlayerListener)
Sets listener for ad player events.void
setVolume(VideoAd videoAd, float volume)
Sets ad player volume, with 0 being silence and 1 being maximum volume levelvoid
skipAd(VideoAd videoAd)
Skips playing advoid
stopAd(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 toInstreamAdPlayerListener
volume
- 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
-
-