Developing VPAID SWFs

Product
Video Cloud
Applies to Roles
Developer, Ad Operations
Version
Brightcove 5
Modules
Advertising API
Edition
Pro, Enterprise

Creating a VPAID SWF requires advanced development skills. This feature is intended for use by ad network and ad serving partners with complex ad delivery requirements. If you are a Video Cloud customer and think your project or product calls for use of a VPAID SWF, please first contact your Account Manager to see if one of Brightcove's ad partners would work better for you.

IAB Digital
Video Player-Ad Interface Definition (VPAID) Compliance Seal

Video Cloud supports VPAID, the Video Player-Ad Interface Definition standard specified by the IAB. This creates new opportunities in ad delivery strategies for Brightcove partners and developers. The Video Cloud player is now VPAID-compliant, providing a standard method for video ads to communicate with it. This means that developers can bring their already VPAID-complaint SWFs and traffick them to a Video Cloud player.

This document outlines the steps for building a VPAID SWF using the example code that is provided with the Video Cloud Ad SDK. The goal is to help developers to get familiar with developing a VPAID SWF, understand the relationship between VAST and VPAID, and understand how to traffick VPAID ads to Video Cloud players.

If you are new to VPAID, we recommend reading the specification provided by the IAB, the Introduction to VPAID, and Using the VAST Standard in Video Cloud Players.

VPAID and VAST

It is important to highlight that VPAID SWFs are trafficked under the VAST umbrella. That is, VPAID SWFs can only be trafficked as part of a VAST ad response. Although VPAID SWFs are similar in behavior to the Video Cloud Ad Display SWF, which can be trafficked either through VAST or as a Video Cloud ad format, VPAID SWFs are trafficked only as part of VAST. Video Cloud supports trafficking VPAID SWFs for VAST 2.0. VAST 1.0 is not supported for VPAID SWFs. A typical VAST XML response including a VPAID SWF can be found in the VAST Example section below.

Building a VPAID SWF

To help you learn how to write VPAID SWFs, you can download the Video Cloud Ad SDK zip file, AdSDK.zip, which includes the following resources under the vpaid folder:

  • Example of a VPAID SWF: ExampleVPAID.as and Example.swf
  • Example of a VPAID interface and event model to speed VPAID SWF development: IVPAID.as and VPAIDEvent.as

To learn about creating and using VPAID SWFs, set up the example and see how it works. The main steps in setting up the example are:

  1. Compile and host the example VPAID SWF.
  2. Add the VPAID SWF to a VAST xml response.
  3. Set up a player to use the example VPAID SWF.
  4. Load the player and see the ad play.

Setting up the example VPAID SWF

The first thing you need to do is to compile and host the example VPAID SWF. You can either compile ExampleVPAID.as or just use the already-compiled Example.swf. To start with ExampleVPAID.as:

  1. Get ExampleVPAID.as, IVPAID.as and VPAIDEvent.as from AdSDK.zip.
  2. You also need the FakeAd.as class, which you can copy from any of the other example folders in AdSDK.zip. For example, you can grab a copy from the adswf folder.
  3. Create a project in your development environment with ExampleVPAID.as as the main class.
  4. Compile ExampleVPAID.as and put the resulting SWF on a web server. You will need the URL to this SWF to include in your VAST XML.

To use the already-compiled Example.swf:

  1. Get Example.swf from AdSDK.zip.
  2. Put the SWF on a web server. You will need the URL to this SWF to include in your VAST XML.

Setting up the VPAID in VAST

We said at the beginning that VPAID SWFs are trafficked through VAST 2.0. This means that you will need to include the URL to your VPAID SWF in a VAST XML response. Below, you can see an example of such VAST XML that you can use to test your VPAID SWF. The instructions on how to traffick it are explained below as well, but pay special attention to the StaticResource element:

<NonLinear apiFramework="VPAID" id="overlay-1"  width="480" height="200" >
     <StaticResource creativeType="application/x-shockwave-flash">
     <![CDATA[http://admin.brightcove.com/vpaid/Example.swf]]></StaticResource>
</NonLinear>

Notice that this section indicates the location of the VPAID SWF. To test your VPAID SWF, simply replace http://admin.brightcove.com/vpaid/Example.swf with the location of your VPAID SWF created in the previous section.

The XML below is a sample VAST 2.0 XML that you can use for testing your VPAID SWF. It is missing some of the pieces you would normally have in VAST XML, such as an impression and click-thru URL, but it may be helpful for running the example.

If you want to use this XML without putting it on an ad server, simply do the following:

  1. Put this VAST XML file on a web server.
  2. Enable a player for advertising in the Video Cloud Studio Advertising module.
  3. In the Advertising module, change the Ad Source for the player to the default (if it's DART) or most others, like Atlas.
  4. In the Advertising module, set the ad server URL to the location set up in step 1. You must also add a ? to the end of the URL. Doing this will then allow you to use the XML file directly as your "ad server". The StaticResource element in the example points to a remote copy of the SWF; make sure to change it if you make changes to your local copy.

VAST Example

<?xml version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="vast_2.0.1-creativeView.xsd"
 version="2.0">

  <Ad id="overlay-1">
    <InLine>
      <AdSystem>2.0</AdSystem>
      <AdTitle>VPAID Example</AdTitle>
      <!--  <Impression><![CDATA[http://impression_url_goes_here]]</Impression> -->
      <Creatives>
        <Creative>
          <NonLinearAds>
            <NonLinear apiFramework="VPAID" id="overlay-1"  width="480" height="200" >
              <StaticResource creativeType="application/x-shockwave-flash">
              <![CDATA[http://admin.brightcove.com/vpaid/Example.swf]]></StaticResource>
            </NonLinear>
          </NonLinearAds>
        </Creative>
      </Creatives>
    </InLine>
  </Ad>
</VAST>

Trying it out

Once you have compiled your VPAID SWF, hosted it in a web server, created the VAST XML, and pointed to your VPAID SWF, you can traffick this VAST XML to a player and load the player. The example should display a smiley face which simulates a non-linear ad.

As a developer, you will find useful the VPAID debugging messages in the Brightcove Player Debugger. The VPAID specification indicates specific methods, events, and properties for linear vs non-linear ads. In the Player Debugger, we trace out warning and errors when things do not match the specification. We hope that these messages can help you during your development.

Trying a VPAID linear ad

To see how a VPAID linear ad works, change the variable isLinearAd in ExampleVPAID.as to true so that the player knows you want to display a linear ad. Now, compile your linear VPAID SWF, host it in a web server, and create VAST XML similar to the following (but pointed to your VPAID SWF):

<?xml version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="vast_2.0.1-creativeView.xsd"
 version="2.0">

  <Ad id="linear ad">
    <InLine>
      <AdSystem>2.0</AdSystem>
      <AdTitle>VPAID Example</AdTitle>
      <Impression><![CDATA[http://impression_url_goes_here]]</Impression>
      <Creatives>
        <Creative>
          <Linear>
            <Duration>00:00:12</Duration>
            <MediaFiles>
              <MediaFile apiFramework="VPAID" width="480" height="360" >
                <![CDATA[http://creatives.example.com/vpaid/Example.swf]]>
              </MediaFile>
            </MediaFiles>
          </Linear>
        </Creative>
      </Creatives>
    </InLine>
  </Ad>
</VAST>

Traffick this VAST XML to a player and load the player. The example should display a smiley face which simulates a linear ad. The controls should change to ad mode, showing only "Sponsor Message."

Conclusion

Making use of the VPAID (Video Player-Ad Interface Definition) standard brings immense benefits to video advertising. At Brightcove, we are excited about supporting the VPAID standard and look forward to your feedback as you implement VPAID SWFs.

Tags
ad SWF, IAB, VAST, VPAID