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

Setup

Step 1: Create an AdSource

// This snippet includes IMA Sample Tags from https://developers.google.com/interactive-media-ads/docs/sdks/android/tags
guard let adUrl = URL(string: "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=") else {
    return
}
let vmapAdSource = AdSource(tag: adUrl, ofType: .ima)

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
let preRollAd = AdItem(adSources: [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.