Hi,
I get asked quite frequently to provide a simple pre-roll "embed" tag setup for JW Player so I thought I'd post this for everyone's reference.
There are several easy setup options available to add OVA configuration to object embed tags for JW Player.
1. Reference the OVA configuration via an external file
2. Use the "ova.tag=" flashvar
3. Use the "ova.json=" flashvar
Before using any of these options however, please always download the latest OVA "development" release from the OVA Developer site (go to http://developer.longtailvideo.com/ova and register on that site, login, then go to the "Download the Latest" page and grab the latest OVA development SWF). This is important because OVA is constantly evolving and fixes/new features are added daily that you will miss out on unless you stay up to date with the latest development release.
Now, quickly running through each option.
1. Referencing an external configuration file
The easiest way to add OVA for JW Player to object embed tags is via the use of an external config file as follows:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0" WIDTH="450" HEIGHT="300" id="player">
<PARAM NAME=movie VALUE="/path/to/your/player.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#000000>
<PARAM NAME=allowfullscreen VALUE="true">
<PARAM NAME=allowscriptaccess VALUE="always">
<PARAM NAME=flashvars VALUE="plugins=/path/to/your/ova.swf&config=/path/to/your/config/ova01.xml">
<EMBED
id="player"
data="/path/to/your/player.swf"
src="/path/to/your/player.swf"
width="450"
height="300"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="plugins=/path/to/your/ova.swf&config=/path/to/your/config/ova.xml"
>
</EMBED>
</OBJECT>The "ova.xml" file is structured as follows:
<config>
</ova.json>
{
"debug": {
"levels": "fatal, config, vast_template"
},
"ads": {
"schedule": [
{
"position": "pre-roll",
"tag": "put-your-static-ad-tag-here"
}
]
}
}
<ova.json>
</config>
Don't forget to replace any cache-busting parameters in the tag with "__random-number__" so that OVA can replace that at runtime with a random number to break the cache.
2. Using the "ova.tag" flashvar
There is a short-cut available for pre-roll only setups with a static ad tag.
This shortcut is a flashvar config option called "ova.tag".
"ova.tag" removes the need to use an external config file for very simple pre-roll only + static ad tag setups.
You can use the "ova.tag" option directly with object embed tags as follows:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0" WIDTH="450" HEIGHT="300" id="player">
<PARAM NAME=movie VALUE="/path/to/your/player.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#000000>
<PARAM NAME=allowfullscreen VALUE="true">
<PARAM NAME=allowscriptaccess VALUE="always">
<PARAM NAME=flashvars VALUE="plugins=/path/to/your/ova.swf&ova.tag=/put/your/static/ad/tag/here">
<EMBED
id="player"
data="/path/to/your/player.swf"
src="/path/to/your/player.swf"
width="450"
height="300"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="plugins=/path/to/your/ova.swf&ova.tag=/put/your/static/ad/tag/here"
>
</EMBED>
</OBJECT>When using the "ova.tag" flashvar it is critical that you replace any ampersands (&) with "__amp__" before placing the ad tag in the flashvar config. If you don't, the ad tag will be broken up into individual flashvars and fail to work.
For instance, if your ad tag is:
http://openx.openvideoads.org/openx/www/delivery/fc.php?script=bannerTypeHtml:vastInlineBannerTypeHtml:vastInlineHtml&zones=pre-roll0-0%3D5&nz=1&source=&r=__random-number__&block=1&format=vast&charset=UTF-8it should be entered as:
http://openx.openvideoads.org/openx/www/delivery/fc.php?script=bannerTypeHtml:vastInlineBannerTypeHtml:vastInlineHtml__amp__zones=pre-roll0-0%3D5__amp__nz=1__amp__source=__amp__r=__random-number____amp__block=1__amp__format=vast__amp__charset=UTF-8Now onto the final approach...
3. Using the "ova.json" flashvar
If you have a more complex setup, but wish to avoid using an external configuration file for OVA, you can embed the full OVA configuration via OBJECT EMBED tags using the "ova.json" flashvar.
You can find a full tutorial on "ova.json" here:
The short of it is however that you take the full OVA configuration, url encode it, then inject it directly via a flashvar called "ova.json".
So a configuration that looks like:
{
"debug": {
"levels": "fatal, config, vast_template"
},
"ads": {
"schedule": [
{
"position": "pre-roll",
"tag": "put-your-static-ad-tag-here"
}
]
}
}
when url encoded looks like:
%7B%22ads%22%3A%7B%22schedule%22%3A%5B%7B%22position%22%3A+%22pre-roll%22%2C%22tag%22%3A+%22put-your-static-ad-tag-here%22%7D%5D%7D%7Dand when it's used with the OBJECT EMBED tags is as follows:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0" WIDTH="450" HEIGHT="300" id="player">
<PARAM NAME=movie VALUE="/path/to/your/player.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#000000>
<PARAM NAME=allowfullscreen VALUE="true">
<PARAM NAME=allowscriptaccess VALUE="always">
<PARAM NAME=flashvars VALUE="plugins=/path/to/your/ova.swf&ova.tag=/put/your/static/ad/tag/here">
<EMBED
id="player"
data="/path/to/your/player.swf"
src="/path/to/your/player.swf"
width="450"
height="300"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="plugins=/path/to/your/ova.swf&ova.json=%7B%22ads%22%3A%7B%22schedule%22%3A%5B%7B%22position%22%3A+%22pre-roll%22%2C%22tag%22%3A+%22put-your-static-ad-tag-here%22%7D%5D%7D%7D"
>
</EMBED>
</OBJECT>Hope this helps…
Paul
What if I'd like to use my own pre-roll video and not something from a provider like the OVA setup is?