I need a random number in my preroll video call, thats why I cannot use a config.xml file but need to define my values inline. I tried this, but it doesnt work:
jwplayer('container').setup({
'width': 700,
'height': 400,
'file': '<?php echo $video; ?>',
'plugins': {
'ova': ''
},
'ova.json' : {
"ads": {
"servers": [{
"type": "OpenX",
"apiAddress": "vast.txt"
}],
"notice": { "textStyle": "smalltext" },
"displayCompanions": true,
"companions": [{
"id":"companion",
"width":"200",
"height":"240"
}],
"schedule": [{
"zone": "47",
"position": "pre-roll",
"server": {
"type": "direct",
"tag": "http://domain.de/vid?<? echo rand(100,999); ?>"
}
},
{
"zone": "48",
"position": "auto:bottom",
"width": 320,
"height": 80,
"startTime": "00:00:02",
"duration": "5"
}]
}
},
'modes': [
{type: 'html5'},
{type: 'flash', src: 'jwplayer/player.swf'},
{type: 'download'}
]
});Can anyone tell me what I'm doing wrong?
Any help is much appreciated.
Hi,
I think the main issue is that when using the "ova" ID for the plugins, you're loading the OVA SWF from the Longtail repository. That version (0.4.4) doesn't support the JSON based in-line setup.
To use the in-line setup, download the 1.0.0 OVA SWF from the OVA Developer Site (http://developer.longtailvideo.com/ova) - register on the site and then grab the V1.0.0 SWF from the "Download the Latest" page. Load that SWF up on your server and then reference it as follows:
...plugins: {
'/path/to/your/ova-jw.swf': {
}
}
Note that the new V1.0.0 SWF is named "ova-jw.swf".
That's the first thing.
Now to the in-line setup.
There is a much cleaner way to configure OVA with the in-line JSON approach rather than use the messy "ova.json" variable.
Use the following approach:
....plugins: {
'/path/to/your/ova-jw.swf': {
// Put your config directly in here
}
}
Here's an example of that setup in practice:
http://static.openvideoads.org/qa/latest/ova.jwplayer.5x/examples/pages/setup/jw-embedder.htmlActually you can find a full set of v1.0.0 examples here - they may help:
http://static.openvideoads.org/qa/latest/ova.jwplayer.5x/examples/index.htmlWith v1.0.0 you can also set OVA variables in the ad tags. There is a variable for random-number generation so you can actually declare your ad tag as follows:
http://domain.de/vid?__random-number__When OVA makes the ad call, the "__random-number__" variable will be replaced with an AS3 generated random number.
Hope this helps, let me know how you get on...
Paul