VMAP and ad playlists
Both the built-in Bitmovin Advertising handling and IMA support VMAP ad tags. Ad playlists are only supported with the IMA integration.
Version requirementVMAP support in the built-in Bitmovin Advertising handling (
.bitmovin) is available starting with Bitmovin Player iOS SDK version3.131.0. In earlier versions, use the IMA SDK (.ima) to play VMAP ad tags.
Prerequisites
- Basic understanding of iOS development with Swift
- Bitmovin Player iOS SDK added to your project (see Getting Started guide)
- (Only necessary for ad playlists) 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
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
}
// Use `.ima` instead of `.bitmovin` to handle the VMAP ad tag with the IMA SDK
let vmapAdSource = AdSource(tag: adUrl, ofType: .bitmovin)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.ads.schedule API.
Supported VMAP features with Bitmovin Advertising
- Linear breaks with a VAST ad tag URI or inline VAST XML
- Break positions follow the VMAP
timeOffset(start,end, clock time, seconds or percentage).#Noffsets are not supported repeatAfter,allowMultipleAds,followRedirectsand extensions are ignoredAdBreak.identifieruses the VMAPbreakIdwhen present- A rejected break does not affect the other breaks
Updated 7 days ago
Did this page help you?