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("OAS EVENT: onShowFullscreen('" + streamName + "', " + streamIndex + ")");
document.getElementById("show-fullscreen").style.backgroundColor = "#00CC00";
}
//... the other callback functions go in here
flowplayer("a.player614x345", "", {
clip: {
url: "",
onStart: function(clip){
debug(">>>> onStart Event delivers fullDuration:'"+clip.fullDuration+"'");
},
},
plugins: {
controls: {
autoHide: "always"
},
ova: {
url: "",
"canFireAPICalls": true,
"shows": {
"fireTrackingEvents": true,
"streams": [
{
"file": ""
}
]
},
"ads": {
"servers": [
{
"type": "OpenX",
"apiAddress": "",
}
],
"schedule": [
{
"zone": "5",
"position": "post-roll"
}
],
},
"debug": {
"levels": ""
}
}
}
});