Class YandexAdsLoader
-
- All Implemented Interfaces:
@MainThread()@Deprecated(message = "This AdsLoader version is deprecated, use YandexAdsLoader from com.yandex.mobile.ads.instream.media3 package", replaceWith = @ReplaceWith(imports = {"com.yandex.mobile.ads.instream.media3.YandexMedia3AdsLoader"}, expression = "YandexMedia3AdsLoader"), level = DeprecationLevel.WARNING) public final class YandexAdsLoader
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 StringAD_TAG_URI
-
Constructor Summary
Constructors Constructor Description YandexAdsLoader(Context context, InstreamAdRequestConfiguration requestConfiguration)
-
Method Summary
Modifier and Type Method Description final UnitrequestAds(ViewGroup adViewGroup)Requests ads, if they have not already been requested. final UnitsetVideoAdPlaybackListener(VideoAdPlaybackListener listener)Sets listener for single video ad creative playback events. UnitsetPlayer(Player player)Unitrelease()UnitsetSupportedContentTypes(Integer contentTypes)Unitstart(AdsMediaSource adsMediaSource, DataSpec adTagDataSpec, Object adPlaybackId, AdViewProvider adViewProvider, AdsLoader.EventListener eventListener)Unitstop(AdsMediaSource adsMediaSource, AdsLoader.EventListener eventListener)UnithandlePrepareComplete(AdsMediaSource adsMediaSource, Integer adGroupIndex, Integer adIndexInAdGroup)UnithandlePrepareError(AdsMediaSource adsMediaSource, Integer adGroupIndex, Integer adIndexInAdGroup, IOException exception)<Error class: unknown class>getInstreamAdsLoaderManager()-
-
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)
-
getInstreamAdsLoaderManager
<Error class: unknown class> getInstreamAdsLoaderManager()
-
-
-
-