jwplayer advertisement

How to link external url on jwplayer pre roll advertisement

27

The googima preroll ad of jwplaer fires and once user clicks on it, it redirects to a third party page (in this case your website), but bear in mind that there will be two redirects as the advertising site will still be displaying on a separate tab.

below is sample code

 

<script type=”text/javascript“>
let player = jwplayer(‘player’)
player.setup({
“advertising”: {
“admessage”: “This video will resume in xx seconds”,
“client”: “googima”,
“cuetext”: “Advertisement”,
“preloadAds”: false,
“rules”: {
“startOnSeek”: “pre”,
“timeBetweenAds”: 0
},
“schedule”: [
{
“offset”: “pre”,
“tag”: “https://pubads.g.doubleclick.net/gampad/ads?sz=640×480&iu=/33445/external/single_ad_samples&ciu_szs=300×250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=”,
“type”: “linear”
}
],
“skipmessage”: “Skip ad in xx seconds”,
“vpaidcontrols”: false,
“vpaidmode”: “insecure”
},
“aspectratio”: “16:9”,
“autostart”: true,
“cast”: {
“appid”: “00000000”
},
“controls”: true,
“displaydescription”: false,
“displaytitle”: false,
“mute”: false,
“ph”: 1,
“pid”: “bqCwhc5a”,
“playbackRateControls”: false,
“preload”: “metadata”,
“related”: {
“autoplaytimer”: 2,
“displayMode”: “overlay”,
“onclick”: “play”,
“oncomplete”: “autoplay”
},
“stagevideo”: false,
“stretching”: “uniform”,
“width”: “100%”,
“file”: “path”,
“starttime”: 0,
“autoplaytimer”: 2
})
player.on(‘adClick’, function (){
window.location.href = “link”;
});
</script>
·


Related Articles & Comments

Leave a Comment

Your email address will not be published. Required fields are marked *