PageSourceSearch

https://nets.vocento.com/media/v2/js/vocento.mediaUtils.js?version=201508250845

js vocento.com collected 2026-10-01 11:42:31 UTC 24,499 bytes, 781 lines download raw bytes

1var Vocento = Vocento || {};
2
3Vocento.MediaUtils = function($, mediaConfig, pageUrl, isDebug){
4		
5    /**
6     * Version del js
7     */
8    var version = '1.0';
9    
10    /**
11     * URL de la pagina actual
12     */
13    var url = (pageUrl) ? pageUrl : document.URL;
14    
15    /**
16     * Medio actual
17     */
18    var site = null;
19    
20    /**
21     * Edicion actual
22     */
23    var edition = null;
24    
25    /**
26     * Modo debug (consola activa)
27     */
28    var debug = (isDebug) ? true : false;
29    
30    /**
31     * Medios validos
32     */
33    var sites = mediaConfig.sites;
34    
35    /**
36     * Establecer el modo debug
37     * @param (boolean) enable
38     */
39    function setDebugMode(enable) {
40        debug = enable;
41        
42        return this;
43    }
44    
45    /**
46     * Obtener el estado del modo debug 
47     */
48    function getDebugMode() {
49        return debug;
50    }
51    
52    /**
53     * Log en la consola 
54     * @param (string) msg
55     */
56    function log(msg) {
57        if(typeof console !== 'undefined' && debug) {
58            console.log(msg);
59        }
60        return this;
61    }
62    
63    function isEmpty(obj){
64        // undefined are "empty"
65        if(typeof obj === 'undefined') return true;
66    	// null are "empty"
67        if(obj == null) return true;
68		// number not "empty"
69		if (typeof obj === 'number') return false;
70		// boolean not "empty"
71		if (typeof obj === 'boolean') return false;
72        // Assume if it has a length property with a non-zero value
73        // that that property is correct.
74        if (obj.length > 0)    return false;
75        if (obj.length === 0)  return true;
76        // Otherwise, does it have any properties of its own?
77        // Note that this doesn't handle
78        // toString and valueOf enumeration bugs in IE < 9
79        for (var key in obj) {
80            if (hasOwnProperty.call(obj, key)) return false;
81        }
82        return true;
83    }
84    /*
85    function isEmpty(obj){
86		var name;
87		for ( name in obj ) {
88			return false;
89		}
90		return true;
91    }
92    */
93    /**
94     * Array de caracteres especiales con sus conversiones
95     */
96    var lDcs = [{'b':'a','l':/[\u00e1\u00e0\u00e2\u00e3\u00e4]/g}
97    			,{'b':'e','l':/[\u00e9\u00e8\u00ea\u00eb]/g}
98    			,{'b':'i','l':/[\u00ed\u00ec\u00ee\u00ef]/g}
99    			,{'b':'o','l':/[\u00f3\u00f2\u00f4\u00f5\u00f6]/g}
100    			,{'b':'u','l':/[\u00fa\u00f9\u00fb\u00fc]/g}
101    			,{'b':'n','l':/[\u00f1]/g}
102    			,{'b':'c','l':/[\u00e7]/g}
103    			,{'b':'-','l':/[\. \-]+/g}
104    			,{'b':'_','l':/[|/_]+/g}
105    			,{'b':'','l':/[^a-z_0-9-]+/g}
106    			,{'b':'-','l':/[\-]+/g}
107    			,{'b':'_','l':/[\-]*_[\-]*/g}];
108    
109    /**
110     * Returns string in a string-url-safe
111     */
112    function normat(str) {
113        str=str.toLowerCase();
114        for (var i=0; i<lDcs.length; i++) {
115            str = str.replace(lDcs[i].l, lDcs[i].b);
116        }
117        return str;
118    }    
119    String.prototype.normat = function() { return normat(this); };
120    
121    /**
122     * Returns (true/false) if str start with prefix
123     */
124    function startsWith(str, prefix) {
125    	//return str.indexOf(prefix) === 0;
126    	return str.substring(0, prefix.length) === prefix;
127    }
128    String.prototype.startsWith = function(prefix) { return startsWith(this, prefix); };
129
130    /**
131     * Returns string with all 'target' replaced with 'replacement'
132     */
133    function replaceAll(str, target, replacement) {
134    	return str.split(target).join(replacement);
135    }
136    String.prototype.replaceAll = function(target, replacement) { return replaceAll(this, target, replacement); };
137    
138    /**
139     * Returns cut string from a original without breaking any words
140     */
141    function cutWithoutBreakingWords(str, maxLength, endString) {
142    	if (str.length > maxLength){
143            str = str.substring(0, maxLength);
144            pos = str.lastIndexOf(" ");
145            if(pos === -1) {
146            	return str.substring(0, maxLength) + endString;
147            }else{
148                return str.substring(0, pos) + endString;
149            }
150        }else{
151            return str;
152        }
153    }
154    String.prototype.cutWithoutBreakingWords = function(maxLength, endString) { return cutWithoutBreakingWords(this, maxLength, endString); };
155    
156    /**
157     * Returns (true/false) if str ends with prefix
158     */
159    function endsWith(str, suffix) {
160    	//return str.match(suffix+'$') === suffix;
161    	return str.substring(str.length - suffix.length, str.length ) === suffix;
162    }
163    String.prototype.endsWith = function(suffix) { return endsWith(this, suffix); };
164    
165    /**
166     * Returns string codificado a UTF-8
167     */
168    function utf8_encode(str) {
169    	if (str === null || typeof str === 'undefined') {
170    		return '';
171    	}
172   	  	var string = (str + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n");
173    	var utftext = '';
174    	var start = 0;
175    	var end = 0;
176    	var stringl = 0;
177   	  	stringl = string.length;
178    	for (var n = 0; n < stringl; n++) {
179    		var c1 = string.charCodeAt(n);
180    	    var enc = null;
181
182    	    if (c1 < 128) {
183    	    	end++;
184    	    } else if (c1 > 127 && c1 < 2048) {
185    	    	enc = String.fromCharCode((c1 >> 6) | 192, (c1 & 63) | 128);
186    	    } else if ((c1 & 0xF800) != 0xD800) {
187    	    	enc = String.fromCharCode((c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128);
188    	    } else { // surrogate pairs
189    	    	if ((c1 & 0xFC00) != 0xD800) {
190    	    		throw new RangeError('Unmatched trail surrogate at ' + n);
191    	    	}
192    	    	var c2 = string.charCodeAt(++n);
193    	    	if ((c2 & 0xFC00) != 0xDC00) {
194    	    		throw new RangeError('Unmatched lead surrogate at ' + (n - 1));
195    	    	}
196    	    	c1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000;
197    	    	enc = String.fromCharCode((c1 >> 18) | 240, ((c1 >> 12) & 63) | 128, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128);
198    	    }
199    	    if (enc !== null) {
200    	    	if (end > start) {
201    	    		utftext += string.slice(start, end);
202    	    	}
203    	    	utftext += enc;
204    	    	start = end = n + 1;
205    	    }
206    	}
207   	  	if (end > start) {
208   	  		utftext += string.slice(start, stringl);
209    	}
210   	  	return utftext;
211    }
212    String.prototype.utf8_encode = function() { return utf8_encode(this); };
213
214    /**
215     * Returns string decodificado a UTF-8
216     */
217    function utf8_decode(str) {
218    	var tmp_arr = [];
219    	var i = 0;
220    	var ac = 0;
221    	var c1 = 0;
222    	var c2 = 0;
223    	var c3 = 0;
224    	var c4 = 0;
225   	  	str += '';
226   	  	while (i < str.length) {
227   	  		c1 = str.charCodeAt(i);
228    	    if (c1 <= 191) {
229    	    	tmp_arr[ac++] = String.fromCharCode(c1);
230    	    	i++;
231    	    } else if (c1 <= 223) {
232    	    	c2 = str.charCodeAt(i + 1);
233    	    	tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
234    	    	i += 2;
235    	    } else if (c1 <= 239) {
236    	    	// http://en.wikipedia.org/wiki/UTF-8#Codepage_layout
237    	    	c2 = str.charCodeAt(i + 1);
238    	    	c3 = str.charCodeAt(i + 2);
239    	    	tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
240    	    	i += 3;
241    	    } else {
242    	    	c2 = str.charCodeAt(i + 1);
243    	    	c3 = str.charCodeAt(i + 2);
244    	    	c4 = str.charCodeAt(i + 3);
245    	    	c1 = ((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63);
246    	    	c1 -= 0x10000;
247    	    	tmp_arr[ac++] = String.fromCharCode(0xD800 | ((c1 >> 10) & 0x3FF));
248    	    	tmp_arr[ac++] = String.fromCharCode(0xDC00 | (c1 & 0x3FF));
249    	    	i += 4;
250    	    }
251   	  	}
252   	  	return tmp_arr.join('');
253    }
254    String.prototype.utf8_decode = function() { return utf8_decode(this); };
255
256	/**
257     * Returns array without empty or null elements
258     */
259    function clean(array, value) {
260    	for ( var i = 0, arraylength = array.length ; i < arraylength; i++ ) {
261    	    if ( array[ i ] == value ) {
262    	        array.splice( i, 1 );
263    	        i--;
264    	    }
265    	}
266    	return array;
267    }
268    //Array.prototype.clean = function(value) { return clean(this, value); };
269	
270	/**
271    * Returns the position of the first occurrence of a specified value in a array.
272    * This method returns -1 if the value to search for never occurs.
273     */
274    function arrayIndexOf(array, value/*, from*/) {
275    	var len = array.length >>> 0;
276    	var from = Number(arguments[2]) || 0;
277    	from = (from < 0) ? Math.ceil(from) : Math.floor(from);
278    	if (from < 0)
279    		from += len;
280    	for (; from < len; from++){
281    		if (from in array && array[from] === value){
282    			return from;
283    		}
284        }
285        return -1;
286    }
287    //Array.prototype.arrayIndexOf = function(value) { return arrayIndexOf(this, value); };
288	
289	function getSiteFromUrl(url){
290		var site = '';
291		for(siteKey in sites) {
292			for(urlKey in sites[siteKey]['urls']){
293				if(url.replace(/https:\/\/|http:\/\/|www.|-origin|pv.|.srv.vocento.in|\//g,'').indexOf(urlKey) != -1){
294					site = siteKey;
295					break;
296	            }
297			}
298        }
299		return site;
300	}
301	
302	function getUaFromSite(site){
303		var ua = '';
304		for(siteKey in sites) {
305			if(siteKey === site){
306				ua = sites[siteKey]['ua'];
307				break;
308			}
309        }
310		return ua;
311	}
312	
313	function getSiteFromBrightcoveIdAccount(brightcoveIdAccount){
314		var site = '';
315		for(siteKey in sites) {
316			if(sites[siteKey]['brightcove']['idAccount'] === brightcoveIdAccount){
317				site = siteKey;
318				break;
319			}
320		}
321		return site;
322	}
323	
324	function getCharset() {
325		var charset = '';
326		if(typeof document.characterSet === 'undefined'){
327			if(typeof document.charset === 'undefined'){
328			}else{
329				charset = document.charset.toUpperCase();
330			}
331		}else{
332			charset = document.characterSet.toUpperCase();
333		}
334		return charset;
335	}
336	
337	function getLanguage() {
338		var language = 'es';
339		if(document.documentElement.lang !== 'undefined' && document.documentElement.lang !== '')
340			language = document.documentElement.lang.toLowerCase();
341		if(language.length > 2)
342			language = language.substring(0, 2);
343		return language;
344	}
345	
346	function getLocation() {
347		var location = document.location.href;
348		return location;
349	}
350	
351	function getDevice() {
352		var device = 'pc';
353		var useragent = navigator.userAgent.toLowerCase();
354		if(navigator.userAgent.match(/iPhone/i))
355			device = 'iphone';
356		else if((navigator.userAgent.match(/iPad/i)))
357			device = 'ipad';
358		else if((navigator.userAgent.match(/iPod/i)))
359			device = 'ipod';
360		else if((navigator.userAgent.match(/Android/i)))
361			device = 'android';
362		else if((navigator.userAgent.match(/BlackBerry/i)))
363			device = 'blackberry';
364		else if((navigator.userAgent.match(/Opera Mini/i)))
365			device = 'operamini';
366		else if((navigator.userAgent.match(/IEMobile/i)))
367			device = 'iemobile';
368		return device;
369	}
370	
371	function getProtocol() {
372		var protocol = 'http';
373		if(document.location.protocol === 'https:')
374			protocol = 'https';
375		return protocol;
376	}
377	
378	function getGigyaUserType() {
379		gigyaUserType = 'anonimo';
380		if (typeof getUserType !== 'undefined'){
381			gigyaUserType = getUserType();
382		}
383		return gigyaUserType;
384	}
385	
386	function isHomePage(){
387		var isHomePage = false;
388		if(document.location.pathname == '/' || document.location.pathname == '/index.html' || 
389			document.location.pathname == '/alava/' || document.location.pathname == '/alava/index.html' || 
390			document.location.pathname == '/jaen/' || document.location.pathname == '/jaen/index.html' ||
391			document.location.pathname == '/almeria/' || document.location.pathname == '/almeria/index.html' ||
392			document.location.pathname == '/alicante/' || document.location.pathname == '/alicante/index.html'){
393			isHomePage = true;
394		}
395		return isHomePage;
396	}
397	
398	function urlCategories(url){
399		urlCategoriesTmp = [];
400		urlCategories = [];
401		if (url.indexOf('.es/') != -1){
402			url = url.substring(url.indexOf('.es/') + 4, url.lenght);
403		}else if (url.indexOf('.com/') != -1){
404			url = url.substring(url.indexOf('.com/') + 5, url.lenght);
405		}else if (url.indexOf('.in/') != -1){
406			url = url.substring(url.indexOf('.in/') + 4, url.lenght);
407		}else{
408			url = '';
409		}
410		url = url.substring(0, url.lastIndexOf('/'));
411		urlCategoriesTmp = url.split('/');
412		for(var i=0; i<urlCategoriesTmp.length; i++) {
413			var categorie = urlCategoriesTmp[i];
414			if(isNaN(parseFloat(categorie)) && !isFinite(categorie))
415				urlCategories.push(categorie);
416		}
417		urlCategoriesTmp = [];
418		for(var i=0; i<4; i++){
419			categorie = typeof urlCategories[i] == 'undefined' ? '' : urlCategories[i];
420			urlCategoriesTmp.push(categorie);
421		}
422		urlCategories = urlCategoriesTmp;
423		return urlCategories;
424	}
425	
426	function isMovil(){
427		mobile = ['iphone','ipad','ipod','android','blackberry','nokia','opera mini','windows mobile','windows phone','iemobile'];
428		for (var i in mobile){ 
429			if (navigator.userAgent.toLowerCase().indexOf(mobile[i]) > 0){ 
430				return true;
431			}
432		}
433		return false;
434	}
435	
436	function recargarGoogleAnalytics(url){(
437		function(){
438			setTimeout(function(){
439									var googlean1 = url;
440									var s = document.createElement('script');
441									s.type = 'text/javascript';
442									s.src = 'https://www.google-analytics.com/ga.js';
443									s.onload = s.onreadystatechange = function(){
444										if(typeof _gat == 'object'){
445											var init=setInterval(function(){
446																			var uasemilla = '';
447																			var site = getSiteFromUrl(url);
448																			var uasemilla = getUaFromSite(site);
449																			var pageTracker=_gat._getTracker(uasemilla);
450																			pageTracker._trackPageview(googlean1);
451																			clearInterval(init);
452																			},200);
453										}
454									}
455									document.getElementsByTagName('head')[0].appendChild(s);
456								},0);
457		})();
458	}
459	
460	function getOAS_sitepage(sOAS_sitepage) {
461		if(sOAS_sitepage!=''){
462			var respuesta = '';
463			if(sOAS_sitepage.substring(0, 6) == "/4900/") {
464				sOAS_sitepage = sOAS_sitepage.replace(/\/\//g, '\/');
465				respuesta = sOAS_sitepage.substring(6, sOAS_sitepage.length);
466			}else{
467				var campos = sOAS_sitepage.split('/');
468				campos = clean(campos, '');
469				if((campos[0]=="hoycinema") || (campos[0]=="laguiatv")){
470					var periodico = 'hoycinema';}
471				else{			
472					var campos2 = campos[0].split('.');	
473					switch (campos2[1]) {
474						case 'elcomercio-sa':
475							var periodico = 'elcomerciodigital';
476							break;
477						case 'elcomercio':
478							var periodico = 'elcomerciodigital';
479							break;
480						case 'elnortedecastilla':
481							var periodico = 'nortecastilla';
482							break;
483						case 'diario-elcorreo':
484							var periodico = 'elcorreodigital';
485							break;
486						case 'la-verdad':
487							var periodico = 'laverdad';
488							break;
489						case 'lavozdecadiz':
490							var periodico = 'lavozdigital';
491							break;
492						default:
493							var periodico = campos2[1];
494							break;   
495					}
496				}
497				var separador = '/';	
498				respuesta = 'vocento.' + periodico;
499				var cont = 1;
500				while(campos[cont] != null){
501					respuesta += separador + campos[cont];
502					cont++;               
503				}
504			}
505			return respuesta;
506		}else{
507	        return '';
508	    }
509	}
510	
511	function useragentMatch(useragent){
512		useragent = useragent.toLowerCase();
513	    var match = /(chrome)[ \/]([\w.]+)/.exec(useragent) ||
514	        /(webkit)[ \/]([\w.]+)/.exec(useragent) ||
515	        /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(useragent) ||
516	        /(msie) ([\w.]+)/.exec(useragent) ||
517	        useragent.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(useragent) ||
518	        [];
519	    return {
520	        browser: match[ 1 ] || "",
521	        version: match[ 2 ] || "0"
522	    }
523	}
524	
525	function getBrowser(){
526		var matched, browser;
527		matched = useragentMatch(navigator.userAgent);
528		browser = {};
529		if (matched.browser){
530		    browser[matched.browser] = true;
531		    browser.version = matched.version;
532		}
533		// Chrome is Webkit, but Webkit is also Safari.
534		if(browser.chrome){
535		    browser.webkit = true;
536		}else if( browser.webkit){
537		    browser.safari = true;
538		}
539		return browser;
540	}
541	
542	function getUrlPlayer(mediaType, options){
543		urlPlayer = '';
544		urlBase = mediaConfig.sites[options.site]['media-url'][mediaType];
545		if(url.indexOf('videochat')!=-1){
546			urlBase = mediaConfig.sites[options.site]['media-url']['videochat'];
547		}
548		urlParams = ''; 
549		if (urlBase.indexOf('media.')!=-1 || urlBase.indexOf('modgen')!=-1) {
550			// legacy player v2
551			for(key in options){
552				if(!mediaUtils.isEmpty(options[key])){
553					options[key] = options[key].toString().replaceAll('&quot;', '"');
554					if(mediaConfig.sites[options.site]['media-url'][mediaType].toLowerCase().indexOf('modgen') != -1){
555						urlParams += key + '=' + escape(options[key]) + '&';
556					}else{
557						urlParams += key + '=' + encodeURIComponent(options[key]) + '&';
558					}
559				}
560			}
561			urlParams = urlParams.replace(/'/g, '%27');
562			urlPlayer = urlBase + '?' + urlParams.substring(0, urlParams.length-1);		
563			return urlPlayer;
564		} else {
565			// microservicio video-player
566			if(mediaUtils.isEmpty(options.codigoDirecto)) {
567				var opcionesNewPlayer = {};
568				var source = options.source;
569				opcionesNewPlayer.source = source;
570				var accountname = options.site;
571				accountname = options.site.indexOf('colpisa') !== -1 ? 'rc' :options.site;
572				accountname = options.site.indexOf('surinenglish') !== -1 ? 'diariosur' :options.site;
573				opcionesNewPlayer.accountname = accountname;
574				var videoid = (options.id.indexOf('@') !== -1) ? options.id.substring(options.id.indexOf('@')+1) : options.id;
575				opcionesNewPlayer.videoid = videoid;
576				var domain = mediaConfig.sites[options.site]['domain'].replace("//", "");
577				domain = (domain.indexOf('vocento') !== -1 || domain.indexOf('xlsemanal') !== -1 || domain.indexOf('mujerhoy') !== -1 || domain.indexOf('finanzas') !== -1 || domain.indexOf('guapabox') !== -1 || domain.indexOf('colpisa') !== -1 || domain.indexOf('surinenglish') !== -1 || domain.indexOf('abc') !== -1 || domain.indexOf('sevilla.abc') !== -1 || domain.indexOf('lavozdigital') !== -1) ? '' : domain;
578				opcionesNewPlayer.domain = domain;
579				var modallayer = false;
580				opcionesNewPlayer.modallayer = modallayer;
581				var poster = options.stillURL;
582				opcionesNewPlayer.poster = poster;
583				var videoad = true;
584				opcionesNewPlayer.videoad = videoad;
585				var autoplay = options.autoStart;
586				opcionesNewPlayer.autoplay = autoplay;
587				var idDiv = options.idDiv;
588				opcionesNewPlayer.idDiv = idDiv;
589				//var muted = mediaUtils.isEmpty(options.muted) ? false : options.muted;
590				var muted = (mediaUtils.isEmpty(options.muted)) || options.muted == 'false' ? (autoplay == true || autoplay == 'true' ? true : options.muted) : options.muted
591				opcionesNewPlayer.muted = muted;
592				var controls = options.controls;
593				opcionesNewPlayer.controls = controls;
594				var playerid = options.idPlayer;
595				opcionesNewPlayer.playerid = playerid;
596				var bumperid = document.location.host.indexOf('fibabc') !== -1 ? '5316920268001' :'';
597				opcionesNewPlayer.bumperid = bumperid;
598				//update xlsemanal 2021-06-03
599				var template = options.template;
600				template = options.template === 'iframeVideoPlayerShowVideo' ? 'iframeVideoPlayer' :'';
601				opcionesNewPlayer.template = template;
602			} else {
603				var opcionesNewPlayer = {};
604				var source = 'unknown';
605				opcionesNewPlayer.source = source;
606				var accountname = options.site;
607				accountname = options.site.indexOf('colpisa') !== -1 ? 'rc' :options.site;
608				accountname = options.site.indexOf('surinenglish') !== -1 ? 'diariosur' :options.site;
609				opcionesNewPlayer.accountname = accountname;
610				var videoid = 'unknown';
611				opcionesNewPlayer.videoid = videoid;
612				var src = options.codigoDirecto;
613				src = src.substr(options.codigoDirecto.indexOf('//'));
614				src = src.split('"');
615				src = src[0];
616				opcionesNewPlayer.src = src;
617			}
618			for(key in opcionesNewPlayer){
619				if(!mediaUtils.isEmpty(opcionesNewPlayer[key])){
620					opcionesNewPlayer[key] = opcionesNewPlayer[key].toString().replaceAll('&quot;', '"');
621					if(mediaConfig.sites[options.site]['media-url'][mediaType].toLowerCase().indexOf('modgen') != -1){
622						urlParams += key + '=' + escape(opcionesNewPlayer[key]) + '&';
623					}else{
624						urlParams += key + '=' + encodeURIComponent(opcionesNewPlayer[key]) + '&';
625					}
626				}
627			}
628			urlBase += 'source/'+source+'/account/'+accountname+'/'+videoid+'.html';
629			urlParams = urlParams.replace(/'/g, '%27');
630			urlPlayer = urlBase + '?' + urlParams.substring(0, urlParams.length-1);		
631			return urlPlayer;
632		}
633	}
634	
635	function previewPlayer(urlPlayer, options){
636		if (options.source === 'performgroup') {
637			return;
638		}
639		var jQueryIdDiv = options.template === '' ? 'body' : '#' + options.idDiv.replace(/[.]/gi,'\\\.');
640		
641		if(!mediaUtils.isEmpty(options['width'])){
642			$(jQueryIdDiv).width(options['width']);
643		}
644		
645		if (getBrowser().msie && window.XDomainRequest) {
646			//INTERNET EXPLORER
647			var xdr = new XDomainRequest();
648			//xdr.withCredentials = true;
649			xdr.open("get", urlPlayer);
650			xdr.onload = function() {
651									var dom = new ActiveXObject("Microsoft.XMLDOM");
652									dom.async = false;
653									var data = xdr.responseText;
654									$(jQueryIdDiv).html(data);
655	        						};
656	        xdr.send();
657		}else{
658			//NO INTERNET EXPLORER
659			$.ajax({
660					xhrFields: {
661								//withCredentials: true
662								},
663					url: urlPlayer,
664					success: function(data) {
665											$(jQueryIdDiv).html(data);
666											},
667					error: function(XMLHttpRequest, textStatus, errorThrown){}
668					});
669		}
670	}
671	
672	function viewPlayer(urlPlayer, options){
673		if (options.source === 'performgroup') {
674			return;
675		}
676		var jQueryIdDiv = options.template === '' ? 'body' : '#' + options.idDiv.replace(/[.]/gi,'\\\.');
677		
678		if(options.modalLayer === 'true'){
679			//CAPA MODAL
680			if (getBrowser().msie && window.XDomainRequest) {
681				//INTERNET EXPLORER
682				var xdr = new XDomainRequest();
683				//xdr.withCredentials = true;
684				xdr.open("get", urlPlayer);
685				xdr.onload = function() {
686										var dom = new ActiveXObject("Microsoft.XMLDOM");
687										dom.async = false;
688										var data = xdr.responseText;
689										$('body').append(data);
690				};
691				xdr.send();
692			}else{
693				//NO INTERNET EXPLORER
694				$.ajax({
695						xhrFields: {
696									//withCredentials: true
697									},
698						url: urlPlayer,
699						success: function(data) {
700												if($('#myModal_'+options.idDiv).length >0){
701													$('#myModal_'+options.idDiv).remove();
702												}
703												$('body').append(data);
704												},
705						error: function(XMLHttpRequest, textStatus, errorThrown){}
706				});
707			}
708		}else{
709			//NO CAPA MODAL
710			if (getBrowser().msie && window.XDomainRequest) {
711				//INTERNET EXPLORER
712				var xdr = new XDomainRequest();
713				//xdr.withCredentials = true;
714				xdr.open("get", urlPlayer);
715				xdr.onload = function() {
716										var dom = new ActiveXObject("Microsoft.XMLDOM");
717										dom.async = false;
718										var data = xdr.responseText;
719										//$(jQueryIdDiv).html(data);
720										$(jQueryIdDiv).parent().find('a').remove();
721										$(jQueryIdDiv).html(data);
722				};
723				xdr.send();
724			}else{
725				//NO INTERNET EXPLORER
726				$.ajax({
727						xhrFields: {
728									//withCredentials: true
729									},
730						url: urlPlayer,
731						success: function(data) {
732												//$(jQueryIdDiv).html(data);
733												$(jQueryIdDiv).parent().find('a').remove();
734												$(jQueryIdDiv).html(data);
735												},
736						error: function(XMLHttpRequest, textStatus, errorThrown){}
737				});
738			}
739		}
740	}
741	
742	/**
743	 * Metodos publicos
744	 */
745	return {
746	    version: function() {
747	        return version;
748	    }
749    	,setDebugMode : setDebugMode
750    	,getDebugMode : getDebugMode
751    	,log : log
752    	,isEmpty : isEmpty
753    	,normat : normat
754    	,startsWith : startsWith
755    	,endsWith : endsWith
756    	,replaceAll : replaceAll
757    	,utf8_encode : utf8_encode
758    	,utf8_decode : utf8_decode
759    	,clean : clean
760    	,arrayIndexOf : arrayIndexOf
761    	,cutWithoutBreakingWords: cutWithoutBreakingWords
762    	,getSiteFromUrl : getSiteFromUrl
763    	,getUaFromSite : getUaFromSite
764    	,getSiteFromBrightcoveIdAccount : getSiteFromBrightcoveIdAccount
765    	,getCharset : getCharset
766    	,getLanguage : getLanguage
767    	,getLocation : getLocation
768    	,getDevice : getDevice
769    	,getProtocol : getProtocol
770    	,getGigyaUserType : getGigyaUserType
771    	,isHomePage : isHomePage
772    	,urlCategories : urlCategories
773    	,isMovil : isMovil
774    	,recargarGoogleAnalytics : recargarGoogleAnalytics
775    	,getOAS_sitepage : getOAS_sitepage
776    	,getBrowser : getBrowser
777    	,getUrlPlayer : getUrlPlayer
778    	,previewPlayer : previewPlayer
779    	,viewPlayer : viewPlayer
780	};
781};

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.