Class InstreamAdBinder

  • 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 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.