Which type of barbecue should I buy?

‘).insertAfter(‘#articleBody p:nth-of-type(3):first’);
if(window.idgVideoDebug)console.log(‘JW isStandalone’,$(‘#videoContainer-3787295’).size(),$(‘#idg-video-infeed’).size());
var div = $(‘#videoContainer-3787295>div’);
div.appendTo( $(‘#idg-video-infeed’) );
$(‘#jw-standalone-close-button’).css(
‘position’:’relative’
,’top’:’30px’
,’left’:’92%’
,’width’:’20px’
,’height’:’20px’
,’z-index’:’999999′
);
}else if (window.Device.isMobile)
if(window.idgVideoDebug)console.log(‘JW isStandalone mobile and not article – returning’);
return;
else
//do styles dynamicaly on floating desktop
$(‘#videoContainer-3787295’).css(
‘display’:’inline’
,’position’:’fixed’
,’bottom’:’5px’
,’right’:’5px’
,’height’:’225px’
,’width’: ‘400px’
,’border’:’none’
,’overflow’:’hidden’
,’z-index’:’10000′
);
$(‘#videoContainer-3787295 .outer-wrapper’).css(
‘top’:’0px’
,’left’:’0px’
,’width’:’100%’
,’height’:’100%’
,’border’:’none’
,’overflow’:’hidden’
);
$(‘#videoContainer-3787295 .outer-wrapper #jw-standalone-close-button’).css(
‘position’:’absolute’
,’display’:’inline’
,’top’:’10%’
,’left’: ‘92%’
,’width’:’20px’
,’height’:’20px’
,’z-index’:’999999′
);

/**GA TRACKING ***/
var gaVideoData = percentWatched:0, firstPlayEventRegistered:false;
//version 2 index X
var indexXPublisherConfig =
videoCommonArgs :
“protocols” : [ 2 , 3 , 5 , 6 ], //Player supported VAST Protocols and Wrappers
“mimes” : [ “video/mp4” , “video/webm” , “application/javascript” ], //Player supported mime types
“apiList” : [ 1, 2 ] //Player supported VPAID versions

;
indexXPublisherConfig.siteID = (window.Device.isMobile?196304:196303);
function videoDataLayerPush();//do nothing
/**END GA TRACKING ***/
require([‘jquery’, ‘jwplayer’ ], function($,jwplayer)
if(typeof SpotX === ‘undefined’)//not supported on site
embedVideo($,jwplayer,null)
else
if(window.idgVideoDebug)console.log(‘JW SpotX is active’);
embedVideo($,jwplayer,SpotX);

,function()//ad block
if(window.idgVideoDebug)console.log(‘JW SpotX – Ad block – No SpotX’);
embedVideo($,jwplayer,null);
);//require
var embedVideo = function($,jwplayer,SpotX){
if(window.idgVideoDebug)console.log(‘JW advertisingTag embedVideo() SpotX’,SpotX,’VideoId’,’3787295′,’initial adTagUrl’,’http://pubads.g.doubleclick.net/gampad/ads?iu=/8456/IDG.UK_B2C_PCAdvisor.co.uk/” + adConfig.zone + “&sz=640×480&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=https://www.techadvisor.co.uk/&description_url=https://www.techadvisor.co.uk/&correlator=[timestamp]&vpos=preroll&ppos=1&min_ad_duration=0&vad_type=linear&ad_rule=0&’);
if (typeof window.jwplayer === ‘undefined’)
window.jwplayer = jwplayer;

var showSpotX = (SpotX !== null);
const playertype = ‘bottomRightPlayer’;
googletag.cmd.push(function(){
var timestamp = new Date().getTime(),
advertisingTag = “http://pubads.g.doubleclick.net/gampad/ads?iu=/8456/IDG.UK_B2C_PCAdvisor.co.uk/” + adConfig.zone + “&sz=640×480&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=https://www.techadvisor.co.uk/&description_url=https://www.techadvisor.co.uk/&correlator=[timestamp]&vpos=preroll&ppos=1&min_ad_duration=0&vad_type=linear&ad_rule=0&”,
cust_params =
“playertype”: playertype,
“video-id”: “3787295”,
“stg”: “false”
;
if(typeof window.pageVideoCustomParams === ‘undefined’)
window.setupVideoCustomParams();

$.extend(cust_params, window.pageVideoCustomParams);
var cust_params_url = ”;
var prevQuality;
for(var paramKey in cust_params)
var paramValue = cust_params[paramKey],
delimiter = cust_params_url.length > 0 ? ‘&’ : ”;
if((typeof paramValue !== ‘undefined’) && (paramValue.length > 0))
cust_params_url = cust_params_url + delimiter + paramKey +’=’ + paramValue;

//for
advertisingTag = advertisingTag + ‘&cust_params=’ + encodeURIComponent(cust_params_url)
+ ‘&lip=true&fred&correlator=’ + timestamp;
advertisingTag = advertisingTag.replace(‘&&’,’&’);
if(window.idgVideoDebug)console.log(‘JW advertisingTag after cust params’,advertisingTag);
if(showSpotX)
if(window.idgVideoDebug)console.log(‘JW SpotX entering config, spotxChannelId=’,spotxChannelId);
var directAdOS = new SpotX.DirectAdOS(
channel_id: spotxChannelId,
slot: document.getElementById(“videoContainer-3787295”),
video_slot: document.getElementById(“video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5”),
content_width: 640,
content_height: 480
);
if(window.idgVideoDebug)console.log(‘JW SpotX directAdOS’,directAdOS);
else{
//dummy directAdOS
var directAdOS =
addSpotXParamsToMVT: function(tag)
if(window.idgVideoDebug)console.log(‘JW SpotX addSpotXParamsToMVT on dummy directAdOS called’);
return then: function(fun)fun(advertisingTag);

;
}
var setupFunction = function(mvtURL) {
advertisingTag = mvtURL;
//add permutive segs
try ‘[]’).slice(0,250).join(‘,’)) + ‘&’);
advertisingTag = advertisingTag.replace(‘cust_params=’,’cust_params=’+playerSegsPerm);
catch(err)
if(window.idgVideoDebug)console.error(‘JW setupFunction() permutive tag addition error’,err);

if(window.idgVideoDebug)console.log(‘JW setupFunction() final advertisingTag’,advertisingTag);
//advertisingTag = advertisingTag.replace( new RegExp( “640×480”, “gi” ), “1×1” )
var setupStruct =
fallback: “true”,
//floating: dismissible: true,
width: “100%”,
//autostart: false,
autostart: false,
hlshtml: “true”,
//mute: ((window.Device.isMobile) ? false : true),
mute: true,
//primary: “flash”,
file: “//content.jwplatform.com/manifests/R5iNwSqY.m3u8”,
image: “//cdn.jwplayer.com/thumbs/R5iNwSqY-720.jpg”,
mediaid: “R5iNwSqY”,
aspectratio: “1777:1000”,
advertising:
client: “googima”,
skipoffset: “5”,
adscheduleid: “idgukXXN” ,
autoplayadsmuted: true,
loadVideoTimeout: “60000”,
creativeTimeout: “60000”,
requestTimeout: “60000”,
admessage: “iPhone SE Unboxing will play in xx seconds”,
skiptext: “Skip now”,
schedule: [

offset: “pre”,
tag: advertisingTag

,
offset: “28”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “56”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “84”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “112”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “140”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “168”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “196”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “224”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “252”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “280”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “308”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “336”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “364”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “392”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “420”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “448”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “476”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “504”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “532”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “560”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “588”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “616”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “644”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “672”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “700”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “midroll” )
//tag: advertisingTag

,
offset: “post”,
tag: advertisingTag.replace( new RegExp( “preroll”, “gi” ), “postroll” )

]
,
key:”OccpdaRpvwBO35sM912RXRncb3aDZtlD99wE1A==”
;
var setupPlayerGeoWrapper = function(config)
if(window.idgVideoDebug)console.log(‘JW’, ‘setupPlayerGeoWrapper()’);
jwplayer(“video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5”).setup(config
).on(‘play’,function(event)
if(window.idgVideoDebug)console.log(‘JW’, ‘on play’, event);
//play actually happens after video pre roll.
//dataLayer.push(“event”:”Video Play”);//legacy
if(event.playReason === “interaction”)
videoDataLayerPush(‘Play’);
else if(event.playReason === “external”)
videoDataLayerPush(‘AutoPlay’);
).on(‘ready’,function(event)
if(window.idgVideoDebug)console.log(‘JW’, ‘on ready’, ‘video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5’);
//if(window.idgVideoDebug)console.log(‘JW’, ‘onReady calling playSpotXAd()’);
//playSpotXAd(jwplayer(“video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5”));
).on(‘viewable’,function(event)
if(Device.isMobile)
).on(‘pause’,function(event)
if(window.idgVideoDebug)console.log(‘JW’, ‘on pause’, ‘video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5’);
videoDataLayerPush(‘Pause’);
).on(‘complete’,function(event)
if(window.idgVideoDebug)console.log(‘JW’, ‘on complete’, ‘video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5’);
//dataLayer.push(“event”:”Video Complete”);//legacy
).on(‘firstFrame’, function(event)
if(window.idgVideoDebug)console.log(‘JW’, ‘ on firstFrame’, ‘video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5’);
).on(‘fullscreen’, function(event)
)
.on(‘adError’, function(event)
console.log(‘JW’, ‘on adError’,’video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5′, event);
//jwplayer(“video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5”).stop();//dont auto play if no ad
videoDataLayerPush(‘Ad Error’);
)
.on(‘adRequest’, function(event)
if(window.idgVideoDebug)console.log(‘JW’, ‘on adRequest’, ‘video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5’, event);
)
.on(‘adBlock’,function(event)//only fires on being blocked
if(window.idgVideoDebug)console.log(‘JW’, ‘on adBlock’, event);
)
.on(‘adPlay’, function(event)
if(window.idgVideoDebug)console.log(‘JW’, ‘on adPlay’, ‘video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5’, event);
videoDataLayerPush(‘Ad Start’);
)
.on(‘adComplete’, function(event)
if(window.idgVideoDebug)console.log(‘JW’, ‘on adComplete’, ‘video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5’, event);
videoDataLayerPush(‘Ad Complete’);
)
.on(‘time’, function(event)
//if(window.idgVideoDebug)console.log(‘JW’, ‘on time’, event);
//work out percent
var percent = Math.ceil((event.position/event.duration)*100);
gaVideoData.percentWatched=percent
);//on
if(window.idgVideoDebug)console.log(‘JW’,’jwplayer setup called for video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5′, setupStruct);
/*
if (window.Device.isMobile)
jwplayer().setVolume(100);

*/
setTimeout(function()
if(window.idgVideoDebug)console.log(‘JW’,’setTimeout() playing autoplay video with id’,’3787295′);
if(Device.isMobile && jwplayer().getViewable(“video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5”) === 0)
if(window.idgVideoDebug)console.log(‘JW’,’setTimeout() not autoplaying as not in view on mobile’);
return;//if mobile and not in view then dont start

if(jwplayer(“video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5”).getState() === ‘idle’)jwplayer(“video-9D7CF248-74A8-4F51-B9ABC43B2B2709B5″).play();//calling play if playing toggles it
, 1000);
//setupPlayerGeoWrapper
//if floating but it should be only uk for certain sites then disable
if(‘floating’ in setupStruct)
var floatUKOnly = true;
if(window.idgVideoDebug)console.log(‘JW’,’floatUKOnly’,floatUKOnly);
if(floatUKOnly)
window.$geoLocationDef.done(function()
if(!$(‘html’).is(‘.geo-gb’))//not uk
delete setupStruct.floating;
if(window.idgVideoDebug)console.log(‘JW deleting float property’,setupStruct);
setupPlayerGeoWrapper(setupStruct);
else
setupPlayerGeoWrapper(setupStruct);

);//done
else
setupPlayerGeoWrapper(setupStruct);

else
setupPlayerGeoWrapper(setupStruct);
//if
//if(window.idgVideoDebug)console.log(‘JW SpotX addSpotXParamsToMVT then() returning’);
}//setupFunction
var handleIndexExchange = function(mvt)
var indexCallback = function (updatedMVT, indexTargeting)
if(window.idgVideoDebug)console.log(‘JW’,’indexCallback() updatedMVT’, updatedMVT, ‘mvt’, mvt, ‘indexTargeting’, indexTargeting);
if (typeof indexTargeting !== ‘undefined’ )
var custParams = ”;
for(var key in indexTargeting)custParams = custParams+key+’=’+indexTargeting[key]+’&’;
custParams = escape(custParams);//escape as adding to existing custom_params value
mvt = mvt.replace(‘&cust_params=’,’&cust_params=’+custParams);
if(window.idgVideoDebug)console.log(‘JW’,’indexCallback() amended mvt’,mvt);

mvt = mvt+’&indexx=1′;
;//func
//if(window.idgVideoDebug)console.log(‘JW Post Index X integration, indexXPublisherConfig’,indexXPublisherConfig);
window.getVideoAds(mvt, indexCallback, undefined, indexXPublisherConfig);
//wait for 1 sec for index x to return
setTimeout(function()
setupFunction(mvt);
,1000);
;
// define a function to handle the video bid then request the video tag URL
function handleVideoBid(videoBid, vastTagURL)
/*if(window.idgVideoDebug)*/console.log(‘JW amazon handleVideoBid() videoBid:’,videoBid, ‘vastTagURL:’,vastTagURL);
if(videoBid.length==0)
return vastTagURL;

var videoBid = videoBid.filter(function(bid)return bid.mediaType === ‘video’)[0];
if(window.idgVideoDebug)console.log(‘JW amazon handleVideoBid() videoBid:’,videoBid);
if (videoBid)
// add the encoded query string params to the scp param on the vastTagURL
vastTagURL += ‘&scp=’ + videoBid.encodedQsParams;

return vastTagURL;
//func
function goAmazonGo()
apstag.fetchBids(
slots: [
slotID: ‘videoSlot’, // NOTE: doesn’t need to be the div ID
mediaType: ‘video’
]
, function(bids)
advertisingTag = handleVideoBid(bids, advertisingTag);
if(window.idgVideoDebug)console.log(‘JW amazon post amazon bid, advertisingTag=’,advertisingTag);
directAdOS.addSpotXParamsToMVT(advertisingTag).then(handleIndexExchange);
);
//func
__cmp(‘getConsentData’, null, function(data, success)
if(window.idgVideoDebug)console.log(‘GDPR JW amazon video cmp return’,data.consentData);
goAmazonGo();
);
});//googletag.cmd.push
};//embedVideo
})(typeof require !== ‘undefined’ ? require : idguk.require);

Leave a Reply