1var module_70548367863=function(){window.dataLayer=window.dataLayer||[];document.querySelectorAll("video, .video__internal-video video, .video__content video, .video-container video").forEach(videoElement=>{const processedPercentages={};let videoDuration,videoURL;if(videoElement.src)videoURL=videoElement.src;else{const videoSrcElement=videoElement.querySelector("source");videoURL=videoSrcElement?videoSrcElement.src:"unknown-video-url"}const videoTitle=function(videoUrl){const pathSegments=new URL(videoUrl).pathname.split("/"),titleWithPercentEncoding=pathSegments[pathSegments.length-1].split(".")[0];return decodeURIComponent(titleWithPercentEncoding)||"UnknownVideoTitle"}(videoURL);videoElement.addEventListener("play",()=>{videoDuration=videoElement.duration;const currentPlayTime=videoElement.currentTime;!function(videoTitle,videoURL,videoDuration,currentPlayTime){try{dataLayer.push({event:"video",video_action:"play",video_url:videoURL,video_percent:Math.round(currentPlayTime/videoDuration*100),video_title:videoTitle,video_duration:videoDuration})}catch(error){console.log("error in trackVideoPlay",error)}}(videoTitle,videoURL,videoDuration,currentPlayTime)}),videoElement.addEventListener("pause",()=>{videoDuration=videoElement.duration;const currentPlayTime=videoElement.currentTime;!function(videoTitle,videoURL,videoDuration,currentPlayTime){try{dataLayer.push({event:"video",video_action:"pause",video_url:videoURL,video_percent:Math.round(currentPlayTime/videoDuration*100),video_title:videoTitle,video_duration:videoDuration})}catch(error){console.log("error in trackVideoPause",error)}}(videoTitle,videoURL,videoDuration,currentPlayTime)}),videoElement.addEventListener("timeupdate",()=>{videoDuration=videoElement.duration;const currentPlayTime=videoElement.currentTime;!function(videoTitle,videoURL,videoDuration,currentPlayTime,processedPercentages){const playPercentage=Math.round(currentPlayTime/videoDuration*100),checkAndPushData=percentage=>{playPercentage>=percentage-2&&playPercentage<=percentage+2&&!processedPercentages[percentage]&&(dataLayer.push({event:"video",video_action:"progress",video_url:videoURL,video_percent:percentage,video_title:videoTitle,video_duration:videoDuration}),lastPushedPercentage=playPercentage,processedPercentages[percentage]=!0)};try{checkAndPushData(25),checkAndPushData(50),checkAndPushData(75),checkAndPushData(100)}catch(error){console.log("error in trackVideoProgress",error)}}(videoTitle,videoURL,videoDuration,currentPlayTime,processedPercentages)})});const videoHandlers=new Map,videoPlayedState=new Map;function updateVideoListeners(mediaQuery){document.querySelectorAll(".video__content").forEach((container,index)=>{const overlay=container.querySelector(".video__content-overlay"),videoElement=container.querySelector("video"),customPlayButton=overlay?overlay.querySelector(".play-button"):null;if(videoElement&&!videoPlayedState.has(videoElement)&&videoPlayedState.set(videoElement,!1),videoElement&&overlay&&!videoPlayedState.get(videoElement)&&videoElement.removeAttribute("controls"),customPlayButton&&videoElement){videoHandlers.has(customPlayButton)&&customPlayButton.removeEventListener("click",videoHandlers.get(customPlayButton));const handlePlayButtonClick=function(e){e.preventDefault(),e.stopPropagation(),console.log("Found video element:",videoElement),console.log("Video tag name:",videoElement.tagName),videoElement&&"function"==typeof videoElement.play?(videoElement.play(),videoElement.setAttribute("controls","controls"),videoPlayedState.set(videoElement,!0),overlay&&(overlay.style.opacity="0",overlay.style.pointerEvents="none")):console.error("Video element does not have play function")};videoHandlers.set(customPlayButton,handlePlayButtonClick),customPlayButton.addEventListener("click",handlePlayButtonClick),customPlayButton.removeAttribute("href"),customPlayButton.style.cursor="pointer"}mediaQuery.matches&&overlay&&videoElement&&(videoElement.addEventListener("play",function(){overlay.style.opacity="0",overlay.style.pointerEvents="none",videoElement.setAttribute("controls","controls"),videoPlayedState.set(videoElement,!0)}),videoElement.addEventListener("pause",function(){videoPlayedState.get(videoElement)?videoElement.setAttribute("controls","controls"):(overlay.style.opacity="1",overlay.style.pointerEvents="auto",videoElement.removeAttribute("controls"))}))})}const mq=window.matchMedia("(min-width: 410px)");updateVideoListeners(mq),mq.addEventListener("change",updateVideoListeners)}(); 2//# sourceURL=https://26609264.fs1.hubspotusercontent-eu1.net/hubfs/26609264/hub_generated/module_assets/1/70548367863/1788344024258/module_video.js
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.