com.yandex.mobile.ads.instream.player.ad
Interface InstreamAdPlayer
public interface InstreamAdPlayer
This interface is used for playing instream ad
Method Summary
Modifier and Type | Method and Description |
---|---|
long | getAdDuration()
Gets ad video duration
|
long | getAdPosition()
Gets current ad video position
|
boolean | isPlayingAd()
Gets value indicating whether player is playing ad
|
void | pauseAd()
Pauses playing ad
|
void | playAd()
Starts playing ad
|
void | prepareAd(VideoAd videoAd)
Prepares player for playing video ad.
|
void | release()
Releases ad player object
|
void | resumeAd()
Resumes playing ad
|
void | setInstreamAdPlayerListener(InstreamAdPlayerListener instreamAdPlayerListener)
Sets listener for ad player events.
|
void | setVolume(float volume)
Sets ad player volume, with 0 being silence and 1 being maximum volume level
|
void | skipAd()
Skips playing ad
|
void | stopAd()
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()
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