PageSourceSearch

https://popcornporn.net/kt_player/kt_player.js

js popcornporn.net collected 2026-10-09 03:40:25 UTC 21,579 bytes, 428 lines download raw bytes

1/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
2   is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
3*/
4var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+
4ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
5
6String.prototype.endsWith = function(suffix) {
7	return this.indexOf(suffix, this.length - suffix.length) !== -1;
8};
9
10function kt_player(c_id, s, w, h, f, p) {
11	var c = document.getElementById(c_id);
12	if (!c) {
13		return null;
14	}
15	var wc = w, hc = h, p_id = c_id + '_internal';
16	if (typeof w != 'string' || !w.endsWith('%')) {
17		wc += 'px';
18	}
19	if (typeof h != 'string' || !h.endsWith('%')) {
20		hc += 'px';
21	}
22
23	try {
24		c.style.width = wc;
25		c.style.height = hc;
26		c.style.overflow = 'hidden';
27		c.style.position = 'relative';
28		c.style.background = '#000';
29	} catch (error) {}
30
31	if (!p) {
32		p = {};
33	}
34	if (!p['wmode']) {
35		p['wmode'] = 'transparent';
36	}
37	if (!p['bgcolor']) {
38		p['bgcolor']='000000';
39	}
40	if (swfobject.hasFlashPlayerVersion('9.124.0')) {
41		for (var flashvar in f) {
42			if (flashvar=='float_src' || flashvar=='timeline_screens_url') {
43				if (f[flashvar].indexOf('?') >= 0) {
44					f[flashvar] += '&';
45				} else {
46					f[flashvar] += '?';
47				}
48				f[flashvar] += 'referer=' + encodeURIComponent(document.referrer);
49			}
50			f[flashvar] = encodeURIComponent(f[flashvar]);
51		}
52		f['internal_id'] = p_id;
53		c.innerHTML = '<div id="' + p_id + '"></div>';
54		swfobject.embedSWF(s, p_id, w, h, '9.124.0', 'expressInstall.swf', f, p, {'id': p_id, 'name': p_id});
55		c.style.visibility = 'visible';
56		return _kt_player_wrapper(c, p_id, f, s);
57	}
58
59	var video_url = f['video_url'];
60	if (f['video_html5_url']) {
61		video_url = f['video_html5_url'];
62	}
63	var preview_url = f['preview_url'];
64	var mp4_support = false;
65	if (video_url && (video_url.indexOf('.mp4') > 0)) {
66		mp4_support = true;
67	}
68
69	var html5_support = false;
70	var video = document.createElement('VIDEO');
71	if (video && video.canPlayType) {
72		if (mp4_support) {
73			if (video.canPlayType('video/mp4')) {
74				html5_support = true;
75			}
76		}
77	}
78	if (f['disable_html5'] == 'true') {
79		html5_support = false;
80	}
81
82	var player_folder = '';
83	if (s.lastIndexOf('/') > 0) {
84		player_folder = s.substring(0, s.lastIndexOf('/')) + '/';
85	}
86	if (html5_support) {
87		video.id = p_id;
88		video.preload = 'none';
89		video.src = video_url;
90		video.poster = preview_url;
91		video.style.width = wc;
92		video.style.height = hc;
93		video.controls = 'controls';
94		if (f['disable_time_display'] == 'true') {
95			video.controls = false;
96		}
97		c.innerHTML = '';
98		c.appendChild(video);
99
100		var lastPlayTime = '0';
101		_kt_player_attach_event(video, 'playing', function() {
102			_kt_player_event_handler(p_id, 'ktVideoStarted');
103		});
104		_kt_player_attach_event(video, 'pause', function() {
105			_kt_player_event_handler(p_id, 'ktVideoPaused');
106		});
107		_kt_player_attach_event(video, 'ended', function() {
108			_kt_player_event_handler(p_id, 'ktVideoFinished');
109		});
110		_kt_player_attach_event(video, 'timeupdate', function() {
111			if (video.currentTime.toFixed(0) != lastPlayTime) {
112				lastPlayTime = video.currentTime.toFixed(0);
113				_kt_player_event_handler(p_id, 'ktVideoProgress', lastPlayTime);
114				if (f['sec'] && parseInt(f['sec']) > 0 && (lastPlayTime >= parseInt(f['sec']))) {
115					video.pause();
116					video.currentTime = 0;
117					_kt_player_event_handler(p_id, 'ktVideoFinished');
118				}
119			}
120		});
121	} else if (mp4_support) {
122		video = document.createElement('A');
123		video.id = p_id;
124		video.style.display = 'block';
125		video.href = video_url;
126		video.style.width = wc;
127		video.style.height = hc;
128
129		c.innerHTML = '';
130		c.appendChild(video);
131
132		if (preview_url) {
133			var poster = document.createElement('IMG');
134			poster.style.width = wc;
135			poster.style.height = hc;
136			poster.src = preview_url;
137			poster.style.border = '0';
138			video.appendChild(poster);
139		}
140
141		video.appendChild(_kt_player_create_play_btn(player_folder + 'btn_play.png', c));
142	}
143	c.style.visibility = 'visible';
144	var player = _kt_player_wrapper(c, p_id, f, s);
145	_kt_player_event_handler(p_id, 'ktPlayerLoaded', null);
146	return player;
147}
148
149function _kt_player_create_play_btn(u, c) {
150	var b = document.createElement('IMG');
151	b.style.position = 'absolute';
152	b.style.border = '0';
153	b.style.cursor = 'pointer';
154	b.onload = function() {
155		var x = (c.offsetWidth - b.width) / 2;
156		var y = (c.offsetHeight - b.height) / 2;
157		b.style.left = x + 'px';
158		b.style.top = y + 'px';
159	};
160	b.src = u;
161	return b;
162}
163
164
165function _kt_player_event_handler(p_id, event, param1) {
166	if (_KT_PLAYERS[p_id]) {
167		if (event == 'ktPlayerLoaded') {
168			_KT_PLAYERS[p_id].loaded();
169			try {
170				if (typeof window['kt_player_loaded'] == 'function') {
171					window['kt_player_loaded'](_KT_PLAYERS[p_id]);
172				}
173			} catch (e) {}
174		}
175		return _KT_PLAYERS[p_id].handle(event, param1);
176	}
177	return '';
178}
179
180function _kt_player_attach_event(e, et, l) {
181	if (e.addEventListener) {
182		e.addEventListener(et, l, false);
183	} else if (e.attachEvent) {
184		e.attachEvent('on' + et, l);
185	} else {
186		e['on' + et] = l;
187	}
188}
189
190function _kt_player_wrapper(c, p_id, f, s)
191{
192	var wrapper = {
193		_listeners: {},
194		_player: null,
195
196		container: function() {
197			return c
198		},
199
200		loaded: function() {
201			if (!this._player) {
202				this._player = document.getElementById(p_id);
203			}
204		},
205
206		listen: function(event, callack) {
207			if (!this._listeners[event]) {
208				this._listeners[event] = [];
209			}
210			this._listeners[event].push(callack);
211		},
212
213		handle: function(event, param1) {
214			if (this._listeners[event]) {
215				for (var i = 0; i < this._listeners[event].length; i++) {
216					if (typeof this._listeners[event][i] == 'function') {
217						try {
218							var r = this._listeners[event][i](param1);
219							if (typeof r == 'string') {
220								return r;
221							}
222						} catch (e) {}
223					}
224				}
225			}
226			return '';
227		},
228
229		play: function(video) {
230			if (!this._player) {return;}
231			if (!video) {
232				if (typeof this._player['jsPlay'] == 'function') {
233					this._player['jsPlay']();
234				} else if (typeof this._player['play'] == 'function') {
235					this._player['play']();
236				} else if (this._player['href']) {
237					window.location = this._player['href'];
238				}
239			} else {
240				if (typeof this._player['jsPlayNew'] == 'function') {
241					this._player['jsPlayNew'](video);
242				} else if (typeof this._player['play'] == 'function') {
243					this._player.src = video;
244					this._player['play']();
245				} else if (this._player['href']) {
246					window.location = video;
247				}
248			}
249		},
250
251		pause: function() {
252			if (!this._player) {return;}
253			if (typeof this._player['jsPause'] == 'function') {
254				this._player['jsPause']();
255			} else if (typeof this._player['pause'] == 'function') {
256				this._player['pause']();
257			}
258		},
259
260		skip_preroll: function() {
261			if (!this._player) {return;}
262			if (typeof this._player['jsSkipPreRoll'] == 'function') {
263				this._player['jsSkipPreRoll']();
264			}
265		},
266
267		skip_postroll: function () {
268			if (!this._player) {return;}
269			if (typeof this._player['jsSkipPostRoll'] == 'function') {
270				this._player['jsSkipPostRoll']();
271			}
272		}
273	};
274
275	function show_centered(what) {
276		if (what.parentNode != wrapper.container()) {
277			wrapper.container().appendChild(what);
278		}
279		what.style.position = 'absolute';
280		what.style.display = 'block';
281		what.style.left = ((wrapper.container().offsetWidth - what.offsetWidth) / 2) + 'px';
282		what.style.top = ((wrapper.container().offsetHeight - what.offsetHeight) / 2) + 'px';
283	}
284
285	function find_child(parent, styleClass) {
286		if (!parent) {return null;}
287		if (parent.tagName.toLowerCase() == 'iframe') {
288			try {
289				parent = parent.contentWindow.document;
290			} catch (e) {}
291		}
292		var childs = parent.getElementsByTagName('*');
293		for (var i = 0; i < childs.length; i++) {
294			var classes = childs[i].className.split(' ');
295			for (var j = 0; j < classes.length; j++) {
296				if (classes[j].indexOf(styleClass) === 0) {
297					return childs[i];
298				}
299			}
300		}
301		return null;
302	}
303
304	var html_ads = {};
305	var html_ads_last_event = null;
306	var html_pre_roll_interval = null;
307
308	function configure_ad_on(ad, events) {
309		if (!ad || !events) {
310			return;
311		}
312		if (f[ad]) {
313			var html_ad = document.getElementById(f[ad]);
314			if (html_ad) {
315				for (var i = 0; i < events.length; i++) {
316					html_ads[events[i]] = html_ad;
317				}
318			}
319		} else if (f[ad.substring(0, ad.length - 3)]) {
320			var iframe = document.createElement('IFRAME');
321			iframe.style.position = 'absolute';
322			iframe.style.display = 'block';
323			iframe.style.left = '10000px';
324			iframe.style.top = '10000px';
325			iframe.frameBorder = 0;
326			iframe.width = 1;
327			iframe.height = 1;
328			iframe.scrolling = 'no';
329			iframe.onload = function() {
330				iframe.style.width = iframe.contentWindow.document.getElementById('_iframe_content').offsetWidth + 'px';
331				iframe.style.height = iframe.contentWindow.document.getElementById('_iframe_content').offsetHeight + 'px';
332				if (iframe.offsetLeft != 10000 && html_ads_last_event) {
333					show_ad_on(html_ads_last_event);
334				}
335			};
336			var iurl = decodeURIComponent(f[ad.substring(0, ad.length - 3)]) + '&referer=' + encodeURIComponent(document.referrer);
337			if (s.indexOf('force_embed') >= 0)
338			{
339				iurl += '&embed=true';
340			}
341			iframe.src = iurl;
342			c.appendChild(iframe);
343
344			for (var i = 0; i < events.length; i++) {
345				html_ads[events[i]] = iframe;
346			}
347		}
348	}
349
350	configure_ad_on('adv_start_html_id', ['ktPlayerLoaded', 'ktVideoStopped', 'ktVideoFinished', 'ktPostRollFinished']);
351	configure_ad_on('adv_pre_html_id', ['ktPreRollStarted']);
352	configure_ad_on('adv_post_html_id', ['ktPostRollStarted']);
353	configure_ad_on('adv_pause_html_id', ['ktVideoPaused']);
354
355	function show_ad_on(event) {
356		html_ads_last_event = event;
357		for (var prop in html_ads) {
358			html_ads[prop].style.position = 'absolute';
359			html_ads[prop].style.left = '10000px';
360			html_ads[prop].style.top = '10000px';
361		}
362		if (html_ads[event]) {
363			var btn_close = find_child(html_ads[event], 'kt-api-btn-start');
364			if (btn_close) {
365				btn_close.onclick = function() {
366					wrapper.play();
367					return false;
368				};
369			}
370
371			show_centered(html_ads[event]);
372			if (event == 'ktPreRollStarted') {
373				var time = find_child(html_ads[event], 'kt-api-time-left');
374				if (time) {
375					var adDuration = f['adv_pre_duration'];
376					if (adDuration) {
377						var timeValueEnd = new Date().getTime() + adDuration * 1000;
378						time.innerHTML = parseInt(adDuration);
379						if (html_pre_roll_interval) {
380							clearInterval(html_pre_roll_interval);
381						}
382						html_pre_roll_interval = setInterval(function() {
383							var timeLeft = (timeValueEnd - new Date().getTime()) / 1000;
384							if (timeLeft < 1) {
385								timeLeft = 0;
386							}
387							time.innerHTML = Math.round(timeLeft);
388						}, 1000);
389					}
390				}
391
392				var btn_skip = find_child(html_ads[event], 'kt-api-btn-skip');
393				if (btn_skip) {
394					btn_skip.onclick = function() {
395						wrapper.skip_preroll();
396						return false;
397					};
398				}
399			} else if (event == 'ktPostRollStarted') {
400				var btn_skip = find_child(html_ads[event], 'kt-api-btn-skip');
401				if (btn_skip) {
402					btn_skip.onclick = function() {
403						wrapper.skip_postroll();
404						return false;
405					};
406				}
407			}
408		}
409	}
410
411	var events = ['ktPlayerLoaded', 'ktVideoStarted', 'ktVideoPaused', 'ktVideoFinished', 'ktVideoStopped', 'ktPreRollStarted', 'ktPreRollFinished', 'ktPostRollStarted', 'ktPostRollFinished'];
412	function createListener(i) {
413		return function() {
414			setTimeout(function() {
415				show_ad_on(events[i]);
416			}, 0);
417		}
418	}
419
420	for (var i = 0; i < events.length; i++) {
421		wrapper.listen(events[i], createListener(i));
422	}
423
424	_KT_PLAYERS[p_id] = wrapper;
425	return wrapper;
426}
427
428var _KT_PLAYERS = {};

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.