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.
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.
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.
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:
ExampleVPAID.as and Example.swfIVPAID.as and VPAIDEvent.asTo 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:
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:
ExampleVPAID.as, IVPAID.as and VPAIDEvent.as from AdSDK.zip.ExampleVPAID.as as the main class.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:
Example.swf from AdSDK.zip.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:
<?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>
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.
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."
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.