c28f4f5618b0646cc233ae40cd9b10caeea8fe85993a855db0fd23e68b64995f

Source Code:

var PlayerWidgetCommonMethods=function(){"use strict";var i=!1;return{pingVCS:function(t){t&&setTimeout(function(){var e;i||(i=!0,(e=new XMLHttpRequest).open("GET",t),e.send())},5e3)},getKeys:function(e){var t,i=[];for(t in e)e.hasOwnProperty(t)&&i.push(t);return i},prettyTime:function(e){var t=parseInt(e,10),i=Math.floor(t/3600),r=Math.floor((t-3600*i)/60),a=t-3600*i-60*r;return i<10&&(i="0"+i),r<10&&(r="0"+r),a<10&&(a="0"+a),(0<parseInt(i)?i+":":"")+r+":"+a}}}(),VueVideoCustomElement=function(){"use strict";return{initializePlayer:function(){Vue.customElement("video-element",{props:["platform","uniqueId","dataAttributes"],data:function(){return{premiumFlag:"undefined"!=typeof premiumFlag&&premiumFlag,videoPlaceholder:document.getElementById("videoPlayerPlaceholder"),urlParams:this.getUrlVars(),hasPingedVcServer:!1,isVideo3x4:!1,prePlayerInitTime:null,isPlaylist:"undefined"!=typeof VIDEO_SHOW&&Array.isArray(VIDEO_SHOW.buildPlaylistItems)}},methods:{getUrlVars:function(){var r={};window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,t,i){r[t]=i});return r},chargePbBlock:function(){var e=document.getElementById("pb_template");e&&document.querySelector(".mhp1138_container").appendChild(e)},togglePlayerSizeHD:function(){/chrome\/([6][9])\./.test(navigator.userAgent.toLowerCase())&&setTimeout(function(){page_params.chrome_69_bandaid={iframes:[]},$j("iframe").each(function(){page_params.chrome_69_bandaid.iframes.push({element:$j(this),h:$j(this).height()})});for(var e=0;e<page_params.chrome_69_bandaid.iframes.length;e++){var t=page_params.chrome_69_bandaid.iframes[e];t.element.height(t.h+1),t.element.height(),t.element.height(t.h)}},300);var e=document.querySelector(".mainPlayerDiv"),t=document.querySelector(".playerFlvContainer"),i=document.getElementById("hd-rightColVideoPage"),r=(r=[e,t,i]).filter(function(e){return null!=e});MG_Utils.hasClass(e,"original")?(MG_Utils.addClassMultiple(r,"wide"),MG_Utils.removeClassMultiple(r,"original")):(MG_Utils.addClassMultiple(r,"original"),MG_Utils.removeClassMultiple(r,"wide")),i&&MG_Utils.hasClass(i,"videoSize3x4")&&(i&&MG_Utils.hasClass(i,"wide")?this.resizeVerticalVideo():i.style.marginTop="0px")},resizeVerticalVideo:function(){var e=document.querySelector(".mainPlayerDiv"),t=document.querySelector("#hd-rightColVideoPage.videoSize3x4"),i=e?e.querySelector("video"):null,r=document.getElementById("hd-rightColVideoPage"),a=0,o=window.innerHeight-200;i&&r&&(e.classList.add("videoSize3x4"),r.classList.add("videoSize3x4"),(a=i.videoWidth>i.videoHeight?i.videoWidth/i.videoHeight:i.videoHeight/i.videoWidth)&&(e.style.width="540px",e.style.height=540*a+"px",e.style.maxHeight=o+"px",t&&MG_Utils.hasClass(r,"wide")&&(t.style.marginTop=o+"px")))},destroyPlayer:function(t){MG_Utils.addEventHandler(window,"beforeunload",function(e){MHP1138.destroyPlayer(t)})},disablePopOnControls:function(){var e=document.querySelector(".mhp1138_controlBar"),t=document.querySelector(".mhp1138_sound");e&&t&&(MG_Utils.addClass(e,"js-pop"),MG_Utils.addClass(t,"js-pop"))},triggerFullScreenDisplay:function(e){var t=document.getElementById(e);t&&MG_Utils.addClass(t,"fullscreen")},getUpsellFlag:function(e){return this.isVrVideo?e&&!this.isPremium?[2160]:[]:e?[1080]:[]},getUpsellLinkcode:function(e){return!!e&&"Player"+e+"pUpsell"},showPreroll:function(e){return void 0!==e&&void 0!==page_params.holiday_promo&&!this.isVrVideo},nextVideoBtnConfig:function(e){if(0===Object.keys(e).length)return{};var t={thumb:e.thumb,video:e.video,duration:e.duration,title:e.title,isHD:e.isHD,nextUrl:e.nextUrl};return"mobile"!=this.platform||this.isPlaylist||(t.mobile=!0,t.chanel=e.channelTitle||"",t.timeout=5),e.isJoinPageEntry&&"undefined"!=typeof VIDEO_SHOW&&MG_Utils.ajaxCall({type:"GET",url:VIDEO_SHOW.getBuildJoinPageUrl,data:{entry_code:"VidPg-premVid-default",segment:VIDEO_SHOW.segment,viewkey:e.vkey},dataType:"json",success:function(e){"PASS"==e.success&&e.url&&(t.nextUrl=e.url)}}),t},buildPrerollObj:function(e){var i,r=[];return this.showPreroll(e)&&(i={},[].forEach.call(e.campaigns,function(e){var t={};e.clickableAreasByPlatform&&(t=e.clickableAreasByPlatform.pc?e.clickableAreasByPlatform.pc:{video:!0,link:!0}),i={xml:e.vastXml,vastSkipDelay:!1,rollSettings:{onNth:e.on_nth,skipDelay:e.skip_delay,siteName:"Pornhub",forgetUserAfter:e.forgetUserAfter,campaignName:e.campaign_name,skippable:e.skippable,clickableAreas:t,campaignWeight:e.percentChance}},r.push(i)})),r},registerPlayerEvents:function(o){var n=this,a=o.vcServerUrl||null;return{collapsePlayer:function(){n.togglePlayerSizeHD()},downloadsFlashMessage:function(e){document.getElementById("noPlayerMsg").removeAttribute("style")},expandPlayer:function(){n.togglePlayerSizeHD()},hideRoll:function(){"undefined"!=typeof trailerPauseRoleInstance?trailerPauseRoleInstance.closeAdBlock():"undefined"!=typeof Pb_block&&Pb_block.closeAdBlock()},onSeek:function(){"undefined"!=typeof htTrack&&htTrack.ptrack()},onReady:function(e,t,i){var r,a;"function"==typeof initVrPlayer&&initVrPlayer(),n.isShowPage&&n.chargePbBlock(),n.disablePopOnControls(),"undefined"!=typeof bitmovin&&(r=MHP1138.players[e],(a={videoElement:i.element.querySelector("video"),videoId:e?e.split("_").pop():"",title:o.video_title,cdn:o.cdn,enableDebug:o.enableBitmovinDebug,vkey:n.getVideoKey,playerType:i.playerType,siteName:n.isPremium?"Pornhubpremium":"Pornhub",version:MHP1138.appVersion,adaptivePlayer:void 0!==r.getAdaptivePlayer?r.getAdaptivePlayer():null,experimentId:o.experimentId}).videoElement&&a.videoId&&n.setBitmovin(a))},onFullscreen:function(e){n.isShowPage&&n.triggerFullScreenDisplay(e)},onQualityUpsell:function(e,t,i){var r=n.getUpsellLinkcode(i.resolution);r&&("mobile"==n.platform?triggerGatewayModal(t,o.skipGatewayModal,r,phOrientationSegment):triggerUpselllGatewayModal(r,phOrientationSegment)),MHP1138.players[e].fullscreen().exit()},showPauseRoll:function(){"undefined"!=typeof trailerPauseRoleInstance?trailerPauseRoleInstance.openAdBlock():"undefined"!=typeof Pb_block&&Pb_block.openAdBlock()},showPostRoll:function(){"undefined"!=typeof Pb_block&&(Pb_block.params.showBlock=!0,Pb_block.openAdBlock())},showPreRoll:function(){var e,t,i=i||("undefined"!=typeof page_extra_params?page_extra_params:null);if(i&&(i.prerollFired=!0,n.isShowPage))for(var r in i.zoneDetails){i.zoneDetails.hasOwnProperty(r)&&(e=i.zoneDetails[r],t=document.getElementById(e.frameId),void 0!==e.preroll_change_url&&t&&t.setAttribute("src",e.preroll_change_url))}},onPlaylistCountdown:function(e,t,i){"undefined"!=typeof varObj&&1==parseInt(varObj.dataMainContainer.data("playlist-check"))&&playlist_countdown(i.count)},onPlay:function(e,t,i){var r;"undefined"!=typeof VIDEO_SHOW&&VIDEO_SHOW.isQrCode&&VIDEO_SHOW.feelIsUserConnected&&(r=document.getElementById(e).querySelector("video").currentTime,$feel.subs.play(r)),n.isVideo3x4&&(n.resizeVerticalVideo(),window.addEventListener("resize",function(){n.resizeVerticalVideo()}),n.isVideo3x4=!1),PlayerWidgetCommonMethods.pingVCS(a)},onPause:function(){"undefined"!=typeof VIDEO_SHOW&&VIDEO_SHOW.isQrCode&&VIDEO_SHOW.feelIsUserConnected&&$feel.subs.stop()},onTimeChange:function(e){var t;"undefined"!=typeof VIDEO_SHOW&&VIDEO_SHOW.isQrCode&&VIDEO_SHOW.feelIsUserConnected&&(t=document.getElementById(e).querySelector("video").currentTime,$feel.subs.timeupdate(t))},onVrError:function(){"mobile"==n.platform?document.getElementById("vrFallback").style.display="block":alert("This feature is not supported on your current browser!")}}},getPlayerConfig:function(e,t){var i=void 0!==t.tubesCmsPrerollConfigType?t.tubesCmsPrerollConfigType:null;return{seekParams:{mp4:t.mp4_seek,flv:"fv"},deviceType:this.platform,autoPlayVideo:{enabler:!1},quickSetup:"pornhub",locale:t.language,autoplay:!(!this.isShowPage||!this.isUtahDomain||"desktop"!=this.platform)&&t.autoplay,startOffset:this.urlParams.t?this.urlParams.t:0,errorReports:t.errorReports,viewedRequestTimeout:60,viewedRequestURL:t.viewedRequestURL,hotspots:{data:t.hotspots?t.hotspots:[]},nextVideo:this.parseData.showNextVideoOption?this.nextVideoBtnConfig(t.nextVideo):{},mainRoll:{adaptive:{prebufferGoal:40},actionTags:t.actionTags,mediaPriority:"hls",mediaDefinition:t.mediaDefinitions,poster:t.image_url,thumbs:{urlPattern:t.thumbs.urlPattern,type:"normal",samplingFrequency:t.thumbs.samplingFrequency,thumbWidth:t.thumbs.thumbWidth,thumbHeight:t.thumbs.thumbHeight,cdnType:t.thumbs.cdnType},videoUrl:t.link_url,duration:t.video_duration,title:t.video_title,videoUnavailable:!1,videoUnavailableMessage:"",qualityUpsell:this.getUpsellFlag(t.display_hd_upsell),closedCaptions:t.closedCaptionsFile,vertical:"true"==t.isVertical||!0===t.isVertical},hlsConfig:{maxInitialBufferLength:t.maxInitialBufferLength,maxBufferLength:this.isPremium?60:20,maxMaxBufferLength:this.isPremium?60:20},menu:{relatedUrl:t.related_url,showOnPause:!1},features:{themeColor:"#f6921e",embedCode:t.embedCode,autoplay:!(!this.isShowPage||!this.isUtahDomain||"desktop"!=this.platform)&&t.autoplay,showHotspots:!0,cinema:!!e.getAttribute("data-enlarge"),ignorePreferences:!this.isShowPage||!this.isUtahDomain,iosAutoFullscreen:"mobile"==this.platform,options:!0,showAutoplayOption:!!e.getAttribute("data-showautoplayoption"),hideControlsTimeout:2,speed:!0,nextVideo:!0,share:!1,topBar:!1,volume:!0,seekPreviewBlur:!1},flashSettings:{postRollUrl:this.isPremium?"":t.postroll_url,pauseRollUrl:this.isPremium?"":t.pauseroll_url,htmlPauseRoll:this.isPremium?"false":"true",htmlPostRoll:this.isPremium?"false":"true",extraFlashvars:{oldFlash:{hidePostPauseRoll:this.isPremium},fourPlay:{tracking:[{reportType:"qosevents",rollType:"video",rollTiming:"main",cdn:t.cdn,startLagThreshold:t.startLagThreshold,outBufferLagThreshold:t.outBufferLagThreshold}]}}},eventTracking:{cdn:t.cdn,isp:t.isp,geo:t.geo,enabled:!0,videoId:this.getVideoKey},events:this.registerPlayerEvents.call(this,t),vast:"old"==i?this.buildPrerollObj(t.preroll):null,preroll:"new"!=i&&void 0!==t.preroll||this.isVrVideo?null:t.prerollGlobalConfig,isVideoPage:this.isShowPage,vrProps:this.getVrProps,isVr:this.isVrVideo}},loadPlayer:function(){var e,t,i,r,a;playerObjList.hasOwnProperty(this.uniqueId)&&(e=playerObjList[this.uniqueId].flashvars.embedId,t=window["flashvars_"+e],i="playerDiv_"+e,r=window[i],a=document.getElementById(i),void 0!==t&&void 0!==r&&(r.getAttribute("data-processed")||(r.setAttribute("data-processed",1),this.isSafari5&&a&&MG_Utils.addClass(a,"unsupported-safari"),MHP1138.createPlayer(i,this.getPlayerConfig.call(this,r,t))),"desktop"===this.platform&&this.destroyPlayer(i)))},setBitmovin:function(e){var t={key:"a4a8f3f3-c2fa-4e49-8b12-4a41b2fe3b4d",config:{backendUrl:"https://analytics-ingress.pandorastreaming.com/"},videoId:e.vkey,title:e.title,cdnProvider:e.cdn,customData1:e.vkey,customData2:e.playerType,customData3:e.version,customData4:e.siteName,customData5:e.experimentId};e.enableDebug&&(t.debug=!0),this.registerPlayer(e,t)},registerPlayer:function(e,t){try{e.adaptivePlayer&&"hls"===e.adaptivePlayer.name?new bitmovin.analytics.HlsAdapter(t,e.adaptivePlayer.player,{starttime:this.prePlayerInitTime}):new bitmovin.analytics.adapters.HTMLVideoElementAdapter(t,e.videoElement)}catch(e){console.log(e)}}},computed:{parseData:function(){return this.dataAttributes?JSON.parse(this.dataAttributes):null},playerEnvironment:function(){return"undefined"!=typeof playerEnvironment?playerEnvironment:""},getVideoKey:function(){return"undefined"!=typeof VIDEO_SHOW?VIDEO_SHOW.vkey:""},isSafari5:function(){return!!navigator.userAgent.match(" Safari/")&&!navigator.userAgent.match(" Chrom")&&!!navigator.userAgent.match(" Version/5.")},isPremium:function(){return 1==this.premiumFlag},isShowPage:function(){return"undefined"!=typeof isShowPage},isUtahDomain:function(){return"undefined"==typeof isUtah||!isUtah},isVrVideo:function(){return"undefined"!=typeof isVr&&isVr},getVrProps:function(){return"undefined"!=typeof vrProps?vrProps:""}},mounted:function(){this.videoPlaceholder&&(this.videoPlaceholder.style.display="block");var e=this;this.prePlayerInitTime=(new Date).getTime(),setTimeout(function(){e.loadPlayer()},0)},template:'<div :id="uniqueId"class="playerFlvContainer" :data-enlarge="parseData ? parseData.showEnlargeButton : null":data-showautoplayoption="parseData ? parseData.showAutoplayOption : null" :data-share="parseData ? parseData.showShare : null" :data-shownextvideooption="parseData ? parseData.showNextVideoOption : null"><noscript><video style="width:100%; height:100%;" controls="controls" autobuffer="autobuffer" class="player-html5" preload="metadata"><source src="" type="video/mp4"></video></noscript><div id="noPlayerMsg" style="display:none"><a href="http://get.adobe.com/flashplayer/" rel=nofollow alt="Porn Video flash Player" border="0"><img src="" width="608" height="481" /></a></div></div>'})}}}(),VrFormatFinder=function(){"use strict";return{setVrFormat:function(e){var t,i;e&&(i=function(e,t,i){var r=new RegExp("([?&])"+e+"=.*?(&|#|$)","i");if(void 0===t)return i.match(r)?i.replace(r,"$1$2"):i;if(i.match(r))return i.replace(r,"$1"+e+"="+t+"$2");var a="";-1!==i.indexOf("#")&&(a=i.replace(/.*#/,"#"),i=i.replace(/#.*/,""));var o=-1!==i.indexOf("?")?"&":"?";return i+o+e+"="+t+a}("format",t=function(e,t){var i;switch(t){case 1:i=2==e?"STEREO_360_LR":"STEREO_180_LR";break;case 2:i=2==e?"STEREO_360_TB":"STEREO_180_TB";break;case 3:i=2==e?"STEREO_360_LR":"STEREO_FLAT_LR";break;case 4:i=2==e?"STEREO_360_TB":"STEREO_FLAT_TB";break;case"MONO":i=1==e?"MONO_FLAT":"MONO_360";break;default:i="MONO_360"}return i}(vrProps.projection,vrProps.stereoType),e.getAttribute("cors-fallback-url")),e.setAttribute("format",t),e.setAttribute("cors-fallback-url",i))},pingVcsHandler:function(e){var t,i,r;e&&(t=PlayerWidgetCommonMethods.getKeys(playerObjList),i=playerObjList[t[0]].flashvars.embedId,r=window["flashvars_"+i].vcServerUrl||null,e.addEventListener("play",function(e){PlayerWidgetCommonMethods.pingVCS(r)}))}}}();!function(){var e=document.getElementById("videoPlayerPlaceholder"),t=document.querySelector("dl8-video");"undefined"!=typeof VIDEO_SHOW&&VIDEO_SHOW.isVr&&t?(e&&(e.style.display="block"),VrFormatFinder.setVrFormat(t),VIDEO_SHOW.isPremium||VrFormatFinder.pingVcsHandler(t)):VueVideoCustomElement.initializePlayer()}();