').insertAfter('#articleBody p:nth-of-type(3):first');if(adConfig.debug)console.log('JW isStandalone',$('#videoContainer-3782076').size(),$('#idg-video-infeed').size());var div = $('#videoContainer-3782076>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(adConfig.debug)console.log('JW isStandalone mobile and not article - returning');return;}else{//do styles dynamicaly on floating desktop$('#videoContainer-3782076').css({'display':'inline','position':'fixed','bottom':'5px','right':'5px','height':'225px','width': '401px','border':'none','overflow':'hidden','z-index':'10000'});$('#videoContainer-3782076 .outer-wrapper').css({'top':'0px','left':'0px','width':'100%','height':'100%','border':'none','overflow':'hidden'});$('#videoContainer-3782076 .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 Xvar 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?196306:196305);//only one watched event per video$( window ).on('beforeunload',function() {if(gaVideoData.firstPlayEventRegistered){videoDataLayerPush('Watched');}});function videoDataLayerPush(eventAction){var autoStart = true;//was this video autostartvar percentile = '';if(eventAction === 'Watched'){//percentile Trackingvar percent = gaVideoData.percentWatched;if(percent >= 0 && percent = 25 && percent = 50 && percent 75 ){percentile = '100%';}}if(eventAction.indexOf('lay')>0 && !gaVideoData.firstPlayEventRegistered){gaVideoData.firstPlayEventRegistered=true;}/*//bit complicated this but basically JW registers Play after a Pre Roll on autoplay so if Ad Start called and we have registered a play event then fire itif(eventAction === 'Ad Start' && !gaVideoData.firstPlayEventRegistered){videoDataLayerPush('Play');}*/if( (typeof dataLayer != "undefined") ){var dl = {'event': 'videoEvent','eventCategory': 'Video','eventAction': eventAction,'eventLabel': percentile,'videoPlayerName': 'JW','videoTitle': 'Making the move to 5G: What to know, how to plan for it','videoId': '3782076','videoAutoplay': (autoStart?'True':'False')};dataLayer.push(dl);if(adConfig.debug)console.log('JW videoDataLayerPush() '+ eventAction,dl);}}/**END GA TRACKING ***/require(['jquery', 'jwplayer' ], function($,jwplayer){if(typeof SpotX === 'undefined'){//not supported on siteembedVideo($,jwplayer,null)}else{if(adConfig.debug)console.log('JW SpotX is active');embedVideo($,jwplayer,SpotX);}},function(){//ad blockif(adConfig.debug)console.log('JW SpotX - Ad block - No SpotX');embedVideo($,jwplayer,null);});//requirevar embedVideo = function($,jwplayer,SpotX){if(adConfig.debug)console.log('JW advertisingTag embedVideo() SpotX',SpotX,'VideoId','3782076','initial adTagUrl','http://pubads.g.doubleclick.net/gampad/ads?iu=/8456/IDG.UK_B2C_MacWorld.co.uk/" + adConfig.zone + "&sz=640x480&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=https://www.macworld.co.uk/&description_url=https://www.macworld.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);googletag.cmd.push(function(){var timestamp = new Date().getTime(),advertisingTag = "http://pubads.g.doubleclick.net/gampad/ads?iu=/8456/IDG.UK_B2C_MacWorld.co.uk/" + adConfig.zone + "&sz=640x480&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=https://www.macworld.co.uk/&description_url=https://www.macworld.co.uk/&correlator=[timestamp]&vpos=preroll&ppos=1&min_ad_duration=0&vad_type=linear&ad_rule=0&",cust_params = {"playertype": 'autoplay',"video-id": "3782076","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;}}//foradvertisingTag = advertisingTag + '&cust_params=' + encodeURIComponent(cust_params_url)+ '&lip=true&fred&correlator=' + timestamp;advertisingTag = advertisingTag.replace('&&','&');if(adConfig.debug)console.log('JW advertisingTag after cust params',advertisingTag);if(showSpotX){if(adConfig.debug)console.log('JW SpotX entering config, spotxChannelId=',spotxChannelId);var directAdOS = new SpotX.DirectAdOS({channel_id: spotxChannelId,slot: document.getElementById("videoContainer-3782076"),video_slot: document.getElementById("video-8B7F3A21-8968-4BE4-9361A3721CF10E5D"),content_width: 640,content_height: 480});if(adConfig.debug)console.log('JW SpotX directAdOS',directAdOS);}else{//dummy directAdOSvar directAdOS = {addSpotXParamsToMVT: function(tag){if(adConfig.debug)console.log('JW SpotX addSpotXParamsToMVT on dummy directAdOS called');return {then: function(fun){fun(advertisingTag);}}}};}var setupFunction = function(mvtURL) {advertisingTag = mvtURL;//add permutive segstry{if(adConfig.debug)console.log('JW setupFunction() pre perm addition advertisingTag',advertisingTag);var playerSegsPerm = encodeURIComponent('permutive=' + encodeURIComponent(JSON.parse(localStorage._pdfps || '[]').slice(0,250).join(',')) + '&');advertisingTag = advertisingTag.replace('cust_params=','cust_params='+playerSegsPerm);}catch(err){if(adConfig.debug)console.error('JW setupFunction() permutive tag addition error',err);}if(adConfig.debug)console.log('JW setupFunction() final advertisingTag',advertisingTag);//advertisingTag = advertisingTag.replace( new RegExp( "640x480", "gi" ), "1x1" )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/nSccOQ7x.m3u8",image: "//cdn.jwplayer.com/thumbs/nSccOQ7x-720.jpg",mediaid: "nSccOQ7x",aspectratio: "1777:1000",advertising: {client: "googima",skipoffset: "5",adscheduleid: "idgukXXMany" ,autoplayadsmuted: true,loadVideoTimeout: "60000",creativeTimeout: "60000",requestTimeout: "60000",admessage: "Making the move to 5G: What to know, how to plan for it will play in xx seconds",skiptext: "Skip now",schedule: [{offset: "pre",tag: advertisingTag},{offset: "29",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "58",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "87",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "116",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "145",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "174",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "203",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "232",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "261",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "290",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "319",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "348",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "377",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "406",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "435",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "464",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "493",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "522",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "551",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "580",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "609",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "638",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "667",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "696",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "725",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "754",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "783",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "812",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "841",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "870",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "899",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "928",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "957",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "986",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1015",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1044",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1073",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1102",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1131",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1160",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1189",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1218",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1247",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1276",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1305",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1334",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1363",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1392",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1421",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1450",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1479",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1508",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1537",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1566",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1595",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1624",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1653",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1682",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1711",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1740",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1769",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1798",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1827",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1856",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1885",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1914",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1943",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "1972",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "2001",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "2030",tag: advertisingTag.replace( new RegExp( "preroll", "gi" ), "midroll" )//tag: advertisingTag},{offset: "2059",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(adConfig.debug)console.log('JW', 'setupPlayerGeoWrapper()');jwplayer("video-8B7F3A21-8968-4BE4-9361A3721CF10E5D").setup(config).on('play',function(event){if(adConfig.debug)console.log('JW', 'play', event);//play actually happens after video pre roll.//dataLayer.push({"event":"Video Play"});//legacyif(event.playReason === "interaction")videoDataLayerPush('Play');else if(event.playReason === "external")videoDataLayerPush('AutoPlay');}).on('ready',function(event) {if(adConfig.debug)console.log('JW', 'onReady');//if(adConfig.debug)console.log('JW', 'onReady calling playSpotXAd()');//playSpotXAd(jwplayer("video-8B7F3A21-8968-4BE4-9361A3721CF10E5D"));}).on('viewable',function(event) {if(adConfig.debug)console.log('JW', 'viewable', event);/*if(Device.isMobile){var state = jwplayer("video-8B7F3A21-8968-4BE4-9361A3721CF10E5D").getState();if( 'viewable' in event)if(event.viewable==1 && (state == 'playing' || state == 'buffering') ){jwplayer("video-8B7F3A21-8968-4BE4-9361A3721CF10E5D").stop();if(adConfig.debug)console.log('JW', 'viewable', 'stopping');}else if(event.viewable==0 && (state == 'paused') ){jwplayer("video-8B7F3A21-8968-4BE4-9361A3721CF10E5D").play();if(adConfig.debug)console.log('JW', 'viewable', 'starting');}}*/}).on('pause',function(event) {if(adConfig.debug)console.log('JW', 'onPause');videoDataLayerPush('Pause');}).on('complete',function(event){if(adConfig.debug)console.log('JW', 'onComplete');//dataLayer.push({"event":"Video Complete"});//legacy}).on('firstFrame', function(event) {if(adConfig.debug)console.log('JW', 'firstFrame');}).on('fullscreen', function(event) {}).on('adError', function(event){console.log('JW', 'adError', event);//jwplayer("video-8B7F3A21-8968-4BE4-9361A3721CF10E5D").stop();//dont auto play if no ad}).on('adRequest', function(event){if(adConfig.debug)console.log('JW', 'adRequest', event);}).on('adBlock',function(event){//only fires on being blockedif(adConfig.debug)console.log('JW', 'adBlock', event);}).on('adPlay', function(event){if(adConfig.debug)console.log('JW', 'adPlay', event);videoDataLayerPush('Ad Start');}).on('adComplete', function(event){if(adConfig.debug)console.log('JW', 'adComplete', event);videoDataLayerPush('Ad Complete');}).on('time', function(event){//if(adConfig.debug)console.log('JW', 'time', event);//work out percentvar percent = Math.ceil((event.position/event.duration)*100);gaVideoData.percentWatched=percent});//onif(adConfig.debug)console.log('JW','jwplayer setup called for video-8B7F3A21-8968-4BE4-9361A3721CF10E5D', setupStruct);/*if (window.Device.isMobile) {jwplayer().setVolume(100);}*/setTimeout(function(){if(adConfig.debug)console.log('JW','setTimeout() playing autoplay video with id','3782076');if(jwplayer("video-8B7F3A21-8968-4BE4-9361A3721CF10E5D").getState() === 'idle')jwplayer("video-8B7F3A21-8968-4BE4-9361A3721CF10E5D").play();//calling play if playing toggles it}, 1000);}//setupPlayerGeoWrapper//if floating but it should be only uk for certain sites then disableif('floating' in setupStruct){var floatUKOnly = true;if(adConfig.debug)console.log('JW','floatUKOnly',floatUKOnly);if(floatUKOnly)window.$geoLocationDef.done(function(){if(!$('html').is('.geo-gb')){//not ukdelete setupStruct.floating;if(adConfig.debug)console.log('JW deleting float property',setupStruct);setupPlayerGeoWrapper(setupStruct);}else{setupPlayerGeoWrapper(setupStruct);}});//doneelse{setupPlayerGeoWrapper(setupStruct);}}else{setupPlayerGeoWrapper(setupStruct);}//if//if(adConfig.debug)console.log('JW SpotX addSpotXParamsToMVT then() returning');}//setupFunctionvar handleIndexExchange = function(mvt){var indexCallback = function (updatedMVT, indexTargeting) {if(adConfig.debug)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 valuemvt = mvt.replace('&cust_params=','&cust_params='+custParams);if(adConfig.debug)console.log('JW','indexCallback() amended mvt',mvt);}mvt = mvt+'&indexx=1';};//func//if(adConfig.debug)console.log('JW Post Index X integration, indexXPublisherConfig',indexXPublisherConfig);window.getVideoAds(mvt, indexCallback, undefined, indexXPublisherConfig);//wait for 1 sec for index x to returnsetTimeout(function(){setupFunction(mvt);},1000);};// define a function to handle the video bid then request the video tag URLfunction handleVideoBid(videoBid, vastTagURL) {/*if(adConfig.debug)*/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(adConfig.debug)console.log('JW amazon handleVideoBid() videoBid:',videoBid);if (videoBid) {// add the encoded query string params to the scp param on the vastTagURLvastTagURL += '&scp=' + videoBid.encodedQsParams;}return vastTagURL;}//funcfunction goAmazonGo(){apstag.fetchBids({slots: [{slotID: 'videoSlot', // NOTE: doesn't need to be the div IDmediaType: 'video'}]}, function(bids) {advertisingTag = handleVideoBid(bids, advertisingTag);//if(adConfig.debug)console.log('JW amazon post amazon bid, advertisingTag=',advertisingTag);directAdOS.addSpotXParamsToMVT(advertisingTag).then(handleIndexExchange);});}//func__cmp('getConsentData', null, function(data, success){if(adConfig.debug)console.log('GDPR JW amazon video cmp return',data.consentData);goAmazonGo();});});//googletag.cmd.push};//embedVideo})(typeof require !== 'undefined' ? require : idguk.require);

Read the original post:
How to test a MacBook battery: see if it needs replacing & replace it - Macworld UK

Related Posts
February 14, 2020 at 9:45 am by Mr HomeBuilder
Category: Window Replacement