The VMAP protocol

While VAST focuses on delivering a single ad or a chain of ads, VMAP (Video Multiple Ad Playlist) is designed to handle scenarios where multiple ads need to be inserted at different points during a video. VMAP is another IAB XML-based standard that allows content owners to define specific ad break points (pre-roll, mid-roll, or post-roll) within a video stream, giving them more control over ad placement. It is typically restricted to use in VOD situations.

VMAP Structure

The key element in a VMAP document is the AdBreak, which defines where an ad break occurs. The timing of the ad break, relative to the start of the VOD stream, is defined with the timeOffset attribute, which can either be "start", "end" or a time in the format "HH:MM:SS.mmm" or a percentage.

<vmap:VMAP version="1.0" xmlns:vmap="http://www.iab.net/videosuite/vmap">
  
  <!-- Pre-roll Ad -->
  <vmap:AdBreak timeOffset="start" breakType="linear" breakId="pre1">
    <vmap:AdSource allowMultipleAds="false" followRedirects="true">
      <vmap:AdTagURI>
        <![CDATA[http://example.com/preroll-ad-vast.xml]]>
      </vmap:AdTagURI>
    </vmap:AdSource>
  </vmap:AdBreak>

  <!-- Mid-roll Ad at 25% of content duration -->
  <vmap:AdBreak timeOffset="25%" breakType="linear" breakId="mid1">
    <vmap:AdSource allowMultipleAds="false" followRedirects="true">
      <vmap:AdTagURI>
        <![CDATA[http://example.com/midroll-25percent-ad-vast.xml]]>
      </vmap:AdTagURI>
    </vmap:AdSource>
  </vmap:AdBreak>

  <!-- Mid-roll Ad at 5 minutes into content -->
  <vmap:AdBreak timeOffset="00:05:00" breakType="linear" breakId="mid2">
    <vmap:AdSource allowMultipleAds="false" followRedirects="true">
      <vmap:AdTagURI>
        <![CDATA[http://example.com/midroll-5min-ad-vast.xml]]>
      </vmap:AdTagURI>
    </vmap:AdSource>
  </vmap:AdBreak>

  <!-- Post-roll Ad -->
  <vmap:AdBreak timeOffset="end" breakType="linear" breakId="post1">
    <vmap:AdSource allowMultipleAds="false" followRedirects="true">
      <vmap:AdTagURI>
        <![CDATA[http://example.com/postroll-ad-vast.xml]]>
      </vmap:AdTagURI>
    </vmap:AdSource>
  </vmap:AdBreak>

</vmap:VMAP>

📘

Namespace

The VMAP spec, unlike VAST, requires the use of a namespace http://www.iab.net/videosuite/vmap, in particular when it wraps VAST responses, as shown in the next section.

VAST response

The AdSource within the AdBreak provides the information about the ad or ads to insert, which itself must be a VAST-compliant response. There are 2 possible ways to do so:

  • As a reference to an external VAST document, by using an AdTagURI (like in the previous example)
  • Or inline, by adding the VAST response inside a VASTAdData element
<vmap:VMAP version="1.0" xmlns:vmap="http://www.iab.net/videosuite/vmap">
  <vmap:AdBreak timeOffset="start" breakType="linear" breakId="pre1">
    <vmap:AdSource allowMultipleAds="false" followRedirects="true">
      <vmap:VASTAdData>
        
        <!-- inline VAST ad -->
        <VAST version="4.0">
          <Ad id="12345">
            <InLine>
              <AdSystem version="4.0">ExampleAdSystem</AdSystem>
              <AdTitle>Sample Inline Video Ad</AdTitle>
              <Creatives>
                <Creative sequence="1" AdID="abc123">
                  <Linear>
                    <Duration>00:00:30</Duration>
                    <MediaFiles>
                      <MediaFile delivery="progressive" type="video/mp4" width="640" height="360">
                        http://example.com/creative.mp4
                      </MediaFile>
                    </MediaFiles>
                  </Linear>
                </Creative>
              </Creatives>
            </InLine>
          </Ad>
        </VAST>
        
      </vmap:VASTAdData>
    </vmap:AdSource>
  </vmap:AdBreak>
</vmap:VMAP>

Reference