Class YandexAdsLoader
-
- All Implemented Interfaces:
-
com.google.android.exoplayer2.source.ads.AdsLoader
@MainThread()@Deprecated(message = "This AdsLoader version is deprecated, use YandexMedia3AdsLoader", replaceWith = @ReplaceWith(imports = {"com.yandex.mobile.ads.instream.media3.YandexMedia3AdsLoader"}, expression = "YandexMedia3AdsLoader"), level = DeprecationLevel.WARNING) public final class YandexAdsLoader extends PrivateYandexAdsLoader
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.
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
AD_TAG_URI
-
Constructor Summary
Constructors Constructor Description YandexAdsLoader(Context context, InstreamAdRequestConfiguration requestConfiguration)
-
Method Summary
Modifier and Type Method Description final Unit
requestAds(ViewGroup adViewGroup)
Requests ads, if they have not already been requested. final Unit
setVideoAdPlaybackListener(VideoAdPlaybackListener listener)
Sets listener for single video ad creative playback events. Unit
setPlayer(Player player)
Unit
release()
Unit
setSupportedContentTypes(Integer contentTypes)
Unit
start(AdsMediaSource adsMediaSource, DataSpec adTagDataSpec, Object adPlaybackId, AdViewProvider adViewProvider, AdsLoader.EventListener eventListener)
Unit
stop(AdsMediaSource adsMediaSource, AdsLoader.EventListener eventListener)
Unit
handlePrepareComplete(AdsMediaSource adsMediaSource, Integer adGroupIndex, Integer adIndexInAdGroup)
Unit
handlePrepareError(AdsMediaSource adsMediaSource, Integer adGroupIndex, Integer adIndexInAdGroup, IOException exception)
-
-
Constructor Detail
-
YandexAdsLoader
YandexAdsLoader(Context context, InstreamAdRequestConfiguration requestConfiguration)
-
-
Method Detail
-
requestAds
final Unit requestAds(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
final Unit setVideoAdPlaybackListener(VideoAdPlaybackListener listener)
Sets listener for single video ad creative playback events.
- Parameters:
listener
- A VideoAdPlaybackListener that will be triggered on video events.
-
setSupportedContentTypes
Unit setSupportedContentTypes(Integer contentTypes)
-
start
Unit start(AdsMediaSource adsMediaSource, DataSpec adTagDataSpec, Object adPlaybackId, AdViewProvider adViewProvider, AdsLoader.EventListener eventListener)
-
handlePrepareComplete
Unit handlePrepareComplete(AdsMediaSource adsMediaSource, Integer adGroupIndex, Integer adIndexInAdGroup)
-
handlePrepareError
Unit handlePrepareError(AdsMediaSource adsMediaSource, Integer adGroupIndex, Integer adIndexInAdGroup, IOException exception)
-
-
-
-