All Implemented Interfaces:
com.yandex.mobile.ads.instream.binder.UnifiedInstreamAdBinder


public class InstreamAdBinder
extends java.lang.Object
implements com.yandex.mobile.ads.instream.binder.UnifiedInstreamAdBinder
InstreamAdBinder allows automatic presenting of instream ads

Constructor Summary

Constructors
Constructor and Description
InstreamAdBinder(android.content.Context context, InstreamAd instreamAd, InstreamAdPlayer instreamAdPlayer, VideoPlayer videoPlayer) 

Method Summary

All Methods
Instance Methods
Concrete Methods
Modifier and TypeMethod and Description
voidbind(InstreamAdView instreamAdView)
Starts instream ad playback
voidinvalidateAdPlayer()
Invalidates ad playback.
voidinvalidateVideoPlayer()
Invalidates video playback.
voidprepareAd()
Prepare preroll (if it exists in ad)
voidsetInstreamAdListener(InstreamAdListener listener)
Register a callback for listening InstreamAdBinder.
voidsetVideoAdPlaybackListener(com.yandex.mobile.ads.video.playback.VideoAdPlaybackListener listener)
Sets listener for single video ad creative playback events.
voidunbind()
Unbinds binder from passed view and pauses ad playback

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

InstreamAdBinder

public InstreamAdBinder(@NonNull
                        android.content.Context context,
                        @NonNull
                        InstreamAd instreamAd,
                        @NonNull
                        InstreamAdPlayer instreamAdPlayer,
                        @NonNull
                        VideoPlayer videoPlayer)

Method Detail

bind

public void bind(@NonNull
                 InstreamAdView instreamAdView)
Starts instream ad playback
Parameters:
instreamAdView - the view in which instream ad breaks will be displayed

invalidateVideoPlayer

public void invalidateVideoPlayer()
Invalidates video playback. Call this method right before video player is invalidated.

invalidateAdPlayer

public void invalidateAdPlayer()
Invalidates ad playback. Call this method right before ad player is invalidated.
Specified by:
invalidateAdPlayer in interface com.yandex.mobile.ads.instream.binder.UnifiedInstreamAdBinder

setInstreamAdListener

public void setInstreamAdListener(@Nullable
                                  InstreamAdListener listener)
Register a callback for listening InstreamAdBinder.
Parameters:
listener - an InstreamAdListener object that handles lifecycle of instream ad.

unbind

public void unbind()
Unbinds binder from passed view and pauses ad playback

prepareAd

public void prepareAd()
Prepare preroll (if it exists in ad)

setVideoAdPlaybackListener

public void setVideoAdPlaybackListener(@Nullable
                                       com.yandex.mobile.ads.video.playback.VideoAdPlaybackListener listener)
Sets listener for single video ad creative playback events.
Parameters:
listener - A VideoAdPlaybackListener that will be triggered on video events.