Adding Video Ad Tags

How to add outstream (self-contained player) and instream (your own player, VAST tag) video ad slots, including the advlume:vastReady event for retrieving the winning VAST URL.

Advlume supports two video ad formats: outstream (plays in a self-contained player within your content) and instream (plays inside your own video player as a pre-roll or mid-roll). Both use the same slot snippet syntax but behave differently after the auction.

Outstream video

Outstream is the simplest option — no existing video player or content is required.

<div
  data-advlume-site="YOUR-SITE-UUID"
  data-advlume-slot="video-mid"
  data-advlume-format="outstream"
></div>

The wrapper detects the outstream format, loads the video module, and creates the rmp-vast player inside the div. The ad plays automatically (muted), and floats to the bottom-right corner if the visitor scrolls away while the video is playing.

See Outstream Video Ads for full specifications.

Instream video

Instream requires you to have your own video player. The Advlume wrapper runs a Prebid VAST auction and makes the winning VAST tag URL available; you pass it to your player.

Step 1 — Add the instream slot div

<div
  data-advlume-site="YOUR-SITE-UUID"
  data-advlume-slot="video-preroll"
  data-advlume-format="instream"
  id="my-video-preroll-slot"
></div>

Step 2 — Retrieve the VAST tag URL and pass it to your player

After the auction completes, the winning VAST URL is stored on the slot element. Access it via the Advlume wrapper's API:

<script>
window.addEventListener('advlume:vastReady', function(e) {
  if (e.detail.slotKey === 'video-preroll') {
    // Pass e.detail.vastUrl to your player
    myPlayer.setAdTagUrl(e.detail.vastUrl);
  }
});
</script>

The advlume:vastReady event fires when the auction has completed and the VAST URL is available. If no bid won, e.detail.vastUrl will be null — handle this case by proceeding with content playback directly.

Player-specific integration

PlayerWhere to pass the VAST URL
JW Playeradvertising: { tag: vastUrl } in setup config
Video.js + ima3adTagUrl in the IMA3 plugin options
Flowplayerads: { adTagUrl: vastUrl } in plugin config
HTML5 nativeFetch and parse the VAST XML manually, then load the media URL

Video unit requirements

  • Create a dedicated video ad unit in the Advlume dashboard with the video format selected. Outstream and instream slots share the same video ad unit type.
  • Instream ads require genuine video content on the page. Using instream slots on pages without a real video player will result in very low fill and may violate demand partner policies.

Further reading

Last updated 2 months ago