VMAP and ad playlists
Currently, the built-in Bitmovin Advertising handling for the mobile SDKs supports only VAST ad tags. To utilise VMAP or ad playlists, the IMA SDK is needed.
Prerequisites
- Basic understanding of Android development with Kotlin
- Bitmovin Player Android SDK added to your project (see Getting Started guide)
- Setup IMA
Setup
Step 1: Create an AdSource
// This snippet includes IMA Sample Tags from https://developers.google.com/interactive-media-ads/docs/sdks/android/tags
val vmapAdSource = AdSource(AdSourceType.Ima, "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpostlongpod&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&vid=short_onecue&correlator=")
Step 2: Create an AdItem
Since VMAP and ad playlists already specify scheduling times for their ad breaks, it is recommended to place them at the beginning of the main content i.e. as a pre-roll ad:
// Define the VMAP ad tag as a pre-roll ad
val preRollAd = AdItem(vmapAdSource)
Step 3: Scheduling Ads
As outlined in the general ad guide the ad can now be scheduled using the AdvertisingConfig
or the Player.scheduleAd
API.
Updated 7 months ago