Skip to content

Instantly share code, notes, and snippets.

@datt
Last active December 19, 2015 22:39
Show Gist options
  • Select an option

  • Save datt/6029440 to your computer and use it in GitHub Desktop.

Select an option

Save datt/6029440 to your computer and use it in GitHub Desktop.
Configuring the ova plugin for openx inline video ad serving.
/**There are two ways of configuring ads in OVA
i) By using zone id : */
jwplayer("videoContainer").setup({
modes:[{type: 'html5'},{type:'flash',src: "/jwplayer/player.swf"}],
autostart: 'true',
allowscriptaccess: 'always',
playlist: [
{
"provider": "rtmp"
"streamer": "rtmp://test-bla.prometheusdata.com:1935/vod/",
"file": "converted.mp4":,
}
],
bufferlength: 2,
image: "/uploads/images/preview.jpg":,
height: 354,
width: 637,
skin: '/jwplayer/nacht/nacht.xml',
plugins: {
"ova-jw": {
"ads": {
"schedule": [
{
"position": "pre-roll",
"tag": "http://ads.mlbdigitalacademy.com/www/delivery/fc.php?script=bannerTypeHtml:vastInlineBannerTypeHtml:vastInlineHtml&source=&format=vast&charset=UTF_8&nz=3&zones=pre-roll1%3D13"
}
]
},
"debug": {
"levels": "fatal, config, vast_template"
}
}
}
});
/** ii) By adding ad tag directly :*/
jwplayer("videoContainer").setup({
modes:[{type: 'html5'},{type:'flash',src: "/jwplayer/player.swf"}],
autostart: 'true',
allowscriptaccess: 'always',
playlist: [
{
"provider": "rtmp"
"streamer": "rtmp://test-bla.prometheusdata.com:1935/vod/",
"file": "converted.mp4":,
}
],
bufferlength: 2,
image: "uploads/images/preview.jpg":,
height: 354,
width: 637,
skin: '/jwplayer/nacht/nacht.xml',
plugins: {
"ova-jw": {
"ads": {
"servers": [
{
"type": "OpenX",
"apiAddress": "http://ads.mlbdigitalacademy.com/www/delivery/fc.php"
}
],
"schedule": [
{
"position": "pre-roll",
"zone": "13" /*this is zone id*/
}
]
},
"debug": {
"levels": "fatal, config, vast_template"
}
}
}
});
/** NOTE: for playing file in the video after ad serving file attribute must be present in the playlist, this is requirement for OVA plugin otherwise it throw error in the console as No suitable player found. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment