true : false ); var showPlayButtonOverlay = 1; var endInterval = 0; if(isiOS || isAndroid)isMobile_0_2 = true; if(isAndroid && autocheck){ var enablePlayerControls = '1';var enableMutingControls = '1';var enableFullscreenControls = '';var autoHideFullscreenControls = '0';var fullscreenIconColor = 'light';var playerControlsPosition = 'Bottom Left';var mutingControlsPosition = 'Top Left';var fullscreenControlsPosition = 'Bottom Right';$("#customplayerwrapper-0-2").empty(); player_0_2 = new OGVPlayer(); document.getElementById("customplayerwrapper-0-2").appendChild(player_0_2); player_0_2.id = "ogv_video_0_2"; player_0_2.width = 300; player_0_2.height = 250; player_element_0_2 = player_0_2; player_0_2.src = 'http://video.adventivecdn.com/168/3c1567c2-1650-4c4d-b265-0db3d59a0359_300.ogv'; player_0_2.muted = true; setTimeout(function(){ player_0_2.play(); playing_0_2 = true; /* Set up the loading animation */ player_0_2_loadingImage.src = "http://assets.adventivecdn.com/ui/js/adventive/mediaelement/build/loading.gif"; player_0_2_loadingImage.onload = function() { var natHeight = Math.floor(player_0_2_loadingImage.height); var natWidth = Math.floor(player_0_2_loadingImage.width); player_0_2_loadingImage.style.marginTop = parseInt((0 - natHeight)/2) +"px"; player_0_2_loadingImage.style.marginLeft = parseInt((0 - natWidth)/2) +"px"; player_0_2_loadingImage.style.left = "50%"; player_0_2_loadingImage.style.top = "50%"; player_0_2_loadingImage.style.position = "absolute"; player_0_2_loadingImage.style.zIndex = 11; document.getElementById("customplayerwrapper-0-2").appendChild(player_0_2_loadingImage); }; },autoplayDelay_0_2); muted_0_2 = player_0_2.muted; /* Set up the preview image */ player_0_2_previewImage.src = "http://assets.adventivecdn.com/168/e5a3545b-e7ae-4153-81cd-38ccb841f76d"; player_0_2_previewImage.onload = function() { var natHeight = Math.floor(player_0_2_previewImage.height); var natWidth = Math.floor(player_0_2_previewImage.width); /* Calculate the new dimensions both ways maintaining aspect ratio */ var check1W = Math.floor(300); var check1H = Math.floor((natHeight*300)/natWidth); var check2H = Math.floor(250); var check2W = Math.floor((natWidth*250)/natHeight); /* Pick the appropriate scaling */ if ((check1W >= 300) && (check1H >= 250)) { player_0_2_previewImage.style.width = check2W + "px"; player_0_2_previewImage.style.height = check2H + "px"; player_0_2_previewImage.style.top = 0; player_0_2_previewImage.style.left = parseInt((300 -check2W)/2) +"px"; } else { player_0_2_previewImage.style.width = check1W + "px"; player_0_2_previewImage.style.height = check1H + "px"; player_0_2_previewImage.style.top = parseInt((250 - check1H)/2) +"px"; player_0_2_previewImage.style.left = 0; } player_0_2_previewImage.style.position = "absolute"; player_0_2_previewImage.style.zIndex = 10; var cWrapper = document.getElementById("customplayerwrapper-0-2"); cWrapper.style.height = player_0_2_previewImage.style.height; cWrapper.style.width = player_0_2_previewImage.style.width; cWrapper.style.top = player_0_2_previewImage.style.top; cWrapper.style.left = player_0_2_previewImage.style.left; cWrapper.style.position = "absolute"; player_0_2_previewImage.style.top = 0; player_0_2_previewImage.style.left = 0; cWrapper.appendChild(player_0_2_previewImage); player_0_2.style.height = player_0_2_previewImage.style.height; player_0_2.style.width = player_0_2_previewImage.style.width; player_0_2.style.top = player_0_2_previewImage.style.top; player_0_2.style.left = player_0_2_previewImage.style.left; }; if(0 > 0){ endTime = 0; endTime_0_2 = endTime; } player_0_2.addEventListener('loadedmetadata', function(event){ player_ready_0_2 = true; console.log("metadata loaded"); var scaleX = parseInt(parseInt("300px"))/300; var scaleY = parseInt(parseInt("250px"))/250; var scale = 1; if(scaleX >= scaleY) scale = scaleY; else scale = scaleX; if(scale > 1) scale=1; if(scale < 0.3) scale = 0.3; if(endTime_0_2 == 0) endTime_0_2 = player_0_2.duration; console.log("before videoCallback"); setTimeout(function(){ parent.window.ns_4_32236_oy141224.videoCallback(); console.log("firing videoCallback"); }, 1000); /* Play button */ if(showPlayButtonOverlay){ playButtonDiv = document.createElement('div'); $('#customplayerwrapper-0-2').append(playButtonDiv); playButtonDiv.id = 'playButtonDiv-0-2'; playButtonDiv.style.opacity = 0; playButtonDiv.style.zIndex = 100; playButtonDiv.addEventListener('click',function(event){ if(playing_0_2){ logTPTracking_0_2('Pause'); player_0_2.pause(); playing_0_2 = false; }else{ logTPTracking_0_2('Play'); playing_0_2 = true; if(Math.floor(player_0_2.currentTime) >= Math.floor(endTime_0_2)){ dontLogPlay_0_2 = true; cvLog_0_2('replay_video_click', Math.floor(player_0_2.currentTime), event); if(!$("#native_video_0_2").length){ launchNativePlayer_0_2("playback"); }else{ if( Math.floor(endTime_0_2) < Math.floor(player_0_2.duration)){ player_0_2.currentTime = 0; } player_0_2.play(); } }else{ player_0_2.play(); } toggleReplay_0_2(showReplay, "dark", 'remove'); } toggleChromelessPlay_0_2(); }); var playHeightB = 3 * (1/scale); var margin = playHeightB; $('#playButtonDiv-0-2').css("-ms-transform", "scale("+scale+","+scale+")"); $('#playButtonDiv-0-2').css("-webkit-transform", "scale("+scale+","+scale+")"); $('#playButtonDiv-0-2').css("transform", "scale("+scale+","+scale+")"); var playButton = $(playButtonDiv); playButton.addClass('mejs-overlay-button'); autoWait_0 = false; screenViewed[0] = 0; for(i=0; i < autoEvents_0.length; i++){ var variables = autoEvents_0[i]; checkAutoEvents(variables[0], variables[1], variables[2], variables[3], variables[4], variables[5], variables[6], variables[7], variables[8], variables[9]); } if(autoEvents_0.length == 0){ screenViewed[0] = 1; } } nativeWidth_0_2 = '1280'; nativeHeight_0_2 = '720'; widthDiv_0_2 = parseInt('300px')/nativeWidth_0_2; heightDiv_0_2 = parseInt('250px')/nativeHeight_0_2; $('#customplayerwrapper-0-2').css('position', "absolute"); if(widthDiv_0_2 < heightDiv_0_2) { controlOffset_0_2 = parseInt('300px')/nativeWidth_0_2; chromelessOffset_0_2 = (parseInt('250px') - (nativeHeight_0_2*controlOffset_0_2))/2; $('#customplayer-0-2').attr('height', parseInt(nativeHeight_0_2*(parseInt('300px')/nativeWidth_0_2)) + "px"); $('#customplayer-0-2').css('position', 'absolute'); $('#customplayerwrapper-0-2').css('top', chromelessOffset_0_2+"px"); } else{ controlOffset_0_2 = parseInt('250px')/nativeHeight_0_2; chromelessOffset_0_2 = (parseInt('300px') - (nativeWidth_0_2 *controlOffset_0_2))/2; $('#customplayer-0-2').attr('width', parseInt(nativeWidth_0_2*(parseInt('250px')/nativeHeight_0_2)) + "px"); $('#customplayer-0-2').css('position', 'absolute'); $('#customplayerwrapper-0-2').css('left', chromelessOffset_0_2+"px"); } var playerIconColor = 'light'; var chromeLessPlayerControls = document.createElement('div'); $('#customplayerwrapper-0-2').prepend(chromeLessPlayerControls); chromeLessPlayerControls.id = 'chromeLessPlayerControls-0-2'; var playEle = $(chromeLessPlayerControls); playEle.css('display', 'none'); var hidePlayButton = setInterval(function() { if(chromelessOffset_0_2 != undefined) { setTimeout(function() { playEle.css('display','block'); clearInterval(hidePlayButton); },500); } },100); playEle.addClass('chromeLessPlayerControls'); playEle.css('zIndex','100'); var playImage = document.createElement('img'); playImage.setAttribute('id','customPlayButtonImage-0-2'); $(chromeLessPlayerControls).append(playImage); $(playImage).css('display', 'none'); if(playerControlIconStyle_0_2.toUpperCase()=='CUSTOM'){ playImage.setAttribute('src',customPlayIconSrc); $(playImage).css('display', 'block'); if(customPlayIconWidth && customPlayIconHeight){ $(playImage).css('width', customPlayIconWidth); $(playImage).css('height', customPlayIconHeight); } if(customPlayIconSrc.trim()== '' || typeof customPlayIconSrc == 'undefined'){ } }else{ playEle.addClass(playerIconColor+'Play'); } var vOrigin = '0'; var hOrigin = '0'; if(playerControlIconStyle_0_2.toUpperCase()=='CUSTOM' && (customPlayIconX && customPlayIconY)){ playEle.css('top', parseInt(customPlayIconY) - chromelessOffset_0_2 +"px"); playEle.css('left', customPlayIconX); }else{ if(playerControlsPosition == 'Top Left'){ var intervalPlay_0_2 = setInterval(function() { if(widthDiv_0_2 < heightDiv_0_2) { playEle.css('top', 0 + "px"); playEle.css('left', 0); } else{ playEle.css('left', 0 + "px"); playEle.css('top', 0); } if(chromelessOffset_0_2 != undefined) { clearInterval(intervalPlay_0_2); } },500); }else if(playerControlsPosition == 'Top Right'){ var playShift_0_2 =0; vOrigin = '100%'; if(enableMutingControls && mutingControlsPosition == 'Top Right'){ playShift_0_2 = playShift_0_2 + 48; vOrigin = '200%'; } if(enableFullscreenControls && fullscreenControlsPosition == 'Top Right'){ playShift_0_2 = playShift_0_2 + 48; vOrigin = '200%'; } if(enableMutingControls && enableFullscreenControls){ vOrigin = '300%'; } var intervalPlay_0_2 = setInterval(function() { if(widthDiv_0_2 < heightDiv_0_2) { playEle.css('top', 0 + "px"); playEle.css('right', playShift_0_2 + "px"); } else{ playEle.css('right', 0 + playShift_0_2 + "px"); playEle.css('top', 0); } if(chromelessOffset_0_2 != undefined) { clearInterval(intervalPlay_0_2); } },500); hOrigin = '0'; }else if(playerControlsPosition == 'Bottom Left'){ var intervalPlay_0_2 = setInterval(function() { if(widthDiv_0_2 < heightDiv_0_2) { playEle.css('bottom', 0 + "px"); playEle.css('left', 0); } else{ playEle.css('left', 0 + "px"); playEle.css('bottom', 0); } if(chromelessOffset_0_2 != undefined) { clearInterval(intervalPlay_0_2); } },500); vOrigin = '0'; hOrigin = '100%'; }else if(playerControlsPosition == 'Bottom Right'){ vOrigin = '100%'; hOrigin = '100%'; var playShift_0_2 = 0; if(enableMutingControls && mutingControlsPosition == 'Bottom Right'){ playShift_0_2 = playShift_0_2 + 48; vOrigin = '200%'; } if(enableFullscreenControls && fullscreenControlsPosition == 'Bottom Right'){ playShift_0_2 = playShift_0_2 + 48; vOrigin = '200%'; } if(enableMutingControls && enableFullscreenControls){ vOrigin = '300%'; } var intervalPlay_0_2 = setInterval(function() { if(widthDiv_0_2 < heightDiv_0_2) { playEle.css('bottom', 0 + "px"); playEle.css('right', playShift_0_2 + "px"); } else{ playEle.css('right', 0 + playShift_0_2 + "px"); playEle.css('bottom', 0); } if(chromelessOffset_0_2 != undefined) { clearInterval(intervalPlay_0_2); } },500); } } $(playEle).css('cursor','pointer'); $(playEle).click(function(event){ if(playing_0_2){ logTPTracking_0_2('Pause'); player_0_2.pause(); playing_0_2 = false; }else{ logTPTracking_0_2('Play'); playing_0_2 = true; if(Math.floor(player_0_2.currentTime) >= Math.floor(endTime_0_2)){ dontLogPlay_0_2 = true; cvLog_0_2('replay_video_click', Math.floor(player_0_2.currentTime), event); if(!$("#native_video_0_2").length){ launchNativePlayer_0_2("playback"); }else{ if( Math.floor(endTime_0_2) < Math.floor(player_0_2.duration)){ player_0_2.currentTime = 0; } player_0_2.play(); } }else{ player_0_2.play(); } toggleReplay_0_2(showReplay, "dark", 'remove'); } toggleChromelessPlay_0_2(); }); playEle.css("-ms-transform-origin", (vOrigin+' '+hOrigin)); playEle.css("-webkit-transform-origin", (vOrigin+' '+hOrigin)); playEle.css("transform-origin", (vOrigin+' '+hOrigin)); playEle.css("-ms-transform", "scale("+scale+","+scale+")"); playEle.css("-webkit-transform", "scale("+scale+","+scale+")"); playEle.css("transform", "scale("+scale+","+scale+")"); toggleChromelessPlay_0_2(true); var chromeLessMute = document.createElement('div'); $('#customplayerwrapper-0-2').prepend(chromeLessMute); chromeLessMute.id = 'chromeLessMute-0-2'; var iconColor = 'light'; var muteEle = $(chromeLessMute); muteEle.css('display', 'none'); var hideMuteButton = setInterval(function() { if(chromelessOffset_0_2 != undefined) { setTimeout(function() { muteEle.css('display','block'); clearInterval(hideMuteButton); },500); } },100); muteEle.addClass('chromeLessControls'); muteEle.css('zIndex','100'); var muteImage = document.createElement('img'); muteImage.setAttribute('id','customMuteButtonImage-0-2'); $(chromeLessMute).append(muteImage); $(muteImage).css('display', 'none'); if(muteIconStyle_0_2.toUpperCase()=='CUSTOM'){ $(muteImage).attr('src',customMuteIconSrc); $(muteImage).css('display', 'block'); if(customMuteIconWidth && customMuteIconHeight){ $(muteImage).css('width', customMuteIconWidth); $(muteImage).css('height', customMuteIconHeight); } if (customMuteIconSrc.trim() == '' || typeof customMuteIconSrc == 'undefined'){ $(muteImage).attr('src',eval(iconColor+'DefaultMuteButtonSrc')); } }else{ muteEle.addClass(iconColor+'Mute'); } vOrigin = '0'; hOrigin = '0'; if(muteIconStyle_0_2.toUpperCase()=='CUSTOM' && (customMuteIconX && customMuteIconY)){ muteEle.css('top', parseInt(customMuteIconY) - chromelessOffset_0_2 +"px"); muteEle.css('left', customMuteIconX); }else{ if(mutingControlsPosition == 'Top Left'){ if(enablePlayerControls && playerControlsPosition == 'Top Left'){ vOrigin = '-100%'; muteShift_0_2 = 48; } else{ muteShift_0_2 = 0; } var interval_0_2 = setInterval(function() { if(widthDiv_0_2 < heightDiv_0_2) { muteEle.css('top', 0 + "px"); muteEle.css('left', muteShift_0_2 + "px"); } else{ muteEle.css('left', 0 + muteShift_0_2 + "px"); muteEle.css('top', 0); } if(chromelessOffset_0_2 != undefined) { clearInterval(interval_0_2); } },500); }else if(mutingControlsPosition == 'Top Right'){ vOrigin = '100%'; hOrigin = '100%'; var muteShift_0_2 = 0; if(enableFullscreenControls && fullscreenControlsPosition == 'Top Right'){ muteShift_0_2 = muteShift_0_2 + 48; vOrigin = '200%'; } var interval_0_2 = setInterval(function() { if(widthDiv_0_2 < heightDiv_0_2) { muteEle.css('top', 0 + "px"); muteEle.css('right', muteShift_0_2 + "px"); } else{ muteEle.css('right', muteShift_0_2 + "px"); muteEle.css('top', 0); } if(chromelessOffset_0_2 != undefined) { clearInterval(interval_0_2); } },500); hOrigin = '0'; }else if(mutingControlsPosition == 'Bottom Left'){ var muteShift_0_2 = 0; vOrigin = '0'; if(enablePlayerControls && playerControlsPosition == 'Bottom Left'){ muteShift_0_2 = 48; vOrigin = '-100%'; } var interval_0_2 = setInterval(function() { if(widthDiv_0_2 < heightDiv_0_2) { muteEle.css('bottom', 0 + "px"); muteEle.css('left', muteShift_0_2 + "px"); } else{ muteEle.css('left', 0 + muteShift_0_2 + "px"); muteEle.css('bottom', 0); } if(chromelessOffset_0_2 != undefined) { clearInterval(interval_0_2); } },500); hOrigin = '100%'; }else if(mutingControlsPosition == 'Bottom Right'){ vOrigin = '100%'; hOrigin = '100%'; muteShift_0_2 = 0; if(enableFullscreenControls && fullscreenControlsPosition == 'Bottom Right'){ muteShift_0_2 = muteShift_0_2 + 48; vOrigin = '200%'; } var interval_0_2 = setInterval(function() { if(widthDiv_0_2 < heightDiv_0_2) { muteEle.css('bottom', 0); muteEle.css('right', muteShift_0_2 + "px"); } else{ muteEle.css('right', muteShift_0_2 + "px"); muteEle.css('bottom', 0); } if(chromelessOffset_0_2 != undefined) { clearInterval(interval_0_2); } },500); } } $(muteEle).css('cursor','pointer'); $(muteEle).click(function(event){ if(!muted_0_2){ cvLog_0_2('mute_video_click', Math.floor(player_0_2.currentTime), event); logTPTracking_0_2('Mute'); }else{ cvLog_0_2('unmute_video_click', Math.floor(player_0_2.currentTime), event); logTPTracking_0_2('Unmute'); } function toggleChromelessMute_0_2(){ var muteEle = $('#chromeLessMute-0-2'); var iconColor = 'light'; if(muteEle){ if(muteIconStyle_0_2.toUpperCase()=='CUSTOM'){ muteEle.removeClass(iconColor+'UnMute'); muteEle.removeClass(iconColor+'Mute'); if(player_element_0_2.muted){ if(customMuteIconSrc == '' || typeof customMuteIconSrc == 'undefined'){ $('#customMuteButtonImage-0-2').attr('src',eval(iconColor+'DefaultMuteButtonSrc')); }else{ $('#customMuteButtonImage-0-2').attr('src', customMuteIconSrc); $('#customMuteButtonImage-0-2').css('display', 'block'); } }else{ if(customUnMuteIconSrc == '' || typeof customUnMuteIconSrc == 'undefined'){ $('#customMuteButtonImage-0-2').attr('src',eval(iconColor+'DefaultUnMuteButtonSrc')); }else{ $('#customMuteButtonImage-0-2').attr('src', customUnMuteIconSrc); $('#customMuteButtonImage-0-2').css('display', 'block'); } } }else{ if(player_element_0_2.muted){ muteEle.removeClass(iconColor+'UnMute'); muteEle.addClass(iconColor+'Mute'); }else{ muteEle.removeClass(iconColor+'Mute'); muteEle.addClass(iconColor+'UnMute'); } } } } if(!$("#native_video_0_2").length){ launchNativePlayer_0_2("unmute"); toggleChromelessMute_0_2(); }else{ if(!muted_0_2){ player_0_2.muted = true; muted_0_2 = true; }else{ if(playing_0_2) player_0_2.muted = false; muted_0_2 = false; } toggleChromelessMute_0_2(); } }); muteEle.css("-ms-transform-origin", (vOrigin+' '+hOrigin)); muteEle.css("-webkit-transform-origin", (vOrigin+' '+hOrigin)); muteEle.css("transform-origin", (vOrigin+' '+hOrigin)); muteEle.css("-ms-transform", "scale("+scale+","+scale+")"); muteEle.css("-webkit-transform", "scale("+scale+","+scale+")"); muteEle.css("transform", "scale("+scale+","+scale+")"); if(!autoCheckView_0_2){ var autoEvent = new CustomEvent("AndroidAuto", {}); cvLog_0_2('play_video_auto', Math.floor(player_0_2.currentTime), autoEvent); statLogged_0_2 = 1; logTPTracking_0_2('AutoPlay'); } duration_0_2 = player_0_2.duration; addListeners_0_2(player_0_2); }); }else if(isiOS){ var iosAutoPlay = (autoplayDelay_0_2 > 0) ?
Abandoned Towns For Sale 2022,
Honda Pilot Piston Ring Recall,
Articles B