Player Widgets: Setting Up Audio or Video Pre-rolls with VAST URLs

Last Updated -

This article is for: Player developers.
Using: Triton Digital Player Widgets.
Objective: Set up audio or video pre-rolls with VAST URLs for the Ad Widget.


You can use the Ad Widget to run audio or video pre-rolls. This article shows you four ways to achieve this by using a VAST URL as the creative source; either through Tap or by using a source such as Google DFP.

The first two methods described below are for when you are using the Ad Widget and the Live Audio Widget together. This is the best choice for most users, as the two widgets are designed to work together. The second two methods are for when you are using the Ad Widget with your own custom player.

  Using Tap Using Google DFP or Similar
Ad Widget and Live Audio Widget Use Method 1
(Best overall choice for ease of integration, and to take advantage of Tap's targeting capabilities.)
Use Method 2
(Easy to integrate, but misses out on Tap's targeting capabilities.)
Ad Widget and your custom player Use Method 3
(Requires more integration, but takes advantage of Tap's targeting capabilities.)
Use Method 4
(Requires more integration and misses out on Tap's Targeting capabilities.)


Note: The code snippets shown below include the minimum configuration attributes you need to use. See the Developer documentation for information about additional optional attributes, such as setting Flash or HTML5 as the rendering mode, setting autoplay options, adjusting sizes and colors, etc.

Using the Ad Widget and the Live Audio Widget

The methods below are the easiest to configure because the Ad Widget and the Live Audio Widget are designed to work together; they communicate with each other automatically.


(Method 1) Using Tap With the Ad Widget and Live Audio Widget

  1. Set up a flight in Tap using the "Pre-roll Ad (On Demand CPM)" traffic method and the VAST URL creative template.
  2. In the Ad Widget configuration, include the following minimum attributes:
    • id=(your element ID)
    • client="tap"
    • host=(provided to you by TD)
    • type=preroll
    • stationid=(your station ID)
What Happens

When the listener connects (either when autostart is "true" or the listener clicks "Play"), the Ad Widget makes the ad call, and the VAST pre-roll ad is played in the Ad Widget before the audio stream starts. When the pre-roll ad finishes, the audio stream connects to the Live Audio Widget.


(Method 2) Using a VAST URL Source with the Ad Widget and Live Audio Widget

  1. In the Ad Widget configuration, include the following minimum attributes:
    • id=(your element ID)
    • client="vast"
    • tag=(the VAST URL)
What Happens

When the listener connects (either when autostart is "true" or the listener clicks "Play"), the Ad Widget makes the ad call, and the VAST pre-roll ad is played in the Ad Widget before the audio stream starts. When the pre-roll ad finishes, the audio stream connects to the Live Audio Widget.


Using the Ad Widget and Your Custom Player

The methods below require additional configuration to enable communication between the the Ad Widget and your custom player. The two items must communicate so the player knows when the pre-roll has finished and it can connect to the content stream. This additional configuration is done using callbacks and triggers as described in the Triton Player Widgets SDK. The details of this configuration are beyond the scope of this article. If you need assistance, contact your Triton Digital solutions specialist.


(Method 3) Using Tap With the Ad Widget and Your Custom Player

  1. Set up a flight in Tap using the "Pre-roll Ad (streaming CPM)" traffic method and the VAST URL creative template.
  2. In the Ad Widget configuration, include the following attributes:
    • id=(your element ID)
    • client="tap"
    • host=(provided to you by TD)
    • type=preroll
    • stationid=(your station ID)
  3. In the Ad Widget and your custom player, configure additional callbacks and triggers to ensure the two can communicate.
What Happens

When the listener connects (either when "Play" is clicked or via whatever play actions are included in the custom player), the Ad Widget makes the ad call, and the VAST pre-roll ad is played in the Ad Widget before the audio stream starts. When the pre-roll ad finishes, the Ad Widget communicates with the custom player via callbacks or custom actions configured with your player, and the audio stream connects to the player.


(Method 4) Using a VAST URL Source with the Ad Widget and Your Custom Player

  1. In the Ad Widget configuration, include the following minimum attributes:
    • id=(your element ID)
    • client="vast"
    • tag=(the VAST URL)
  2. In the Ad Widget and your custom player, configure additional callbacks and triggers to ensure the two can communicate.
What Happens

When the listener connects (either when "Play" is clicked or via whatever play actions are included in the custom player), the Ad Widget makes the ad call, and the VAST pre-roll ad is played in the Ad Widget before the audio stream starts. When the pre-roll ad finishes, the Ad Widget communicates with the custom player via callbacks or custom actions configured with your player, and the audio stream connects to the player.


Resources