This example illustrates the javascript callback API for show stream related events. Events are fired by the Open Ad Streamer when a show stream is started, stopped, complete, resumed, muted, unmuted or goes fullscreen
To start receiving these events, the "fireTrackingEvents" show streams config property must be set to "true". It is "false" by default. In addition, "canFireAPICalls" must also be set to "true" (it is "true" by default).
In this example, a series of DIVs are displayed around the player. As each event fires, the corresponding DIV is turned green. If you have Firebug installed, bring up the console. Debug output is shown as each event fires so you can see the javascript callback event occur.
The configuration for this example is:
// An example ad event Javascript callback
function onShowStart(streamName, streamIndex) {
debug("OVA EVENT: onShowStart('" + streamName + "', " + streamIndex + ")");
document.getElementById('show-start').style.backgroundColor = "#00CC00";
}
//... the other callback functions go in here
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "",
width: 650,
height: 240,
playlist:[
{
file: "http://streaming.openvideoads.org/shows/the-black-hole.mp4"
}
],
"controlbar.position": "bottom",
plugins: {
"../../../dist/swf/ova-jw.swf": {
"shows": { "fireTrackingEvents": true },
"ads": {
"servers": [
{
"type": "OpenX",
"apiAddress": "http://openx.openvideoads.org/openx/www/delivery/fc.php"
}
],
"notice": { "textStyle": "smalltext" },
"schedule": [
{
"zone": "18",
"position": "post-roll"
}
]
},
"debug": {
"levels": "fatal, config, vast_template, vpaid, http_calls, playlist, api"
}
}
}
});