The configuration for this example is:
<script type="text/javascript">
function createOVAConfig(adPosition) {
var config = {
debug: { levels: "fatal, config, vast_template, vpaid, http_calls, playlist, api" },
ads: {
servers: [
{
type: "OpenX",
apiAddress: "http://openx.openvideoads.org/openx/www/delivery/fc.php"
}
],
notice: { textStyle: "smalltext" },
schedule: [
{
zone: "18",
position: adPosition
}
]
}
};
return config;
}
function rescheduleWithAdPosition(position) {
if(jwplayer('container').getPlugin('ova').scheduleAds(null, createOVAConfig(position))) {
debug("OVA successfully rescheduled with " + position + " ad positions using the original playlist");
}
else {
debug("OVA failed to reschedule with " + position + " ad positions using the original playlist");
}
}
jwplayer("container").setup({
flashplayer: "",
playlist: [
{
file: "http://streaming.openvideoads.org/shows/bbb-640x360.mp4",
image: "http://streaming.openvideoads.org/shows/bbb-image.jpg",
'playlist.image': "http://streaming.openvideoads.org/shows/bbb-thumbnail.jpg",
title: "Big Buck Bunny Trailer",
description: "Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation.",
duration: 10
},
{
file: "http://streaming.openvideoads.org/shows/sintel-1024-stereo.mp4",
image: "http://streaming.openvideoads.org/shows/sintel-image.jpg",
'playlist.image': "http://streaming.openvideoads.org/shows/sintel-thumbnail.jpg",
title: "Sintel",
description: "Sintel is a fantasy computer generated short movie. It's the third release from the Blender Open Movie Project.",
duration: 11
}
],
width: 650,
height: 240,
controlbar: "bottom",
plugins: {
"../../../dist/swf/ova-jw.js": createOVAConfig("pre-roll")
}
});
</script>
<ul>
<li><a href="#" onclick="rescheduleWithAdPosition('pre-roll');">
Reschedule with pre-rolls
</a></li>
<li><a href="#" onclick="rescheduleWithAdPosition('post-roll');">
Reschedule with post-rolls
</a></li>
</ul>