PageSourceSearch

https://dlmag.com/wp-content/cache/min/1/inc/javascript/video/youtube.js?ver=1771254142

js dlmag.com collected 2026-10-02 10:50:40 UTC 4,170 bytes, 28 lines download raw bytes

1var yoobtoob=[],_yti=0;function onYouTubePlayerReady(id){_yti++;yoobtoob['yt'+_yti]=new _yto(id,_yti)}
2var videoArray=new Array();var playerArray=new Array();function onYouTubeIframeAPIReady(){for(var i=0;i<videoArray.length;i++){playerArray[i]=new YT.Player(videoArray[i],{events:{'onReady':onPlayerReady,'onStateChange':yoobtoob['yt'+i].onPlayerStateChange}})}}
3function onPlayerReady(event){}
4function _yto(id,i,is_iframe){if(typeof id=="undefined")
5return;if(typeof i=="undefined")
6return;this.pos=i;i='yt'+i;this.id=id;this.mytime;this.scrubTimer;this.startTimer;this.last='none';this.scrubbing=!1;this.is_iframe=(is_iframe!=undefined)?is_iframe:!1;this.seek_count=0;this.is_initially_buffered=!1;this.o=document.getElementById(this.id);var _ref=this;if(!is_iframe)
7this.o.addEventListener("onStateChange","yoobtoob."+i+".onPlayerStateChange");this.onPlayerStateChange=function(newState){if(_ref.is_iframe&&typeof newState=="object"){var s;for(s=0;s<playerArray.length;s++){if(playerArray[s]==newState.target)
8_ref=yoobtoob['yt'+s]}}
9if(_ref.myTime!=undefined)clearTimeout(_ref.myTime);if(newState=='2'||(_ref.is_iframe&&newState.data==YT.PlayerState.PAUSED)){yoobtoob[i].videoLog('pause');yoobtoob[i].last='pause';yoobtoob[i].scrubbing=!1}else if(newState=='3'||(_ref.is_iframe&&newState.data==YT.PlayerState.BUFFERING)){if(!yoobtoob[i].is_initially_buffered){yoobtoob[i].is_initially_buffered=!0;return}
10yoobtoob[i].seek_count++;
10if(yoobtoob[i].seek_count>4)
11yoobtoob[i].seek_count=0;else _ref.last='pre-scrub'}else if(newState=='1'||(_ref.is_iframe&&newState.data==YT.PlayerState.PLAYING)){switch(_ref.last){case 'none':_ref.killTimers();_ref.startTimer=setInterval(_ref.startRun,200);break;case 'pause':yoobtoob[i].videoLog('play');yoobtoob[i].last='play';break;case 'pre-scrub':yoobtoob[i].seek_count++;if(yoobtoob[i].seek_count>4){yoobtoob[i].seek_count=0;break}
12if(4===yoobtoob[i].seek_count){_ref.last='pre-scrub';_ref.scrubbing=!0;_ref.killTimers();_ref.scrubTimer=setInterval(_ref.scrubRun,2000);break}
13break}}else if(newState=='0'||(_ref.is_iframe&&newState.data==YT.PlayerState.ENDED)){_ref.last='none';_ref.videoLog('end')}}
14this.scrubRun=function(){yoobtoob[i].videoLog('seek');yoobtoob[i].killTimers();yoobtoob[i].last='scrub';yoobtoob[i].scrubbing=!1}
15this.startRun=function(){yoobtoob[i].videoLog('play');yoobtoob[i].killTimers();yoobtoob[i].last='start'}
16this.killTimers=function(){if(this.startTimer){clearInterval(this.startTimer);this.startTimer=null}
17if(this.scrubTimer){clearInterval(this.scrubTimer);this.scrubTimer=null}}
18this.videoLog=function(action){if(window._cgen)_cgen.video(action,this.videoTime(),this.videoURL(),this.videoTitle())}
19this.videoTime=function(){return Math.round((this.is_iframe)?playerArray[this.pos].getCurrentTime():this.o.getCurrentTime())}
20this.videoURL=function(){var url=(this.is_iframe)?playerArray[this.pos].getVideoUrl():this.o.getVideoUrl();var parts=url.split('?');var url_new=parts[0];var params=parts[1].split('&');for(var i=0;i<params.length;i++){if(params[i].match(/^v=/)){url_new+='?'+params[i];return url_new}}
21return url_new}
22this.videoTitle=function(){if(window._ytmeta&&_ytmeta[this.id])return _ytmeta[this.id].title||''}}
23if(window.jQuery){var tag=document.createElement('script');tag.src="//www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName('script')[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag);(function($){function trackYouTube(){var i=0;jQuery('iframe').each(function(){var video,vidSrc,regex,matches;video=$(this);vidSrc=video.attr('src');if(!vidSrc)
24vidSrc=video.data('src');if(!vidSrc)
25return;regex=/(https?\:)?\/\/www\.youtube\.com\/embed\/([\w-]{11})(?:\?.*)?/;matches=vidSrc.match(regex);if(matches&&matches[2]){var identifier=matches[2];if(!$(this).attr('id'))
26$(this).attr('id',matches[2]);else identifier=$(this).attr('id');videoArray[i]=identifier;yoobtoob['yt'+_yti]=new _yto($(this).attr('id'),_yti,!0);_yti++;i++;if(matches[0].indexOf('enablejsapi=1')<0){if(matches[0].indexOf('?')<0)
27video.attr('src',vidSrc+'?enablejsapi=1');else video.attr('src',vidSrc+'&enablejsapi=1')}}})}
28$(document).ready(function(){trackYouTube()})})(jQuery)}

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.