PageSourceSearch

https://gardner-webb.edu/wp-content/plugins/duracelltomi-google-tag-manager/build/gtm4wp-youtube.js?ver=2.0.2

js gardner-webb.edu collected 2026-09-24 09:23:22 UTC 7,636 bytes, 1 lines download raw bytes

1(()=>{"use strict";function e(e){switch(e){case"play":return"start";case"pause":return"pause";case"buffering":return"buffering";case"ended":return"complete";case"seeked":return"seek";default:return""}}function t({provider:e,status:t,url:r,title:n,currentTime:i,duration:a,percent:o,element:u}){const d=Number(a)||0,c=Number(i)||0;let l=0;"number"==typeof o?l=o:d>0&&(l=Math.floor(c/d*100));const s={"gtm.videoProvider":e,"gtm.videoUrl":r,"gtm.videoTitle":n,"gtm.videoStatus":t,"gtm.videoCurrentTime":Math.floor(c),"gtm.videoDuration":Math.floor(d),"gtm.videoPercent":l},m=function(e){let t=e;if("function"==typeof e)try{t=e()}catch(e){return}if(!t||1!==t.nodeType||!t.isConnected||"function"!=typeof t.getBoundingClientRect)return;const r=t.ownerDocument&&t.ownerDocument.defaultView;if(!r)return;if("hidden"===r.document.visibilityState)return!1;if("function"==typeof r.getComputedStyle){const e=r.getComputedStyle(t);if(e&&("hidden"===e.visibility||"none"===e.display))return!1}const n=t.getBoundingClientRect();if(!n||n.width<=0||n.height<=0)return!1;const i=r.innerHeight||r.document.documentElement.clientHeight||0,a=r.innerWidth||r.document.documentElement.clientWidth||0;return n.top<i&&n.bottom>0&&n.left<a&&n.right>0}(u);return"boolean"==typeof m&&(s["gtm.videoVisible"]=m),s}const r=Object.create(null),n=Object.create(null);if("undefined"!=typeof onYouTubeIframeAPIReady)throw new Error("Another code is already utilizing YouTube API, GTM4WP plugin can not load YouTube tracking!");function i(e){return"function"==typeof e.getIframe?e.getIframe():null}function a(e){const r=e.target.getVideoData();window[gtm4wp_datalayer_name].push({event:"gtm4wp.mediaPlayerReady",mediaType:"youtube",mediaData:{id:r.video_id,author:r.author,title:r.title,url:e.target.getVideoUrl(),duration:e.target.getDuration()},mediaCurrentTime:e.target.getCurrentTime(),...t({provider:"youtube",status:"",url:e.target.getVideoUrl(),title:r.title,currentTime:e.target.getCurrentTime(),duration:e.target.getDuration(),element:i(e.target)})})}function o(a){let o="unknown";switch(a.data){case-1:o="unstarted";break;case YT.PlayerState.ENDED:o="ended";break;case YT.PlayerState.PLAYING:o="play";break;case YT.PlayerState.PAUSED:o="pause";break;case YT.PlayerState.BUFFERING:o="buffering";break;case YT.PlayerState.CUED:o="cued"}const u=a.target.getVideoData().video_id;YT.PlayerState.PLAYING==a.data?r[u]=setInterval(function(){!function(e){const r=e.target.getDuration();if(!r)return;const a=e.target.getVideoData().video_id,o=e.target.getCurrentTime(),u=Math.floor(o/r*100),d=e.target.getVideoData();!function(e,t,r,n,i){let a=e[t];Array.isArray(a)||(a=[],e[t]=a);for(let e=0;e<100;e+=10)r>e&&-1===a.indexOf(e)&&(a.push(e),i(e))}(n,a,u,0,function(r){window[gtm4wp_datalayer_name].push({event:"gtm4wp.mediaPlaybackPercentage",mediaType:"youtube",mediaData:{id:d.video_id,author:d.author,title:d.title,url:e.target.getVideoUrl(),duration:e.target.getDuration()},mediaCurrentTime:e.target.getCurrentTime(),mediaPercentage:r,...t({provider:"youtube",status:"progress",url:e.target.getVideoUrl(),title:d.title,currentTime:e.target.getCurrentTime(),duration:e.target.getDuration(),percent:r,element:i(e.target)})})})}(a)},1e3):r[u]&&clearInterval(r[u]);const d=a.target.getVideoData();window[gtm4wp_datalayer_name].push({event:"gtm4wp.mediaPlayerStateChange",mediaType:"youtube",mediaData:{id:d.video_id,author:d.author,title:d.title,url:a.target.getVideoUrl(),duration:a.target.getDuration()},mediaPlayerState:o,mediaCurrentTime:a.target.getCurrentTime(),...t({provider:"youtube",status:e(o),url:a.target.getVideoUrl(),title:d.title,currentTime:a.target.getCurrentTime(),duration:a.target.getDuration(),element:i(a.target)})})}function u(e,r){const n=e.target.getVideoData();window[gtm4wp_datalayer_name].push({event:"gtm4wp.mediaPlayerEvent",mediaType:"youtube",mediaData:{id:n.video_id,author:n.author,title:n.title,url:e.target.getVideoUrl(),duration:e.target.getDuration()},mediaCurrentTime:e.target.getCurrentTime(),mediaPlayerEvent:r,mediaPlayerEventParam:e.data,...t({provider:"youtube",status:"",url:e.target.getVideoUrl(),title:n.title,currentTime:e.target.getCurrentTime(),duration:e.target.getDuration(),element:i(e.target)})})}function d(e){u(e,"quality-change")}function c(e){u(e,"ratechange")}function l(e){u(e,"error")}function s(e){u(e,"api-change")}!function(e,t,r,n){const i=function(t){if(t.closest("[data-gtm4wp-media-wired]"))return;if(!r())return;const n=t.parentNode,i=n?Array.prototype.indexOf.call(n.childNodes,t):-1;t.setAttribute("data-gtm4wp-media-wired","1");try{!function(e){let t=e.getAttribute("id");if(null==t||""===t){const r=function(e){return function(e){const t=e||"";if(""===t)return"";try{const e=new URL(t,window.location.href);return e.origin+e.pathname}catch(e){return t.split("#").shift().split("?").shift()}}(e&&e.getAttribute("src"))}(e).split("/");t="youtubeplayer_"+r[r.length-1],e.setAttribute("id",t)}const r=e.getAttribute("src"),n=r.indexOf("#"),i=-1===n?r:r.slice(0,n),u=-1===n?"":r.slice(n);if(-1==i.indexOf("enablejsapi=1")){const t=-1==i.indexOf("?")?"?":"&";e.setAttribute("src",i+t+"enablejsapi=1&origin="+document.location.protocol+"//"+document.location.hostname+u)}new YT.Player(t,{events:{onReady:a,onStateChange:o,onPlaybackQualityChange:d,onPlaybackRateChange:c,onError:l,onApiChange:s}})}(t)}catch(e){}if(n&&i>-1&&t.parentNode!==n){const t=n.childNodes[i];t&&1===t.nodeType&&(t.matches(e)||t.querySelector(e))&&t.setAttribute("data-gtm4wp-media-wired","1")}},u="string"==typeof n?n:n&&n.src||"";let m=!1;const g=function(){document.querySelectorAll(e).forEach(i)},f=function(){if(""===u||m)return;const e=!window.gtm4wp_media_gate_expected||!0===window.gtm4wp_media_sdk_allowed;if(window.gtm4wp_media_sdk_blocked||!e)return m=!0,void(!window.gtm4wp_media_sdk_blocked&&"undefined"!=typeof gtm4wp_console_log&&gtm4wp_console_log&&window.console&&window.console.warn&&window.console.warn("GTM4WP: a media player library was not requested because gtm4wp-media-gate.js did not run. That is expected if a consent manager or an optimization plugin blocked it. Players already on the page are still tracked; only the events that need this library are missing. Library: "+u));if(m=!0,r())return;let t=null;const n=document.getElementsByTagName("script");for(let e=0;e<n.length;e++)if(n[e].getAttribute("src")===u){t=n[e];break}t||(t=document.createElement("script"),t.async=!0,t.src=u,(document.head||document.documentElement).appendChild(t)),t.addEventListener("load",g)};n&&"function"==typeof n.subscribe&&n.subscribe(g);const w=document.querySelectorAll(e);
1w.forEach(i),w.length&&f(),window.gtm4wp_media_observe_dynamic&&(window.gtm4wp_media_scanners=(window.gtm4wp_media_scanners||[]).filter(function(t){return t.selector!==e}),window.gtm4wp_media_scanners.push({selector:e,wireOnce:i,ensureSdk:f}),window.gtm4wp_media_observer||(window.gtm4wp_media_observer=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){1===e.nodeType&&window.gtm4wp_media_scanners.forEach(function(t){let r=!1;e.matches(t.selector)&&(t.wireOnce(e),r=!0);const n=e.querySelectorAll(t.selector);n.forEach(t.wireOnce),(r||n.length)&&t.ensureSdk()})})})}),window.gtm4wp_media_observer.observe(document.body||document.documentElement,{childList:!0,subtree:!0})),window.gtm4wp_media_observer)}("iframe[src^='https://www.youtube.com/embed']",0,function(){return"undefined"!=typeof YT&&void 0!==YT.Player},{src:"//www.youtube.com/iframe_api",subscribe(e){window.onYouTubeIframeAPIReady=function(){window[gtm4wp_datalayer_name].push({event:"gtm4wp.mediaApiReady",mediaType:"youtube"}),e()}}})})();

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.