Package 

Class YandexAdsLoader

  • All Implemented Interfaces:
    com.google.android.exoplayer2.source.ads.AdsLoader

    @MainThread() 
    public class YandexAdsLoader
     implements AdsLoader
                        

    This class is implementation of ExoPlayer's AdsLoader interface. It can be used for simplified integration of Yandex Instream Ads to Exoplayer. Note that all methods of this class must be called on main thread.

    • Method Detail

      • requestAds

         void requestAds(@Nullable() ViewGroup adViewGroup)

        Requests ads, if they have not already been requested. Ads will be requested automatically when the player is prepared if this method has not been called, so it is only necessary to call this method if you want to request ads before preparing the player.

        Parameters:
        adViewGroup - A ViewGroup on top of the player that will show any ad UI.
      • setVideoAdPlaybackListener

         void setVideoAdPlaybackListener(@Nullable() VideoAdPlaybackListener listener)

        Sets listener for single video ad creative playback events.

        Parameters:
        listener - A VideoAdPlaybackListener that will be triggered on video events.
      • stop

         void stop(@Nullable() AdsMediaSource adsMediaSource, @Nullable() AdsLoader.EventListener eventListener)