-
Notifications
You must be signed in to change notification settings - Fork 6
Video Ad Integration
For the AdInline
to load video ads, you need to integrate the ad view as described in Integrating Inline Ad.
Java:
adView = (AdInline) findViewById(R.id.custom_ad_view);
adView.setMasterTagId(12345);
Kotlin:
adView = findViewById(R.id.custom_ad_view)
adView.masterTagId = 12345
Now the view is ready to load video banners. Just execute loadAd();
and banner will be loaded.
Java:
adView.loadAd();
Kotlin:
adView.loadAd()
It is no longer to required to set banner type for video ads, method setBannerType(bannerType)
is deprecated. Whole video ad set up can be found in SampleDemo app with its custom configuration settings.
Video ad has custom properties that defines some of the video view behavior.
To test how the video banner handles VAST type of content, you can enable debug mode, and provide the configuration directly to be rendered by the view. All you need to do is to set debug mode setDebugMode([true/false])
, and pass in debug content setDebugContent([VAST configuration content as String])
.
Java:
adView.setDebugMode(true);
adView.setDebugContent(Utils.isToString(getResources().openRawResource(R.raw.vast)));
Kotlin:
adView.debugMode = true
adView.debugContent = Utils.isToString(getResources().openRawResource(R.raw.vast))
For more information, try looking at SampleDemo.
By default, when video is loaded and started, video is muted. To edit this behavior you can use setVideoMuteOnInit([true/false])
.
Java:
adInline.setVideoMuteOnInit(true);
Kotlin:
adInline.videoMuteOnInit = true
By default, video banner will close after its finished playing content. To edit this behavior you can use setVideoCloseOnComplete(true/false)
.
Java:
adInline.setVideoCloseOnComplete(true);
Kotlin:
adInline.videoCloseOnComplete = true
By default, close button is always hidden when video ad is displayed. This property can be changed by defining property type in setVideoCloseButtonShowBehavior(VideoSettings.CloseButtonShowBehavior.[ALWAYS/AFTER_COMPLETE/HIDE])
.
Java:
adInline.setVideoCloseButtonShowBehavior(VideoSettings.CloseButtonShowBehavior.ALWAYS);
adInline.setVideoCloseButtonShowBehavior(VideoSettings.CloseButtonShowBehavior.AFTER_COMPLETE);
adInline.setVideoCloseButtonShowBehavior(VideoSettings.CloseButtonShowBehavior.HIDE);
Kotlin:
adInline.videoCloseButtonShowBehavior = VideoSettings.CloseButtonShowBehavior.ALWAYS
adInline.videoCloseButtonShowBehavior = VideoSettings.CloseButtonShowBehavior.AFTER_COMPLETE
adInline.videoCloseButtonShowBehavior = VideoSettings.CloseButtonShowBehavior.HIDE
Video player also has different skin types that can be set by using setVideoPlayerSkinType(AdformEnum.VideoPlayerSkinType.[DEFAULT/MINIMAL])
.
Java:
adInline.setVideoPlayerSkinType(AdformEnum.VideoPlayerSkinType.DEFAULT);
adInline.setVideoPlayerSkinType(AdformEnum.VideoPlayerSkinType.MINIMAL);
Kotlin:
adInline.videoPlayerSkinType = AdformEnum.VideoPlayerSkinType.DEFAULT
adInline.videoPlayerSkinType = AdformEnum.VideoPlayerSkinType.MINIMAL
In order to set up video ads fallback, you need to set fallback master tag of other HTML ad.
Java:
adInline.setFallbackMasterTagId(123456);
Kotlin:
adInline.fallbackMasterTagId = 123456
Basic integrations
- Integrating Inline Ad
- Integrating Full Screen Overlay Ad
- Integrating Interstitial Ad
- Integrating Adhesion Ad
- Video Ad Integration
Advanced integrations
- Advanced integration of Inline Ad
- Advanced integration of Full Screen Overlay Ad
- Advanced integration of Interstitial Ad
- Advanced integration of Adhesion Ad
- Advanced integration of AdInline ListView
- Advanced integration of AdInline RecyclerView
- Instream video ads integration
Other
- Adding Custom Values
- Adding Keywords
- Adding Key Value Pairs
- Adding Search Words
- Location
- Security
- Ad Tags
- Header Bidding
- Changing ADX domain
- Specifying banner loading behaviour
- GDPR
- Logs
Mediation adapters
Plugins