1 2 3var LANG_MSG = { 4"es":{ 5"trans_no_disponible":"No disponible para este dispositivo", 6"trans_no_comenzado" : "La retransmisión aún no ha comenzado", 7"trans_reanudara" : "La retransmisión se reanudará en breve", 8"trans_finalizada" : "La retransmisión ha finalizado", 9"publicidad" : "Publicidad", 10"actualizar_plugin" : "Necesitas actualizar tu plugin de Flash", 11"no_mp4" : "El navegador no admite vÃÂdeo HTML5/MP4", 12"no_mp3" : "El navegador no admite audio HTML5/MP3", 13"geobloqueado" : "VÃÂdeo no disponible en su zona geográfica", 14"bloqueado" : "Contenido compartido bloqueado", 15"aun_no_disponible" : "El vÃÂdeo no está disponible todavÃÂa", 16"no_disponible" : "El vÃÂdeo ya no está disponible", 17"audio_geobloqueado" : "Audio no disponible en su zona geográfica", 18"audio_aun_no_disponible" : "Audio no disponible todavÃÂa", 19"audio_no_disponible" : "Audio ya no disponible", 20"audio_no_encontrado": "Audio no encontrado", 21"necesita_plugin" : "Necesita instalar el plugin de flash para ver este contenido", 22"no_encontrado": "VÃÂdeo no encontrado", 23"cerrar" : "Cerrar", 24"tamanio_real" : "Tamaño real", 25"ver_perfil_eskup" : "Ver perfil en Eskup", 26"teclear_usuario" : "Tienes que teclear usuario y contraseña", 27"error_correo" : "El campo 'usuario' no parece un correo electrónico. Por favor, revÃÂsalo.", 28"foto" : "Foto", 29"tamanio_ventana" : "Tamaño ventana", 30"ver_perfil_completo" : "Ver perfil completo", 31"avatar" : "Avatar", 32"ver_video": "Ver vÃÂdeo", 33"vervideo_svg": "//ep00.epimg.net/reproductores/vervideo.svg", 34"directo":"EMISIÃâN EN DIRECTO", 35"siguiente_noticia": "Siguiente noticia", 36"anterior_noticia": "Noticia anterior", 37"primera_noticia": "No hay noticia anterior", 38"ultima_noticia": "No hay más noticias" 39}, 40"pt-br":{ 41"trans_no_disponible":"IndisponÃÂvel para este dispositivo", 42"trans_no_comenzado" : "La retransmisión aún no ha comenzado", 43"trans_reanudara" : "La retransmisión se reanudará en breve", 44"trans_finalizada" : "La retransmisión ha finalizado", 45"publicidad" : "Publicidade", 46"actualizar_plugin" : "Você precisa atualizar seu plugin Flash", 47"no_mp4" : "O navegador não suporta vÃÂdeo HTML5/MP4", 48"no_mp3" : "O navegador não suporta HTML5/MP3", 49"geobloqueado" : "VÃÂdeo não disponÃÂvel para sua região", 50"bloqueado" : "Contenido compartido bloqueado", 51"aun_no_disponible" : "O vÃÂdeo ainda não está disponÃÂvel", 52"no_disponible" : "O vÃÂdeo não está mais disponÃÂvel", 53"audio_geobloqueado" : "Audio no disponible en su zona geográfica", 54"audio_aun_no_disponible" : "Audio no disponible todavÃÂa", 55"audio_no_disponible" : "Audio ya no disponible", 56"audio_no_encontrado": "Audio no encontrado", 57"necesita_plugin" : "Você precisa instalar o plugin flash para ver este conteúdo", 58"no_encontrado": "VÃÂdeo não encontrado", 59"cerrar" : "Fechar", 60"tamanio_real" : "Tamanho real", 61"ver_perfil_eskup" : "Ver perfil em Eskup", 62"teclear_usuario" : "Digite usuário e senha", 63"error_correo" : "O campo 'usuário' não parece ser um e-mail. Por favor, verifique", 64"foto" : "Foto", 65"tamanio_ventana" : "Tamanho Janela", 66"ver_perfil_completo" : "Ver perfil completo", 67"avatar" : "Avatar", 68"ver_video": "Ver vÃÂdeo", 69"vervideo_svg": "//ep00.epimg.net/reproductores/vervideo_pt-br.svg", 70"directo":"AO VIVO", 71"siguiente_noticia": "Próxima notÃÂcia", 72"anterior_noticia": "NotÃÂcias anteriores", 73"primera_noticia": "Nenhuma notÃÂcia anterior", 74"ultima_noticia": "Sem mais notÃÂcias" 75}, 76"ca":{ 77"trans_no_disponible":"Transmissió no disponible per a aquest dispositiu", 78"trans_no_comenzado" : "La retransmissió encara no ha començat", 79"trans_reanudara" : "La retransmissió es reprendrà aviat", 80"trans_finalizada" : "La retransmissió ha finalitzat", 81"publicidad" : "Publicitat", 82"actualizar_plugin" : "Necessites actualitzar el teu plugin de Flash", 83"no_mp4" : "El navegador no admet vÃÂdeo HTML5/MP4", 84"no_mp3" : "El navegador no admet HTML5/MP3", 85"geobloqueado" : "VÃÂdeo no disponible en la seva zona geogrà fica", 86"bloqueado" : "Contingut compartit bloquejat",
87"aun_no_disponible" : "El vÃÂdeo encara no està disponible", 88"no_disponible" : "El vÃÂdeo ja no està disponible", 89"audio_geobloqueado" : "ÃÂudio no disponible en la seva zona geogrà fica", 90"audio_aun_no_disponible" : "Ãâ¬udio no disponible encara", 91"audio_no_disponible" : "Ãâ¬udio ja no disponible", 92"audio_no_encontrado": "ÃÂudio no trobat", 93"necesita_plugin" : "Necessita instal÷lar el plugin de Flash per veure aquest contingut", 94"no_encontrado": "VÃÂdeo no trobat", 95"cerrar" : "Tancar", 96"tamanio_real" : "Mida real", 97"ver_perfil_eskup" : "Veure perfil en Eskup", 98"teclear_usuario" : "Has de teclejar usuari i contrasenya", 99"error_correo" : "El camp 'usuari' no sembla un correu electrònic. Sisplau, revisa'l", 100"foto" : "Foto", 101"tamanio_ventana" : "Mida finestra", 102"ver_perfil_completo" : "Veure perfil complet", 103"avatar" : "Avatar", 104"ver_video": "Veure VÃÂdeo", 105"vervideo_svg": "//ep00.epimg.net/reproductores/vervideo_ca.svg", 106"directo":"EMISSIÃâ EN DIRECTE", 107"siguiente_noticia": "Propera notÃÂcia", 108"anterior_noticia": "NotÃÂcia anterior", 109"primera_noticia": "No hi ha notÃÂcia anterior", 110"ultima_noticia": "No hi ha més notÃÂcies" 111} 112}; 113var MPEP_idioma = "es"; 114var MPEP_responsive = (typeof(MPEP_responsive) != "undefined") ? MPEP_responsive : false; 115function parseaMetas() { 116var metas = document.getElementsByTagName('meta'); 117var idioma_meta = ""; 118var i; 119for (i=0; i<metas.length; i++) { 120if (metas[i].getAttribute("name") == "lang") { 121idioma_meta = (metas[i].getAttribute("content")).toLowerCase(); 122} 123if (metas[i].getAttribute("name") == "viewport") 124MPEP_responsive = true; 125} 126if ( LANG_MSG.hasOwnProperty(idioma_meta) ) { 127MPEP_idioma = idioma_meta; 128} 129} 130parseaMetas(); 131if (typeof(LANG) == "undefined") 132var LANG = MPEP_idioma; 133else 134{ 135if ( !LANG_MSG.hasOwnProperty(LANG) ) 136{ 137LANG = "es"; 138} 139} 140 141var isOpera = null; 142var isSafari = null; 143var isGecko = null; 144var isIE = null; 145var isMobile = null; 146var userAgent = navigator.userAgent.toLowerCase(); 147var ua=navigator.userAgent, userAgentMatches; 148if ((/KHTML/).test(ua)) { 149isSafari=1; 150} 151userAgentMatches=ua.match(/AppleWebKit\/([^\s]*)/); 152if (userAgentMatches&&userAgentMatches[1]) { 153isSafari=parseFloat(userAgentMatches[1]); 154} 155if (!isSafari) { 156userAgentMatches=ua.match(/Opera[\s\/]([^\s]*)/); 157if (userAgentMatches&&userAgentMatches[1]) { 158isOpera=parseFloat(userAgentMatches[1]); 159} else { 160userAgentMatches=ua.match(/MSIE\s([^;]*)/); 161if (userAgentMatches&&userAgentMatches[1]) { 162isIE=parseFloat(userAgentMatches[1]); 163} else { 164userAgentMatches=ua.match(/Gecko\/([^\s]*)/); 165if (userAgentMatches) { 166isGecko=1; 167} 168} 169} 170} 171if (typeof(getInternetExplorerVersion) == "undefined") 172{ 173getInternetExplorerVersion = function(){ 174var rv = 0; 175if (navigator.appName == 'Microsoft Internet Explorer') 176{ 177var ua = navigator.userAgent; 178var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); 179if (re.exec(ua) != null) 180rv = parseFloat( RegExp.$1 ); 181} 182else if (navigator.appName == 'Netscape') 183{ 184var ua = navigator.userAgent; 185var re = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})"); 186if (re.exec(ua) != null) 187rv = parseFloat( RegExp.$1 ); 188} 189return rv; 190} 191} 192var IEv = getInternetExplorerVersion(); 193var isIphone = false; 194var isIpad = false; 195if (userAgent.indexOf("iphone") > -1) 196isIphone = true 197else 198if (userAgent.indexOf("ipad") > -1) 199isIpad = true; 200var iDevice = (isIphone || isIpad); 201var dispositivoMovil = iDevice || userAgent.indexOf("android") > -1 || userAgent.indexOf("mobile") > -1; 202var dimensionesPEP = EPETBrowserDims(); 203if (typeof(anchoReferenciaMobile) == "undefined" ) 204var anchoReferenciaMobile = 600; 205var ev_reescalado; 206EPETaddEvent(window, orientationEvent, function(){ 207clearTimeout(ev_reescalado); 208ev_reescalado = setTimeout( function() { 209dimensionesPEP = EPETBrowserDims(); 210}, 300) 211}); 212 213if (typeof(UN) == "undefined" ) 214var UN = "ep"; 215 216var versionMovil = document.location.pathname.indexOf("/m/") == 0; 217 218if (typeof(url_cache) == "undefined" ) 219{ 220if (document.location.protocol == "https:") 221var url_cache = "https://ep02.epimg.net"; 222else 223var url_cache = "http://ep02.epimg.net"; 224} 225var datosMPEP = {"urlCacheMPEP":url_cache}; 226if (typeof(css_multimedia) == "undefined" ) 227var css_multimedia = "//ep00.epimg.net/estilos/multimedia/multimedia.css"; 228if (typeof(url_reproductor_epet) == "undefined" ) 229var url_reproductor_epet = "/reproductores/playerPEP.swf"; 230if (typeof(url_reproductor_epet_live) == "undefined" ) 231var url_reproductor_epet_live = "/reproductores/playerPEP_live.swf"; 232if (typeof(UrlPublicidad) == "undefined") 233var UrlPublicidad = "//pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=%2F7811748%2Felpais_web%2Fplayer_video%2Fflash&ciu_szs=&impl=s&gdfp_req=1&env=vp&output=vast&correlator={random}&unviewed_position_start=1"; 234if (typeof(UrlPublicidadOveron) == "undefined") 235var UrlPublicidadOveron = "//pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=%2F7811748%2Foveron_player%2Felpais_web%2Fflash&ciu_szs=&impl=s&gdfp_req=1&env=vp&output=vast&correlator={random}&unviewed_position_start=1"; 236if (typeof(UrlPublicidadCnbc) == "undefined") 237var UrlPublicidadCnbc = "//pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=%2F7811748%2Felpais_cnbc_player_web%2Fflash&ciu_szs=&impl=s&gdfp_req=1&env=vp&output=vast&correlator={random}&unviewed_position_start=1"; 238if (typeof(postroll_HTML5) == "undefined") 239var postroll_HTML5 = true; 240if (typeof(publicidad_HTML5) == "undefined") 241var publicidad_HTML5 = true; 242if (typeof(modoSiguientesVideos) == "undefined") 243var modoSiguientesVideos = 0; 244if (typeof(modoSiguientesVideosTimeout) == "undefined") 245var modoSiguientesVideosTimeout = 5; 246if (typeof(controlesNativosAudio) == "undefined") 247var controlesNativosAudio = false;
248if (typeof(controlesNativosVideo) == "undefined") 249var controlesNativosVideo = false; 250if (typeof(orden_busqueda_url_externa) == 'undefined') 251var orden_busqueda_url_externa = ["muzu","youtube"]; 252var code_ima3_HTML5_cargado = "nocargado"; 253var volumen_global = 1; 254function arreglaUrl(url) 255{ 256var result; 257if (!url.match(/youtu/i)) 258{ 259if (url.match(/muzu/i)) 260url = url.replace("/a/","/i/"); 261else if(url.match(/vimeo/i)){ 262if(url.match(/player/i)){ 263return url; 264}else{ 265var reg = /\/\d*$/; 266var idVimeo = reg.exec(url); 267if(idVimeo[0]) return "//player.vimeo.com/video"+idVimeo[0]; 268} 269} 270return url; 271} 272else 273{ 274var esYT = /youtube.*\/embed\//i; 275if (!esYT.test(url)) 276{ 277var reg = /([^\/]*\/\/[^\/]*youtube[^\/]*)\/.*v=([^&]+)/i; 278result = reg.exec(url); 279if (result) 280{ 281return result[1] + "/embed/" + result[2]; 282} 283else 284{ 285var esYTCorta = /\/\/youtu\.be\/([^\?\/]+)/ 286result = esYTCorta.exec(url); 287if (result) 288return "//www.youtube.com/embed/" + result[1]; 289} 290} 291return url; 292} 293} 294if (typeof(eligeUrlenlace) == 'undefined') 295{ 296function eligeUrlenlace(arrayUrls) 297{ 298var n = arrayUrls.length; 299if (n == 0) 300return ""; 301if (n == 1) 302return arreglaUrl(arrayUrls[0]); 303var re; 304var regexp; 305var cadena_urls; 306var result; 307cadena_urls = "||" + arrayUrls.join("||") + "||"; 308for (i=0; i< orden_busqueda_url_externa.length; i++) 309{ 310re = "/" + "\\|\\|([^\\/]*\\/\\/[^\\/]*" + orden_busqueda_url_externa[i] + "[^\\/]*\\/?[^\\|\\|]*)\\|\\|" + "/"; 311regexp = new RegExp(eval(re)); 312result = regexp.exec(cadena_urls); 313if (result) 314{ 315return arreglaUrl(result[1]); 316} 317} 318return arreglaUrl(arrayUrls[0]); 319} 320} 321var PAGE_TITLE = (document.getElementsByTagName('title')[0] ) ? document.getElementsByTagName('title')[0].innerHTML.replace(/'|"|\|/g, "") : "sin tÃÂtulo"; 322var supportsOrientationChange = "onorientationchange" in window; 323var orientationEvent = supportsOrientationChange ? "orientationchange" : "resize"; 324var connectionPEP = navigator.connection || navigator.mozConnection || navigator.webkitConnection; 325var FlashDetect = new function(){ 326var self = this; 327self.release = "1.0.2"; 328self.installed = false; 329self.major = -1; 330self.minor = -1; 331self.revision = -1; 332self.revisionStr = ""; 333self.activeXVersion = ""; 334var activeXDetectRules = [ 335{ 336"name":"ShockwaveFlash.ShockwaveFlash.7", 337"version":function(obj){ 338return getActiveXVersion(obj); 339} 340}, 341{ 342"name":"ShockwaveFlash.ShockwaveFlash.6", 343"version":function(obj){ 344var version = "6,0,21"; 345try{ 346obj.AllowScriptAccess = "always"; 347version = getActiveXVersion(obj); 348}catch(err){} 349return version; 350} 351}, 352{ 353"name":"ShockwaveFlash.ShockwaveFlash", 354"version":function(obj){ 355return getActiveXVersion(obj); 356} 357} 358]; 359var getActiveXVersion = function(activeXObj){ 360var version = -1; 361try{ 362version = activeXObj.GetVariable("$version"); 363}catch(err){} 364return version; 365}; 366var getActiveXObject = function(name){ 367var obj = -1; 368try{ 369obj = new ActiveXObject(name); 370}catch(err){} 371return obj; 372}; 373var parseActiveXVersion = function(str){ 374var versionArray = str.split(","); 375return { 376"major":parseInt(versionArray[0].split(" ")[1], 10), 377"minor":parseInt(versionArray[1], 10), 378"revision":parseInt(versionArray[2], 10), 379"revisionStr":versionArray[2] 380}; 381}; 382var parseRevisionStrToInt = function(str){ 383return parseInt(str.replace(/[a-zA-Z]/g, ""), 10) || self.revision; 384}; 385self.majorAtLeast = function(version){ 386return self.major >= version; 387}; 388self.FlashDetect = function(){ 389if(navigator.plugins && navigator.plugins.length>0){ 390var type = 'application/x-shockwave-flash'; 391var mimeTypes = navigator.mimeTypes; 392if(mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && mimeTypes[type].enabledPlugin.description){ 393var desc = mimeTypes[type].enabledPlugin.description; 394var descParts = desc.split(' '); 395var majorMinor = descParts[2].split('.'); 396self.major = parseInt(majorMinor[0], 10); 397self.minor = parseInt(majorMinor[1], 10); 398self.revisionStr = descParts[3]; 399self.revision = parseRevisionStrToInt(self.revisionStr); 400self.installed = true; 401} 402}else if(navigator.appVersion.indexOf("Mac")==-1 && window.execScript){ 403var version = -1; 404for(var i=0; i<activeXDetectRules.length && version==-1; i++){ 405var obj = getActiveXObject(activeXDetectRules[i].name); 406if(typeof obj == "object"){ 407self.installed = true; 408version = activeXDetectRules[i].version(obj); 409if(version!=-1){ 410var versionObj = parseActiveXVersion(version); 411self.major = versionObj.major; 412self.minor = versionObj.minor; 413self.revision = versionObj.revision; 414self.revisionStr = versionObj.revisionStr; 415self.activeXVersion = version; 416} 417} 418} 419} 420}(); 421}; 422var versionFlash = FlashDetect.major; 423var revisionFlash = FlashDetect.revisionStr; 424var subVersionFlash = revisionFlash.replace(/[^\d]+/g, ""); 425function EPET_FlashHTML(minVersion, source, width, height, op, id){ 426var self = this; 427var baseElement = document.createElement("div"); 428var options = arguments[4] || {}; 429var winIE = ((navigator.appVersion.toLowerCase().indexOf("win")!=-1) && (navigator.appName=="Microsoft Internet Explorer")); 430var idCount = EPET_FlashHTML.idCount++; 431var namespaceAdded = false;
432var namespaceName = "flashtml"; 433var namespaceURN = "http://www.featureblend.com/2007/flashtml/"; 434if (typeof(id) == "undefined" ) 435var id = "objetoFlash" + String(Math.random()).substr(2,9); 436var idObjeto = id; 437self.domTemplate = ""; 438self.innerHTML = ""; 439self.xhtml = ""; 440self.inDocumentElement = ""; 441var getCabVersion = function(minVersion){ 442return minVersion + ",0,0,0"; 443}; 444var getNameValueAttrFromOptions = function(name){ 445return (typeof options[name] != "undefined")?getNameValueAttributes(name, options[name].toString()):""; 446}; 447var getNameValueAttributes = function(name, value){ 448return { 449"@name":name, 450"@value":value 451}; 452}; 453var createElementFromRule = function(name, target){ 454var newElement = safeCreateElement(name.replace("#","")); 455return target.appendChild(newElement); 456}; 457var getID = function(){ 458if (idObjeto != undefined && idObjeto != "") 459return idObjeto; 460var patron = /.*\/([\w-]+)\.swf\??/i; 461if (patron.test(source)) 462{ 463return (RegExp.$1); 464} 465return "ObjetoSWF"; 466}; 467var setAttributeFromRule = function(name, value, target){ 468target.setAttribute(name.replace("@",""), value); 469}; 470var safeCreateElement = function(name){ 471if((name=="object" || name=="param") && document.namespaces){ 472if(!namespaceAdded){ 473document.namespaces.add(namespaceName, namespaceURN); 474namespaceAdded = true; 475} 476return document.createElement(namespaceName + ":" + name); 477}else{ 478return document.createElement(name); 479} 480}; 481var htmlTidy = function(str){ 482str = str.replace(/<\?xml([^>]*)>/, ""); 483str = str.replace(eval("/"+namespaceName+":/g"),""); 484str = str.replace(/><\/param>/g,">"); 485str = str.replace(/(<param )(.*?)(>)/g, "<param $2 \/>"); 486return str; 487}; 488var parseRules = function(position, target){ 489for(var i in position){ 490if(i.charAt(0)=="#"){ 491var appendedElement; 492if(typeof position[i] == "object" && position[i].length){ 493for(var j=0; j<position[i].length; j++){ 494if(position[i][j]()!==""){ 495appendedElement = createElementFromRule(i, target); 496parseRules(position[i][j](), appendedElement); 497} 498} 499}else if(typeof position[i]=="function" && position[i]()!==""){ 500appendedElement = createElementFromRule(i, target); 501parseRules(position[i](), appendedElement); 502} 503}else if(i.charAt(0)=="@"){ 504if(typeof position[i]=="function" && position[i]()!==""){ 505setAttributeFromRule(i, position[i](), target); 506}else if(typeof position[i] == "string"){ 507setAttributeFromRule(i, position[i], target); 508} 509} 510} 511}; 512var structuralRules = { 513"#object":function(){ 514return { 515"@type":function(){ 516return (!winIE)?"application/x-shockwave-flash":""; 517}, 518"@codebase":function(){ 519return (winIE)?"http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version="+getCabVersion(minVersion):""; 520}, 521"@classid":function(){ 522return (winIE)?"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000":""; 523}, 524"@data":function(){ 525return (!winIE)?source:""; 526}, 527"@width":function(){ 528return width.toString(); 529}, 530"@height":function(){ 531return height.toString(); 532}, 533"@id":function(){ 534return getID(); 535}, 536"@tabindex":function(){ 537return options.tabindex || ""; 538}, 539"#param":[ 540function(){ 541return (winIE)?getNameValueAttributes("movie", source):""; 542}, 543function(){ 544return getNameValueAttrFromOptions("allowscriptaccess"); 545}, 546function(){ 547return getNameValueAttrFromOptions("allowfullscreen"); 548}, 549function(){ 550return getNameValueAttrFromOptions("swliveconnect"); 551}, 552function(){ 553return getNameValueAttrFromOptions("play"); 554}, 555function(){ 556return getNameValueAttrFromOptions("loop"); 557}, 558function(){ 559return getNameValueAttrFromOptions("menu"); 560}, 561function(){ 562return getNameValueAttrFromOptions("quality"); 563}, 564function(){ 565return getNameValueAttrFromOptions("scale"); 566}, 567function(){ 568return getNameValueAttrFromOptions("align"); 569}, 570function(){ 571return getNameValueAttrFromOptions("salign"); 572}, 573function(){ 574return getNameValueAttrFromOptions("wmode"); 575}, 576function(){ 577return getNameValueAttrFromOptions("bgcolor"); 578}, 579function(){ 580return getNameValueAttrFromOptions("base"); 581}, 582function(){ 583var result = ""; 584if(options.flashvars){ 585var flashVarsStr = (typeof options.flashvars == "object")?EPET_FlashHTML.getQueryStrFromObj(options.flashvars):options.flashvars; 586result = getNameValueAttributes("flashvars", flashVarsStr); 587} 588return result; 589} 590] 591}; 592} 593}; 594self.append = function(target){ 595return addToElement(target, false); 596}; 597self.replace = function(target){ 598return addToElement(target, true); 599}; 600var addToElement = function(target, replace){ 601var result = false;
602var targetObj = (typeof target=="object")?target:document.getElementById(target); 603if(!self.inDocumentElement){ 604if(winIE){ 605if(replace){ 606targetObj.innerHTML = self.xhtml; 607}else{ 608targetObj.innerHTML += self.xhtml; 609} 610self.inDocumentElement = document.getElementById(getID()); 611window.attachEvent("onunload", self.garbageCollection); 612}else{ 613if(replace){ 614while (targetObj.firstChild) { 615targetObj.removeChild(targetObj.firstChild); 616} 617} 618self.inDocumentElement = targetObj.appendChild(baseElement.childNodes[0]); 619} 620result = self.inDocumentElement; 621} 622return result; 623}; 624self.garbageCollection = function(){ 625if(winIE && self.inDocumentElement){ 626self.inDocumentElement = null; 627} 628}; 629self.EPET_FlashHTML = function(){ 630parseRules(structuralRules, baseElement); 631self.domTemplate = baseElement.childNodes[0]; 632self.innerHTML = baseElement.innerHTML; 633self.xhtml = htmlTidy(self.innerHTML); 634}(); 635self.writeHTML = function(){ 636document.write(self.xhtml); 637}; 638} 639EPET_FlashHTML.getQueryStrFromObj = function(nameValue){ 640var str = ""; 641for(var i in nameValue){ 642if(nameValue.hasOwnProperty(i)){ 643str += (encodeURI(i) + "=" + encodeURI(nameValue[i]) + "&"); 644} 645} 646return str.substring(0, str.length-1); 647}; 648EPET_FlashHTML.idCount = 0; 649EPET_FlashHTML.idPattern = "EPET_FlashHTML_"; 650EPET_FlashHTML.release = "1.0.1"; 651function EPET_Grafico_Flash(grafico, GF_version, GF_params, flash_params, GF_width, GF_height, img_altenativa, url_alternativa, texto_alt, idDivContenedor, idObjectFlash) 652{ 653var id_div_Graficoflash; 654if (typeof(idDivContenedor) == "undefined" ) 655{ 656id_div_Graficoflash = "div_GraficoFlash_" + String(Math.random()).substr(2,9);
657document.write('<div id="' + id_div_Graficoflash + '"></div>'); 658} 659else 660id_div_Graficoflash = idDivContenedor; 661if (versionFlash >= GF_version) 662{ 663var params = {"menu":"false", "wmode":"window" }; 664for(var key in flash_params) 665{ 666params[key] = flash_params[key]; 667} 668var cadena_params = ""; 669for(var key in GF_params) 670{ 671cadena_params += encodeURIComponent(key) + "=" + encodeURIComponent(GF_params[key]) + "&"; 672} 673if (cadena_params.length > 0) 674grafico = grafico + "?" + cadena_params.substr(0,cadena_params.length-1); 675var objeto_grafico = new EPET_FlashHTML(GF_version, grafico, GF_width, GF_height, params , idObjectFlash); 676objeto_grafico.replace(id_div_Graficoflash); 677} 678else 679{ 680if (img_altenativa != "") 681{ 682document.getElementById(id_div_Graficoflash).innerHTML = "<a href=\"" + url_alternativa + "\" target=\"_blank\" ><img src=\"" + img_altenativa + "\" width=\"" + GF_width + "\" height=\"" + GF_height + "\" border=\"0\" alt=\"" + texto_alt + "\" /></a>\n"; 683} 684} 685} 686var EPET_Marcado_Multimedia = function(datosMarcado) 687{ 688this._datosMarcado = datosMarcado; 689this.eventos = {}; 690var evars = '70|8|2|74|42|67|24'; 691this.marcaEvento = function(evento) 692{ 693var event = ""; 694var key = evento; 695switch (evento) 696{ 697case "adStart" : 698event = "event13"; 699key = evento + " _" + this._datosMarcado.adCue; 700break; 701case "adComplete" : 702event = "event14"; 703key = evento + " _" + this._datosMarcado.adCue; 704break; 705case "adSkip" : 706event = "event15"; 707key = evento + " _" + this._datosMarcado.adCue; 708break; 709case "adError" : 710event = "event18"; 711key = evento + " _" + this._datosMarcado.adCue; 712break; 713case "mediaBegin" : 714event = "event11"; 715break; 716case "mediaComplete" : 717event = "event12"; 718break; 719case "halfmediaComplete" : 720event = "event79"; 721break; 722case "adRequest" : 723event = "event59"; 724key = evento + " _" + this._datosMarcado.adCue; 725break; 726 727default : 728break; 729} 730if (this.eventos[key]) 731return; 732this.eventos[key] = 1; 733if (event != "") 734{ 735var evars_value = this._datosMarcado.media + "|" + this._datosMarcado.titulo.replace(/'|"|\|/g, "") + " - " + this._datosMarcado.referencia + "|" + (this._datosMarcado.playerName ? this._datosMarcado.playerName.replace(/'|"|\|/g, ""):"") + "|" + Math.floor(this._datosMarcado.duracion) + "|" + this._datosMarcado.tipoReproduccion + "|" + this._datosMarcado.publicidad + (this._datosMarcado.ad != "" ? " " + this._datosMarcado.ad : "" ) + "|" + this._datosMarcado.adCue; 736var newevars = evars; 737if (typeof(this._datosMarcado.adTitle) != "undefined" && this._datosMarcado.adTitle != "") 738{ 739newevars = newevars + "|9"; 740evars_value += "|" + this._datosMarcado.adTitle; 741} 742if (typeof(this._datosMarcado.posSiguientesVideos) != "undefined") 743{ 744newevars = newevars + "|76"; 745evars_value += "|" + this._datosMarcado.posSiguientesVideos; 746} 747if (typeof(this._datosMarcado.uid) != "undefined" && this._datosMarcado.uid != "") 748{ 749newevars = newevars + "|38"; 750evars_value += "|" + this._datosMarcado.uid; 751} 752newevars = newevars + "|25"; 753evars_value += "|" + (this._datosMarcado.fuente ? this._datosMarcado.fuente : "propio"); 754if (typeof(this._datosMarcado.seccion_creacion) != "undefined" && this._datosMarcado.seccion_creacion != "") 755{ 756newevars = newevars + "|77"; 757evars_value += "|" + this._datosMarcado.seccion_creacion; 758} 759if (typeof(this._datosMarcado.modoReproduccion) != "undefined" && this._datosMarcado.modoReproduccion != "") 760{ 761newevars = newevars + "|26"; 762evars_value += "|" + this._datosMarcado.modoReproduccion; 763} 764if (typeof(launchAjaxOMN) == "function") 765launchAjaxOMN(newevars, evars_value, event,this._datosMarcado.tags, this._datosMarcado.autores); 766} 767} 768} 769function marcadoReproductorMultimedia(datos) 770{ 771var objetoVideo = MultimediaPEP[datos.id].multimedia; 772datos.uid = objetoVideo.uid(); 773datos.seccion_creacion = objetoVideo.seccion_creacion(); 774datos.fuente = objetoVideo.fuente(); 775datos.tags = objetoVideo.tags(); 776datos.autores = objetoVideo.autores(); 777objetoVideo.marcado(datos); 778} 779var videoFlash = versionFlash > 11 || (versionFlash == 11 && FlashDetect.minor >= 1); 780if (dispositivoMovil && (userAgent.indexOf("firefox") > -1 || userAgent.indexOf("android 2") > -1)) 781publicidad_HTML5 = false; 782var reproduciendo = false;
783var MultimediaActual = ""; 784var MultimediaPEP = {}; 785var id_pidiendoDatos = ""; 786var contadorMultimedia = 0; 787function soporteVideo() 788{ 789var v=document.createElement('video'); 790return typeof(v.canPlayType) != "undefined" && (!!v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,'') || !!v.canPlayType( 'video/mp4; codecs="avc1.42E01E"').replace(/no/,'')); 791} 792var canPlayMP4 = soporteVideo(); 793var canPlayHLS = (window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')); 794function EPETaddEvent (element, evento, func) { 795if (document.addEventListener){ 796element.addEventListener(evento, func, false); 797} else { 798element.attachEvent('on'+evento, func); 799} 800} 801function EPETremoveEvent(element, evento, func) 802{ 803if (document.removeEventListener) 804element.removeEventListener(evento, func) 805else 806if (document.detachEvent) 807element.detachEvent('on'+evento, func); 808} 809function EPET_setScrollPosition(val) 810{ 811if (document.documentElement.scrollTop) 812document.documentElement.scrollTop = val 813else 814window.scrollTo(0,val); 815} 816function EPET_calculaTopPosition(obj) 817{ 818var curTop = 0; 819if (obj.offsetParent) { 820do { 821curTop += obj.offsetTop; 822} while (obj = obj.offsetParent); 823} 824return curTop; 825} 826function VideoReproduciendo(id, play) 827{ 828MultimediaReproduciendo(id, play) 829} 830function MultimediaReproduciendo(id, play) 831{ 832if ( MultimediaActual != "" && id != MultimediaActual) 833{ 834MultimediaPEP[MultimediaActual].multimedia.pause(); 835var datos; 836var newid = MultimediaPEP[MultimediaActual].id; 837if (MultimediaPEP[MultimediaActual].modoSiguientesVideos == 0) 838{ 839document.getElementById(MultimediaPEP[MultimediaActual].id).innerHTML = ""; 840datos = MultimediaPEP[MultimediaActual].datos; 841delete MultimediaPEP[MultimediaActual]; 842datos.autoplay = false; 843EPET_VideoPlayer(datos, newid); 844} 845else { 846if (MultimediaPEP[MultimediaActual].id != MultimediaPEP[id].id) { 847MultimediaPEP[MultimediaActual].multimedia.pause(); 848resetSiguientesVideos(); 849clearTimeout(SiguientesVideosPEP.cuenta_atras); 850document.getElementById(MultimediaPEP[MultimediaActual].id).innerHTML = ""; 851datos = JSON.parse(JSON.stringify(MultimediaPEP_originales[MultimediaPEP[MultimediaActual].id])); 852document.getElementById(MultimediaPEP[MultimediaActual].id).style.paddingTop = '0px'; 853document.getElementById(MultimediaPEP[MultimediaActual].id).style.marginLeft = '0px'; 854delete MultimediaPEP[MultimediaActual]; 855datos.autoplay = false; 856var video = new EPET_Video(datos, newid); 857} 858} 859if (play) 860setTimeout(function() { MultimediaPEP[id].multimedia.play();}, 300); 861} 862MultimediaActual = id; 863} 864function MultimediaReinicio(id) 865{ 866MultimediaPEP[id].multimedia.resetMarcado(id); 867} 868function MultimediaSeeking(id) 869{ 870MultimediaPEP[id].multimedia.seeking(); 871} 872function MultimediaSeeked(id) 873{ 874MultimediaPEP[id].multimedia.seeked(); 875} 876function reseteaVideo(datosVideo, id_div_ReproductorVideo,id) 877{ 878MultimediaPEP[id].multimedia.stop(); 879} 880var MultimediaPEP_originales = {}; 881var SiguientesVideosPEP = {}; 882SiguientesVideosPEP.dataSources = {}; 883SiguientesVideosPEP.source_active = ""; 884SiguientesVideosPEP.ref_active = ""; 885SiguientesVideosPEP.id_ref_active = ""; 886SiguientesVideosPEP.videoWallData = null; 887SiguientesVideosPEP.videoWall_primera_vez = false;
888SiguientesVideosPEP._id = ""; 889SiguientesVideosPEP._datos = ""; 890SiguientesVideosPEP.cuenta_atras = null; 891SiguientesVideosPEP.cuenta_atras_error = null; 892SiguientesVideosPEP.segundos = modoSiguientesVideosTimeout; 893SiguientesVideosPEP.keyword_primero = "user_initiated"; 894SiguientesVideosPEP.keyword_siguientes = "auto_initiated"; 895SiguientesVideosPEP.fuente_unica = 'videos_destacados'; 896SiguientesVideosPEP.id_fuente_unica = '200000'; 897SiguientesVideosPEP.paraBorrar = []; 898SiguientesVideosPEP.template = '<div class="MPEP-principal MPEP-estirar #classmin#"><div class="MPEP-prox-video MPEP-estirar">'+ 899'<div class="MPEP-inner MPEP-estirar">'+ 900'<div class="MPEP-prox-btn-ctrl MPEP-estirar">'+ 901'<a class="MPEP-prox-btn-ant" href="javascript:void(0)" onclick="javascript:volver_a_ver()"><span>Volver a ver</span></a>'+ 902'<a class="MPEP-prox-btn-sig" href="javascript:void(0)" onclick="javascript:cargaVideo(false,\'organico\')"><span>Siguiente</span></a>'+ 903'</div>'+ 904'<span class="MPEP-prox-cont">Siguiente vÃÂdeo en <strong id="siguientes_contador">5</strong> segundos</span>'+ 905'<div class="MPEP-prox-video-media"><a href="javascript:void(0)" onclick="javascript:cargaVideo(false,\'organico\')"><img class="MPEP-prox-video-img" src="#foto#" alt="" /></a></div>'+ 906'<div class="MPEP-prox-video-txt">'+ 907'<div class="MPEP-prox-tit"><a href="javascript:void(0)" onclick="javascript:cargaVideo(false,\'organico\')">#titulo#</a></div>'+ 908'</div>'+ 909'</div>'+ 910'</div>'+ 911'</div></div>'; 912SiguientesVideosPEP.video = ""; 913SiguientesVideosPEP.primeraVez = false; 914function siguientesVideos(fuente, referencia) 915{ 916var id_contenedor = MultimediaPEP[referencia].id; 917SiguientesVideosPEP.source_active = fuente; 918SiguientesVideosPEP.ref_active = referencia; 919SiguientesVideosPEP.id_ref_active = id_contenedor; 920SiguientesVideosPEP.primeraVez = false; 921if (typeof(SiguientesVideosPEP.dataSources[fuente]) != "undefined") 922{ 923videosSiguientes_callback(SiguientesVideosPEP.dataSources[fuente].datos) 924} 925else 926{ 927var head = document.getElementsByTagName("head")[0]; 928var script = document.createElement("script"); 929script.type = "text/javascript"; 930script.src = "//ep00.epimg.net/rss/tags/continuo/c_" + fuente + ".js2"; 931head.appendChild(script); 932SiguientesVideosPEP.primeraVez = true; 933} 934} 935function barajaArray(ref) { 936var salida = new Array; 937var copia = JSON.parse(JSON.stringify(ref)); 938while (copia.length > 0) 939{ 940salida.push(copia.splice(Math.floor(Math.random() * copia.length),1)[0]); 941} 942return salida; 943} 944function videosSiguientes_callback(datos) 945{ 946if (!SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active]) 947{ 948SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active] = {}; 949SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active].datos = datos; 950} 951if (SiguientesVideosPEP.videoWallData == null) 952{ 953if (SiguientesVideosPEP.primeraVez) 954SiguientesVideosPEP.videoWallData = JSON.parse(JSON.stringify(SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active].datos)); 955else 956SiguientesVideosPEP.videoWallData = barajaArray(SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active].datos); 957SiguientesVideosPEP.videoWallData.unshift(JSON.parse(JSON.stringify(MultimediaPEP_originales[SiguientesVideosPEP.id_ref_active]))); 958} 959if (!SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active][SiguientesVideosPEP.id_ref_active]) 960{ 961SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active][SiguientesVideosPEP.id_ref_active] = {}; 962SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active][SiguientesVideosPEP.id_ref_active].idx = 1; 963SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active][SiguientesVideosPEP.id_ref_active].ancho = MultimediaPEP[SiguientesVideosPEP.ref_active].datos.anchoPlayer; 964SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active][SiguientesVideosPEP.id_ref_active].alto = MultimediaPEP[SiguientesVideosPEP.ref_active].datos.altoPlayer; 965SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active][SiguientesVideosPEP.id_ref_active].source = SiguientesVideosPEP.source_active; 966} 967else 968{ 969SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active][SiguientesVideosPEP.id_ref_active].idx += 1; 970} 971cargaSiguienteVideo(SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active], SiguientesVideosPEP.ref_active) 972} 973function reajustaDimensiones(cajaw, cajah, videow, videoh) 974{ 975var salida = [0,0,0,0]; 976var prop1 = cajaw * videoh / videow; 977if ( prop1 > cajah) 978{ 979salida[1] = cajah; 980salida[0] = Math.floor(cajah * videow / videoh); 981salida[2] = Math.round((cajaw - salida[0]) / 2); 982} 983else 984{ 985salida[0] = cajaw; 986salida[1] = Math.floor(prop1); 987salida[3] = Math.round((cajah - salida[1]) /2); 988} 989return salida; 990} 991function cargaSiguienteVideo(ref_datos, id_actual) 992{ 993var id_video = id_actual.replace(/\-\d+$/, ""); 994SiguientesVideosPEP._id = MultimediaPEP[id_actual].id; 995var dims; 996cargaVideo = function(pause, modo) { 997clearTimeout(SiguientesVideosPEP.cuenta_atras); 998MultimediaActual = id_actual; 999if (!dispositivoMovil && !pause) 1000SiguientesVideosPEP._datos.autoplay = true; 1001else 1002SiguientesVideosPEP._datos.autoplay = false;
1003document.getElementById(SiguientesVideosPEP._id).innerHTML = ""; 1004if (typeof(modo) == "undefined") 1005SiguientesVideosPEP._datos.modoReproduccion = "secuencial"; 1006else 1007SiguientesVideosPEP._datos.modoReproduccion = modo; 1008SiguientesVideosPEP.video = new EPET_Video(SiguientesVideosPEP._datos, SiguientesVideosPEP._id, true); 1009}; 1010if (!SiguientesVideosPEP.videoWall_primera_vez) 1011{ 1012SiguientesVideosPEP.videoWall_primera_vez = true; 1013for (var n=SiguientesVideosPEP.paraBorrar.length-1; n>=0; n--) 1014{ 1015var id = SiguientesVideosPEP.paraBorrar.splice(i,1); 1016delete(MultimediaPEP[id[0]]); 1017} 1018for (var i = SiguientesVideosPEP.videoWallData.length - 1; i >= 0; i--) 1019{ 1020dims = reajustaDimensiones(ref_datos[SiguientesVideosPEP._id].ancho, ref_datos[SiguientesVideosPEP._id].alto, SiguientesVideosPEP.videoWallData[i].anchoPlayer, SiguientesVideosPEP.videoWallData[i].altoPlayer); 1021if ((i > 0 && (SiguientesVideosPEP.videoWallData[i].idRefBrightcove + UN) == id_video) || dims[2] > 20 || dims[3] > 20) 1022{ 1023SiguientesVideosPEP.videoWallData.splice(i,1); 1024continue; 1025} 1026SiguientesVideosPEP.videoWallData[i].anchoPlayer = dims[0]; 1027SiguientesVideosPEP.videoWallData[i].altoPlayer = dims[1]; 1028SiguientesVideosPEP.videoWallData[i].anchoFotograma = dims[0]; 1029SiguientesVideosPEP.videoWallData[i].altoFotograma = dims[1]; 1030SiguientesVideosPEP.videoWallData[i].playerEPETParams.mediaWidth = dims[0]; 1031SiguientesVideosPEP.videoWallData[i].playerEPETParams.mediaHeight = dims[1]; 1032SiguientesVideosPEP.videoWallData[i].ancho_caja = ref_datos[SiguientesVideosPEP._id].ancho; 1033SiguientesVideosPEP.videoWallData[i].alto_caja = ref_datos[SiguientesVideosPEP._id].alto; 1034SiguientesVideosPEP.videoWallData[i].left = dims[2]; 1035SiguientesVideosPEP.videoWallData[i].top = dims[3]; 1036SiguientesVideosPEP.videoWallData[i].agrsNombreNormalizado = SiguientesVideosPEP.fuente_unica; 1037SiguientesVideosPEP.videoWallData[i].agrsIds = SiguientesVideosPEP.id_fuente_unica; 1038SiguientesVideosPEP.videoWallData[i].autoplay = dispositivoMovil ? false : true; 1039SiguientesVideosPEP.videoWallData[i].idx_siguientes_videos = i; 1040} 1041} 1042var idx = ref_datos[SiguientesVideosPEP._id].idx; 1043if (idx >= SiguientesVideosPEP.videoWallData.length) 1044{ 1045clearTimeout(SiguientesVideosPEP.cuenta_atras); 1046SiguientesVideosPEP._datos = SiguientesVideosPEP.videoWallData[0]; 1047cargaVideo(true); 1048resetSiguientesVideos(); 1049return; 1050} 1051var cuenta = SiguientesVideosPEP.segundos; 1052cuentaAtras = function () 1053{ 1054if (cuenta > 0) 1055{ 1056if (!document.getElementById("siguientes_contador")) 1057return; 1058document.getElementById("siguientes_contador").innerHTML = cuenta; 1059cuenta--; 1060SiguientesVideosPEP.cuenta_atras = setTimeout('cuentaAtras()',1000); 1061} 1062else 1063{ 1064cargaVideo(); 1065} 1066}; 1067volver_a_ver = function() 1068{ 1069clearTimeout(SiguientesVideosPEP.cuenta_atras); 1070ref_datos[SiguientesVideosPEP._id].idx -= 1; 1071SiguientesVideosPEP._datos = JSON.parse(JSON.stringify(SiguientesVideosPEP.videoWallData[ref_datos[SiguientesVideosPEP._id].idx])); 1072cargaVideo(false,'organico'); 1073if (SiguientesVideosPEP.video.tipo() == "html5" && SiguientesVideosPEP._datos.autoplay ) 1074SiguientesVideosPEP.video.play(); 1075}; 1076SiguientesVideosPEP._datos = JSON.parse(JSON.stringify(SiguientesVideosPEP.videoWallData[ref_datos[SiguientesVideosPEP._id].idx])); 1077var codigo = SiguientesVideosPEP.template.replace("#titulo#", SiguientesVideosPEP._datos.tituloVideo.replace('"','')); 1078codigo = codigo.replace("#foto#",SiguientesVideosPEP._datos.playerEPETParams.URLMediaStill); 1079if (SiguientesVideosPEP._datos.ancho_caja < 420) 1080{ 1081codigo = codigo.replace('#classmin#','MPEP-420'); 1082} 1083else 1084{ 1085codigo = codigo.replace('#classmin#',''); 1086} 1087document.getElementById(SiguientesVideosPEP._id).style.paddingTop = "0px"; 1088document.getElementById(SiguientesVideosPEP._id).style.marginLeft = "0px"; 1089document.getElementById(SiguientesVideosPEP._id).innerHTML = codigo; 1090document.getElementById(SiguientesVideosPEP._id).style.marginLeft = "auto"; 1091document.getElementById(SiguientesVideosPEP._id).style.marginRight = "auto"; 1092cuentaAtras(); 1093} 1094function resetSiguientesVideos() 1095{ 1096SiguientesVideosPEP.videoWallData = null; 1097SiguientesVideosPEP.videoWall_primera_vez = false;
1098if (typeof(SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active]) != "undefined" && typeof(SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active][SiguientesVideosPEP.id_ref_active]) != "undefined") 1099delete(SiguientesVideosPEP.dataSources[SiguientesVideosPEP.source_active][SiguientesVideosPEP.id_ref_active]); 1100} 1101function EPET_PlayerRetransmisionDirecto(datosTransmision, id_divContenedor, estado) 1102{ 1103url_reproductor_epet = url_reproductor_epet_live; 1104if (typeof(retransmisiones) != "undefined" && typeof(retransmisiones[datosTransmision.refRetransmisionBC]) != "undefined") 1105datosTransmision.refRetransmisionBC = retransmisiones[datosTransmision.refRetransmisionBC]; 1106var id_div_ReproductorVideo; 1107if (typeof(id_divContenedor) == "undefined" ) 1108{ 1109id_div_ReproductorVideo = "VideoPlayer_Directo_" + String(Math.random()).substr(2,9); 1110document.write('<div id="' + id_div_ReproductorVideo + '"></div>'); 1111} 1112else 1113id_div_ReproductorVideo = id_divContenedor; 1114if (typeof(estado) == "undefined" || estado == "" || estado == 0) 1115estado = "0"; 1116var texto_error = ""; 1117switch(String(estado)) 1118{ 1119case "1": 1120texto_error = LANG_MSG[LANG].trans_no_comenzado; 1121break;
1122case "2": 1123texto_error = LANG_MSG[LANG].trans_reanudara; 1124break; 1125case "3": 1126texto_error = LANG_MSG[LANG].trans_finalizada; 1127break; 1128default: 1129texto_error = ""; 1130} 1131if (texto_error != "") 1132{ 1133var an = datosTransmision.ancho; 1134var al = datosTransmision.alto; 1135if ( !css_multimedia_cargado) 1136{ 1137css_multimedia_cargado = true; 1138loadCSS(css_multimedia,null,false) 1139} 1140if (versionMovil || MPEP_responsive) 1141{ 1142an = "100%"; 1143al = "auto"; 1144} 1145document.getElementById(id_div_ReproductorVideo).onclick = null; 1146document.getElementById(id_div_ReproductorVideo).innerHTML = '<div class="video_previa video_no_disponible"><div class="fondo_mensaje_video" ><span>' + texto_error + 1147'</span></div><img src="' + datosTransmision.caratula + '" width="' + an + '" height="' + al + '"/></div>'; 1148} 1149else 1150{ 1151datosVideo = {}; 1152datosVideo.playerEPETParams = {"mediaWidth":datosTransmision.ancho, "mediaHeight":datosTransmision.alto, "URLMediaFile":"", "URLMediaStill":datosTransmision.caratula, "URLFirstFrame":"", "compactMode": 'false'}; 1153datosVideo.anchoPlayer = datosTransmision.ancho; 1154datosVideo.altoPlayer = datosTransmision.alto; 1155datosVideo.id_referencia = datosTransmision.refRetransmisionBC; 1156datosVideo.caratula = datosTransmision.caratula; 1157datosVideo.publiActiva = datosTransmision.publicidad; 1158datosVideo.keywordsVideo = datosTransmision.keywords; 1159if (typeof(datosTransmision.mute) != "undefined") 1160datosVideo.mute = datosTransmision.mute; 1161if (datosTransmision.refRetransmisionBC.indexOf("akamai_001") > -1 || datosTransmision.refRetransmisionBC.indexOf("akamaihls_001") > -1 || 1162datosTransmision.refRetransmisionBC.indexOf("akamai_002") > -1 || datosTransmision.refRetransmisionBC.indexOf("akamaihls_003") > -1 || 1163datosTransmision.refRetransmisionBC.indexOf("level3_001") > -1 || datosTransmision.refRetransmisionBC.indexOf("level3hls_001") > -1) 1164{ 1165if (datosVideo.keywordsVideo == "") 1166datosVideo.keywordsVideo = "overon_stream"; 1167else 1168datosVideo.keywordsVideo += ",overon_stream"; 1169} 1170datosVideo.urlNoticia = document.location.href; 1171datosVideo.tituloVideo = PAGE_TITLE; 1172datosVideo.tipoReproduccion = "streaming"; 1173datosVideo.m3u8 = datosTransmision.transmision_m3u8 ? datosTransmision.transmision_m3u8 : ""; 1174modoSiguientesVideos = 0; 1175if (typeof(datosTransmision.autoplay) != "undefined") 1176datosVideo.autoplay = datosTransmision.autoplay; 1177if (MPEP_responsive) 1178setTimeout(function(){var video = new EPET_Video(datosVideo, id_div_ReproductorVideo);}, 300); 1179else 1180var video = new EPET_Video(datosVideo, id_div_ReproductorVideo); 1181} 1182} 1183var CACHE_VDPEP={}; 1184function pideDatosVideo(id_video) 1185{ 1186id_pidiendoDatos = id_video; 1187var id_servidor = id_video.replace(/\-\d+$/, ""); 1188if (typeof(CACHE_VDPEP[id_servidor]) != "undefined") 1189{ 1190EPET_VideoPlayer_callback(CACHE_VDPEP[id_servidor]); 1191return; 1192} 1193var url = "//elpais.com/vdpep/1/?pepid="; 1194var head = document.getElementsByTagName("head")[0]; 1195if (!MultimediaPEP[id_video]) 1196MultimediaPEP[id_video] = new Object; 1197if( MultimediaPEP[id_video].script){ 1198head.removeChild(MultimediaPEP[id_video].script); 1199} 1200MultimediaPEP[id_video].script = document.createElement("script"); 1201MultimediaPEP[id_video].script.type = "text/javascript"; 1202MultimediaPEP[id_video].script.src = url + id_servidor; 1203head.appendChild(MultimediaPEP[id_video].script); 1204} 1205function EPET_VideoPlayer_callback(datos) 1206{ 1207var id_servidor = id_pidiendoDatos.replace(/\-\d+$/, ""); 1208if (typeof(CACHE_VDPEP[id_servidor]) == "undefined") 1209{ 1210CACHE_VDPEP[id_servidor] = datos; 1211} 1212MultimediaPEP[id_pidiendoDatos].multimedia.cargaDatos(datos); 1213} 1214function EPET_VideoPlayer (datosVideo, idDivContenedor) 1215{ 1216var id_div_ReproductorVideo; 1217if (typeof(idDivContenedor) == "undefined" ) 1218{ 1219id_div_ReproductorVideo = "VideoPlayer_" + String(Math.random()).substr(2,9);
1220document.write('<div id="' + id_div_ReproductorVideo + '"></div>'); 1221} 1222else 1223id_div_ReproductorVideo = idDivContenedor; 1224if ((typeof(datosVideo.idRefBrightcove) == "undefined" || datosVideo.idRefBrightcove == "") && typeof(datosVideo.playerEPETParams.URLMediaFile) != "undefined") 1225{ 1226var re = /\/([\w\d_]+)\.mp4$/; 1227var result = re.exec(datosVideo.playerEPETParams.URLMediaFile); 1228if (result) 1229{ 1230datosVideo.idRefBrightcove = result[1]; 1231} 1232} 1233var video = new EPET_Video(datosVideo, id_div_ReproductorVideo); 1234} 1235function PlayerMultimedia(datosMultimedia, divMultimedia) 1236{ 1237var id_div_ReproductorMultimedia; 1238if (typeof(divMultimedia) == "undefined" ) 1239{ 1240id_div_ReproductorMultimedia = "multimediaPlayer_" + String(Math.random()).substr(2,9); 1241document.write('<div id="' + id_div_ReproductorMultimedia + '"></div>'); 1242} 1243else 1244id_div_ReproductorMultimedia = divMultimedia; 1245switch(datosMultimedia.tipo) 1246{ 1247case "video": 1248if (datosMultimedia.id_referencia) 1249datosMultimedia.idRefBrightcove = datosMultimedia.id_referencia; 1250if (datosMultimedia.id) 1251datosMultimedia.id_video = datosMultimedia.id; 1252if (datosMultimedia.player) 1253datosMultimedia.playerVideo = datosMultimedia.player; 1254if (datosMultimedia.titulo) 1255datosMultimedia.tituloVideo = datosMultimedia.titulo; 1256if (datosMultimedia.keywords) 1257datosMultimedia.keywordsVideo = datosMultimedia.keywords; 1258if (!datosMultimedia.playerEPETParams) 1259datosMultimedia.playerEPETParams = {"mediaWidth":datosMultimedia.anchoPlayer, "mediaHeight":datosMultimedia.altoPlayer, "URLMediaFile":"", "URLMediaStill":datosMultimedia.poster, "URLFirstFrame":"", "compactMode": 'false'}; 1260var video = new EPET_Video(datosMultimedia, id_div_ReproductorMultimedia); 1261break; 1262case "audio": 1263if (datosMultimedia.id) 1264datosMultimedia.id_audio = datosMultimedia.id; 1265if (datosMultimedia.player) 1266datosMultimedia.playerAudio = datosMultimedia.player; 1267if (datosMultimedia.titulo) 1268datosMultimedia.tituloAudio = datosMultimedia.titulo; 1269if (datosMultimedia.keywords) 1270datosMultimedia.keywordsAudio = datosMultimedia.keywords; 1271var audio = new EPET_Audio(datosMultimedia, id_div_ReproductorMultimedia); 1272break; 1273case "externo": 1274var url = datosMultimedia.src; 1275if (datosMultimedia.src && datosMultimedia.src.substr(datosMultimedia.src.length -3,3) == "mp3") 1276{ 1277datosMultimedia.id_audio = String(Math.random()).substr(2,9); 1278if (datosMultimedia.player) 1279datosMultimedia.playerAudio = datosMultimedia.player; 1280if (datosMultimedia.titulo) 1281datosMultimedia.tituloAudio = datosMultimedia.titulo; 1282if (datosMultimedia.keywords) 1283datosMultimedia.keywordsAudio = datosMultimedia.keywords; 1284var audio = new EPET_Audio(datosMultimedia, id_div_ReproductorMultimedia); 1285} 1286else 1287{ 1288var url = eligeUrlenlace(datosMultimedia.urls); 1289if (url != "") 1290{ 1291var iframe = document.createElement("iframe"); 1292iframe.setAttribute("width",datosMultimedia.anchoPlayer); 1293iframe.setAttribute("height",datosMultimedia.altoPlayer); 1294iframe.setAttribute("scrolling", "no"); 1295iframe.frameBorder = 0; 1296if (document.location.href.indexOf("autoplay=1") > -1 && !reproduciendo) 1297{ 1298reproduciendo = true; 1299datosMultimedia.autoplay = true; 1300setTimeout(function(){ 1301var posVideo = EPET_calculaTopPosition(document.getElementById(id_div_ReproductorMultimedia)); 1302if (posVideo > dimensionesPEP.alto) 1303EPET_setScrollPosition(parseInt(posVideo) - 90); 1304},300); 1305} 1306if (datosMultimedia.autoplay) 1307{ 1308if (url.match(/muzu/i)) 1309{ 1310url = url.replace(/&(amp;)?autostart=n/,""); 1311url += "&autostart=y"; 1312} 1313else 1314if (url.match(/youtube/i)) 1315url += "?autoplay=1"; 1316} 1317if (url.match(/youtube/i)) 1318{ 1319if(url.indexOf('?') > -1) 1320url += "&wmode=transparent"; 1321else 1322url += "?wmode=transparent"; 1323} 1324iframe.src = url; 1325document.getElementById(id_div_ReproductorMultimedia).appendChild(iframe); 1326} 1327} 1328break; 1329default: 1330break; 1331} 1332} 1333var css_multimedia_cargado = false; 1334var EPET_Video = function(datosVideo, idDivVideo, borrar) 1335{ 1336this.objvideo = function() 1337{ 1338return _datosVideo.nodoVideo; 1339} 1340this.cargaDatos = function(datos) 1341{ 1342if (typeof(datos) == "undefined") 1343{ 1344return; 1345} 1346if ((!datos.mp4 || datos.mp4.indexOf("http") != 0) && _datosVideo.playerEPETParams.URLMediaFile && _datosVideo.playerEPETParams.URLMediaFile != "") 1347{ 1348datos.status = 100; 1349datos.mp4 = _datosVideo.playerEPETParams.URLMediaFile; 1350datos.ftgrm1 = _datosVideo.playerEPETParams.URLMediaStill; 1351} 1352if ( datos.status != 100) 1353{ 1354EPET_VideoPlayerBloqueado(datos.id_video, _datosVideo.anchoPlayer, _datosVideo.altoPlayer, _datosVideo.playerEPETParams.URLMediaStill, datos.status, _idDivVideo); 1355if (_datosVideo.modoSiguientesVideos > 0 && SiguientesVideosPEP.videoWallData != null) 1356{ 1357SiguientesVideosPEP.cuenta_atras_error = setTimeout(function(){ 1358{ 1359var canal = _datosVideo.agrsNombreNormalizado.split(",")[0]; 1360siguientesVideos(canal, _datosVideo.id_video); 1361return; 1362} 1363},3000)} 1364return; 1365} 1366var cad_video = datos.mp4.replace(/^.*\//,""); 1367_datosVideo.playerEPETParams.URLMediaFile = (datos.mp4.indexOf('/') == 0) ? url_cache + datos.mp4 : datos.mp4; 1368_datosVideo.playerEPETParams.URLFirstFrame = (datos.ftgrm1.indexOf('/') == 0) ? url_cache + datos.ftgrm1 : datos.ftgrm1; 1369_datosVideo.src = _datosVideo.playerEPETParams.URLMediaFile; 1370_datosVideo.poster = _datosVideo.playerEPETParams.URLFirstFrame; 1371_datosVideo.uid = datos.uid; 1372_datosVideo.seccion_creacion = _datosVideo.keywordsVideo ? _datosVideo.keywordsVideo.replace(/,?agencia_.*/,"") : datos.seccion_creacion; 1373_datosVideo.fuente = datos.fuente; 1374_datosVideo.duracion = typeof(datos.duracion) != "undefined" ? datos.duracion : 0; 1375if (datos.sprite && !_datosVideo.spriteImg) 1376{ 1377_datosVideo.spriteImg = ( datos.sprite.indexOf('/') == 0) ? url_cache + datos.sprite :datos.sprite; 1378_datosVideo.nSprites = (datos.n_sprites) ? datos.n_sprites : 0; 1379} 1380if (_datosVideo.playerEPETParams.URLMediaFile.indexOf("rtmp") == 0) 1381_datosVideo.rtmpStream = datos.rtmpStream; 1382_datosVideo.urlNoticia = datos.url_noticia ? datos.url_noticia : document.location.pathname; 1383_datosVideo.tituloVideo = datos.titulo ? datos.titulo : PAGE_TITLE; 1384_datosVideo.tagsNombreNormalizado = datos.tags_names ? datos.tags_names : (typeof(listado_norm_tags) != "undefined" ? listado_norm_tags : ""); 1385if (typeof(datos.tags_ids) != "undefined" && datos.tags_ids != "" ) 1386_datosVideo.tagsIds = datos.tags_ids; 1387else 1388if (typeof(_datosVideo.tagsIds) == "undefined") 1389_datosVideo.tagsIds = ""; 1390if (_datosVideo.agrsIds != undefined && _datosVideo.agrsIds != "") 1391{ 1392if (_datosVideo.tagsIds != "") 1393_datosVideo.tagsIds += ','; 1394_datosVideo.tagsIds += _datosVideo.agrsIds; 1395} 1396_datosVideo.autoresIds = (typeof(datos.author_ids) != "undefined") ? datos.author_ids : "";
1397if (datos.hlsod) 1398_datosVideo.hlsod = (datos.hlsod.indexOf('/') == 0) ? url_cache + datos.hlsod : datos.hlsod; 1399else 1400datos.hlsod = ""; 1401if (_datosVideo._HTML5vsFLASH == "flash") 1402creaPlayerFlash(); 1403else 1404{ 1405_mainController.cargaDatos(_datosVideo); 1406} 1407} 1408this.play = function() 1409{ 1410if (_datosVideo._HTML5vsFLASH == "flash") 1411{ 1412if (document.getElementById(_idObjeto) && typeof(document.getElementById(_idObjeto).playjs) != "undefined") 1413{ 1414document.getElementById(_idObjeto).playjs(); 1415} 1416} 1417else 1418{ 1419_datosVideo.nodoVideo.play(); 1420} 1421MultimediaReproduciendo(_datosVideo.id_video, false); 1422} 1423this.pause = function() 1424{ 1425if (_datosVideo._HTML5vsFLASH == "flash") 1426{ 1427if (document.getElementById(_idObjeto) && typeof(document.getElementById(_idObjeto).pausejs) != "undefined") 1428document.getElementById(_idObjeto).pausejs(); 1429} 1430else 1431{ 1432if (isIpad) 1433{ 1434if ( _mainController.adPlaying) 1435{ 1436_mainController.restart(); 1437_mainController.playerHTML5.adContainer.innerHTML = ""; 1438_mainController.playerHTML5.controles.style.display = 'none'; 1439_mainController.playerHTML5.adContainer.style.display = 'none'; 1440} 1441} 1442if (_mainController) 1443_mainController.pause(); 1444} 1445} 1446this.stop = function() 1447{ 1448if (_datosVideo._HTML5vsFLASH == "html5") 1449{ 1450_mainController.restart(); 1451} 1452} 1453this.marcado = function(datos) 1454{ 1455if (datos.duracion != undefined) 1456_marcado._datosMarcado.duracion = datos.duracion; 1457if (datos.playerName != undefined) 1458_marcado._datosMarcado.playerName = datos.playerName; 1459if (datos.ad != undefined) 1460_marcado._datosMarcado.ad = datos.ad; 1461if (datos.adCue != undefined) 1462_marcado._datosMarcado.adCue = datos.adCue; 1463if (datos.adTitle != undefined) 1464_marcado._datosMarcado.adTitle = datos.adTitle; 1465if (datos.uid != undefined) 1466_marcado._datosMarcado.uid = datos.uid; 1467if (datos.seccion_creacion != undefined) 1468_marcado._datosMarcado.seccion_creacion = datos.seccion_creacion; 1469if (datos.fuente != undefined) 1470_marcado._datosMarcado.fuente = datos.fuente; 1471if (datos.tags != undefined) 1472_marcado._datosMarcado.tags = datos.tags; 1473if (datos.autores != undefined) 1474_marcado._datosMarcado.autores = datos.autores; 1475if (datos.evento == "adStart" || datos.evento == "adComplete" || datos.evento == "adSkip" || datos.evento == "adError" || datos.evento == "mediaBegin" || datos.evento == "mediaComplete" || datos.evento == "halfmediaComplete" || datos.evento == "adRequest") 1476_marcado.marcaEvento(datos.evento); 1477} 1478this.seek = function(segundo) 1479{ 1480if (_datosVideo._HTML5vsFLASH == "flash") 1481{ 1482if (document.getElementById(_idObjeto)) 1483{ 1484document.getElementById(_idObjeto).seekjs(segundo); 1485} 1486} 1487else 1488{ 1489if (_datosVideo._HTML5vsFLASH == "html5") 1490{ 1491if (_mainController.adPlaying) 1492return; 1493_mainController.seekjs(segundo); 1494} 1495} 1496MultimediaReproduciendo(_datosVideo.id_video, false); 1497} 1498this.resetMarcado = function(id) 1499{ 1500_marcado.eventos = {}; 1501if (_datosVideo.modoSiguientesVideos > 0 ) 1502{ 1503var canal = _datosVideo.agrsNombreNormalizado.split(",")[0]; 1504siguientesVideos(canal, id); 1505return; 1506} 1507} 1508this.seeking = function() 1509{ 1510if (_datosVideo.loading) 1511_datosVideo.loading.className = "playerMPEPV_cloading visible"; 1512} 1513this.seeked = function() 1514{ 1515if (_datosVideo.loading) 1516_datosVideo.loading.className = "playerMPEPV_cloading"; 1517} 1518this.tipo = function() 1519{ 1520return _datosVideo._HTML5vsFLASH; 1521} 1522this.uid = function() 1523{ 1524return _datosVideo.uid; 1525} 1526this.seccion_creacion = function() 1527{ 1528return _datosVideo.seccion_creacion; 1529} 1530this.fuente = function() 1531{ 1532return _datosVideo.fuente; 1533} 1534this.tags = function() 1535{ 1536return _datosVideo.tagsIds; 1537} 1538this.autores = function() 1539{ 1540return _datosVideo.autoresIds; 1541} 1542if (datosVideo.idRefBrightcove) 1543datosVideo.id_referencia = datosVideo.idRefBrightcove; 1544if (datosVideo.playerVideo) 1545datosVideo.player = datosVideo.playerVideo; 1546if (datosVideo.tituloVideo) 1547datosVideo.titulo = datosVideo.tituloVideo; 1548if (datosVideo.keywordsVideo) 1549datosVideo.keywords = datosVideo.keywordsVideo; 1550var _datosVideo = datosVideo; 1551var _idDivVideo = idDivVideo; 1552var _divVideo = document.getElementById(_idDivVideo); 1553_divVideo.className = "video_MPEP"; 1554var cadena_titulo; 1555if (_datosVideo.tituloVideo != undefined && _datosVideo.tituloVideo != "") 1556cadena_titulo = _datosVideo.tituloVideo; 1557else 1558cadena_titulo = PAGE_TITLE; 1559var _id_video; 1560if (_datosVideo.id_video) 1561_id_video = _datosVideo.id_video; 1562else 1563{ 1564if (_datosVideo.un) 1565UN = _datosVideo.un; 1566_id_video = _datosVideo.id_referencia + UN; 1567} 1568_id_video += '-' + (++contadorMultimedia); 1569if (typeof(_datosVideo.modoReproduccion) == "undefined") 1570_datosVideo.modoReproduccion = ""; 1571if (dispositivoMovil && typeof(_datosVideo.autoplay) == "boolean") 1572_datosVideo.autoplay = false;
1573 1574 1575if (versionMovil || MPEP_responsive) 1576{ 1577var ancho_ref = (typeof(_divVideo.parentNode) != "undefined" && _divVideo.parentNode.offsetWidth > 0) ? _divVideo.parentNode.offsetWidth : ((typeof(_divVideo.parentNode.parentNode) != "undefined" && _divVideo.parentNode.parentNode.offsetWidth > 0)? _divVideo.parentNode.parentNode.offsetWidth: 640); 1578_altoMovil = Math.floor(ancho_ref * _datosVideo.altoPlayer / _datosVideo.anchoPlayer); 1579_anchoMovil = (ancho_ref); 1580_datosVideo.anchoPlayer = _anchoMovil; 1581_datosVideo.altoPlayer = _altoMovil; 1582_divVideo.style.overflow = "hidden"; 1583EPETaddEvent(window, orientationEvent, function(){ 1584clearTimeout(_resizeTM); 1585_resizeTM = setTimeout( function() { 1586changeOrientation()}, 300) 1587}); 1588} 1589_divVideo.style.width = _datosVideo.anchoPlayer + "px" 1590_divVideo.style.height = _datosVideo.altoPlayer + "px"; 1591_divVideo.style.backgroundColor = "#000000"; 1592if (typeof(autopromo) != "undefined" && !dispositivoMovil) 1593datosVideo.autopromo = autopromo; 1594if (modoSiguientesVideos != 0) 1595{ 1596datosVideo.agrsNombreNormalizado = SiguientesVideosPEP.fuente_unica; 1597datosVideo.agrsIds = SiguientesVideosPEP.id_fuente_unica; 1598} 1599_datosVideo.modoSiguientesVideos = (modoSiguientesVideos == 0 || typeof(_datosVideo.agrsNombreNormalizado) == "undefined" || _datosVideo.agrsNombreNormalizado == "") ? 0 : (typeof(_datosVideo.modoPlayer) != "undefined" && _datosVideo.modoPlayer != '0' ? _datosVideo.modoPlayer : modoSiguientesVideos); 1600if (_datosVideo.anchoPlayer < 300) 1601_datosVideo.modoSiguientesVideos = 0; 1602if (typeof(MultimediaPEP_originales[_idDivVideo]) == "undefined") { 1603MultimediaPEP_originales[_idDivVideo] = JSON.parse(JSON.stringify(datosVideo)); 1604} 1605else 1606{ 1607if (_datosVideo.modoSiguientesVideos > 0 && borrar) 1608SiguientesVideosPEP.paraBorrar.push(_id_video); 1609} 1610MultimediaPEP[_id_video] = new Object(); 1611MultimediaPEP[_id_video].multimedia = this; 1612MultimediaPEP[_id_video].modoSiguientesVideos = _datosVideo.modoSiguientesVideos; 1613MultimediaPEP[_id_video].datos = JSON.parse(JSON.stringify(MultimediaPEP_originales[_idDivVideo])); 1614MultimediaPEP[_id_video].id = idDivVideo; 1615_datosVideo.id_video = _id_video; 1616var primero_flash = videoFlash && !versionMovil; 1617if ((_datosVideo.forzarHTML5 != undefined && _datosVideo.forzarHTML5) || (typeof(EPET_forzarHTML5) != "undefined" && EPET_forzarHTML5)) 1618primero_flash = false; 1619var _marcado = new EPET_Marcado_Multimedia({"referencia":_datosVideo.id_video,"titulo": cadena_titulo, "keywords": _datosVideo.keywordsVideo != undefined ? _datosVideo.keywordsVideo : "", "media":"video" }); 1620if (datosVideo.tipoReproduccion && datosVideo.tipoReproduccion == "streaming") 1621{ 1622_marcado._datosMarcado.tipoReproduccion = "streaming"; 1623_datosVideo.publicidad_post_roll = false; 1624} 1625else 1626{ 1627datosVideo.tipoReproduccion = "vod"; 1628_marcado._datosMarcado.tipoReproduccion = "vod"; 1629if (_datosVideo.modoSiguientesVideos == 0 ) 1630_datosVideo.publicidad_post_roll = typeof(_datosVideo.publicidad_post_roll) != "undefined" ? _datosVideo.publicidad_post_roll : true; 1631else 1632{ 1633_datosVideo.publicidad_post_roll = false; 1634if (typeof (_datosVideo.idx_siguientes_videos) == "undefined") 1635_datosVideo.idx_siguientes_videos = 0; 1636var key = _datosVideo.idx_siguientes_videos == 0 ? SiguientesVideosPEP.keyword_primero : SiguientesVideosPEP.keyword_siguientes; 1637if (typeof(_datosVideo.keywordsVideo) == "undefined" || _datosVideo.keywordsVideo == "") 1638_datosVideo.keywordsVideo = key; 1639else 1640_datosVideo.keywordsVideo += "," + key; 1641_marcado._datosMarcado.posSiguientesVideos = _datosVideo.idx_siguientes_videos; 1642} 1643} 1644var _idPosicionador = "posicionador_" + _id_video; 1645var _idDivImage = "divimg_" + _id_video; 1646var _imgCaratula = "caratula_" + _id_video; 1647var _idObjeto = "obj_" + _id_video; 1648var _duration = 0; 1649var _firstTime = false; 1650var _anchoMovil = _datosVideo.anchoPlayer; 1651var _altoMovil = _datosVideo.altoPlayer; 1652var fullscreen_HTML5 = false; 1653var _resizeTM; 1654var _mainController; 1655var intervalTimmerFotograma; 1656var urlAdServer; 1657if (!dispositivoMovil && document.location.href.indexOf("autoplay=1") > -1 && !reproduciendo && datosVideo.autoplay != false) 1658{ 1659_datosVideo.modoReproduccion = "autoplay"; 1660reproduciendo = true; 1661_datosVideo.autoplay = true; 1662var posVideo = EPET_calculaTopPosition(_divVideo); 1663if (posVideo > dimensionesPEP.alto) 1664EPET_setScrollPosition(posVideo - 30); 1665} 1666var _divCaratula = document.createElement("div"); 1667_divCaratula.id = _idDivImage; 1668_divCaratula.style.zIndex = 1; 1669_divCaratula.className = "img_MPEP"; 1670_divCaratula.style.width = _datosVideo.anchoPlayer + "px"; 1671_divCaratula.style.height = _datosVideo.altoPlayer + "px"; 1672_divCaratula.tituloVideo = LANG_MSG[LANG].ver_video; 1673if( typeof(_datosVideo.tituloVideo) !== 'undefined' && _datosVideo.tituloVideo != '' ){ 1674_divCaratula.tituloVideo = _datosVideo.tituloVideo; 1675}
1676var codigoVideo = '<a class="posicionador" id="' + _idPosicionador + '" title="'+ _divCaratula.tituloVideo +'" href="javascript:void(0)">'; 1677if (_anchoMovil > 300) 1678codigoVideo += '<span class="mosca_elpaistv"></span>'; 1679var cod_img; 1680if (typeof(window.lzld) == 'function') 1681cod_img = '<img border="0" width="' + _datosVideo.anchoPlayer + '" height="' + _datosVideo.altoPlayer +'" id="' + _imgCaratula + '" onload="lzld(this)" src="/t.gif" data-src="' + _datosVideo.playerEPETParams["URLMediaStill"] + '" style="height:' + _datosVideo.altoPlayer + 'px" />'; 1682else 1683cod_img = '<img border="0" width="' + _datosVideo.anchoPlayer + '" height="' + _datosVideo.altoPlayer +'" id="' + _imgCaratula + '" src="' + _datosVideo.playerEPETParams["URLMediaStill"] + '" style="height:' + _datosVideo.altoPlayer + 'px" />'; 1684codigoVideo += '<span class="boton_video"></span>' + cod_img + '</a>'; 1685if (_datosVideo.autoplay && _datosVideo.modoSiguientesVideos > 0) 1686{ 1687_divCaratula.style.display = 'none'; 1688} 1689_divCaratula.innerHTML = codigoVideo; 1690_divVideo.appendChild(_divCaratula); 1691var _span = document.getElementById(_idPosicionador); 1692if (_datosVideo.autoplay && !dispositivoMovil) 1693{ 1694if (_datosVideo.modoReproduccion == "") 1695_datosVideo.modoReproduccion = "autoplay"; 1696if (!isIE && code_ima3_HTML5_cargado == "nocargado") 1697{ 1698code_ima3_HTML5_cargado = "cargado"; 1699var ss = document.createElement('script'); 1700ss.type= 'text/javascript'; 1701ss.src = '//s0.2mdn.net/instream/html5/ima3.js'; 1702document.getElementsByTagName('head')[0].appendChild(ss); 1703} 1704intervalTimmerFotograma = setTimeout(function(){_divCaratula.style.display = "none";},4000); 1705if ( !css_multimedia_cargado) 1706{ 1707css_multimedia_cargado = true; 1708loadCSS(css_multimedia, function(){setTimeout(dibujaPlayer,1500)},true); 1709EPETaddEvent(document, mouseWheelEvent, wheel); 1710} 1711else 1712dibujaPlayer(); 1713_span.className += " video_cargando"; 1714} 1715else 1716{ 1717if ( !css_multimedia_cargado) 1718{ 1719css_multimedia_cargado = true; 1720loadCSS(css_multimedia, null, true); 1721EPETaddEvent(document, mouseWheelEvent, wheel); 1722} 1723if (!isIE && code_ima3_HTML5_cargado == "nocargado") 1724{ 1725code_ima3_HTML5_cargado = "cargando"; 1726var ss = document.createElement('script'); 1727ss.type= 'text/javascript'; 1728ss.src = '//s0.2mdn.net/instream/html5/ima3.js'; 1729if (document.all) 1730ss.onreadystatechange = function(){ 1731if (ss.readyState == 'complete' || ss.readyState == 'loaded') 1732code_ima3_HTML5_cargado = "cargado"; 1733} 1734else 1735ss.onload = function() { 1736code_ima3_HTML5_cargado = "cargado"; 1737}; 1738document.getElementsByTagName('head')[0].appendChild(ss); 1739} 1740_divVideo.onclick = function() 1741{ 1742_datosVideo.modoReproduccion = "organico"; 1743_divVideo.onclick = null; 1744_span.className += " video_cargando"; 1745if (isIE) 1746_divCaratula.style.display = "none"; 1747intervalTimmerFotograma = setTimeout(function(){_divCaratula.style.display = "none";},4000); 1748dibujaPlayer(); 1749MultimediaReproduciendo(_datosVideo.id_video, false); 1750} 1751} 1752function changeOrientation(ancho) 1753{ 1754var ref; 1755if (isNaN(ancho)) 1756ref = (typeof(_divVideo.parentNode) != "undefined" && _divVideo.parentNode.offsetWidth > 0) ? _divVideo.parentNode.offsetWidth : 1757((typeof(_divVideo.parentNode.parentNode) != "undefined" && _divVideo.parentNode.parentNode.offsetWidth > 0)? _divVideo.parentNode.parentNode.offsetWidth: 1758(typeof(_divVideo.parentNode.parentNode.parentNode) != "undefined" && _divVideo.parentNode.parentNode.parentNode.offsetWidth > 0)? _divVideo.parentNode.parentNode.parentNode.offsetWidth : 640); 1759else 1760ref = ancho; 1761_datosVideo.altoPlayer = Math.floor(ref * _datosVideo.altoPlayer / _datosVideo.anchoPlayer); 1762_datosVideo.anchoPlayer = ref; 1763if (_divCaratula) 1764{ 1765_divCaratula.style.width = _datosVideo.anchoPlayer + "px"; 1766_divCaratula.style.height = _datosVideo.altoPlayer + "px"; 1767if (document.getElementById(_imgCaratula)) 1768{ 1769document.getElementById(_imgCaratula).style.width = _datosVideo.anchoPlayer + "px"; 1770document.getElementById(_imgCaratula).style.height = _datosVideo.altoPlayer + "px"; 1771} 1772} 1773if (_mainController && _mainController.adsController) 1774_mainController.adsController.resize(_datosVideo.anchoPlayer,_datosVideo.altoPlayer); 1775if (_datosVideo.nodoVideo != null) 1776{ 1777if (_mainController.playerHTML5.controles) 1778{
1779_mainController.playerHTML5.controles.style.left = "0px"; 1780_mainController.playerHTML5.controles.style.marginLeft = "0px"; 1781_mainController.playerHTML5.controles.style.paddingLeft = "0px"; 1782_mainController.playerHTML5.controles.style.paddingRight = "0px"; 1783var limite = (_datosVideo.anchoPlayer > 640 || _mainController.playerHTML5.inFullscreen) ? 640 : _datosVideo.anchoPlayer; 1784if (_mainController.playerHTML5.controles.barra) 1785{ 1786_mainController.playerHTML5.controles.barra.style.width = (limite - _mainController.playerHTML5.ancho_controles) + "px"; 1787_mainController.playerHTML5.controles.barra.sliderseek.style.width = _mainController.playerHTML5.controles.barra.style.width; 1788_mainController.playerHTML5.controles.style.width = limite + "px"; 1789} 1790if (_datosVideo.anchoPlayer > 640 || _mainController.playerHTML5.inFullscreen) 1791{ 1792var margen = Math.floor((_mainController.playerHTML5.inFullscreen ? _mainController.playerHTML5.fullscreenWidth : _datosVideo.anchoPlayer) / 2) - 320; 1793_mainController.playerHTML5.controles.style.left = margen + "px"; 1794_mainController.playerHTML5.controles.style.marginLeft = (-1 * margen) + "px"; 1795var nodo = _mainController.playerHTML5.controles; 1796setTimeout(function(){ 1797nodo.style.paddingLeft = margen + "px"; 1798},20); 1799_mainController.playerHTML5.controles.style.paddingRight = margen + "px"; 1800} 1801} 1802} 1803else 1804{ 1805if (_datosVideo.idObjeto && document.getElementById(_datosVideo.idObjeto)) 1806{ 1807document.getElementById(_datosVideo.idObjeto).width = _datosVideo.anchoPlayer; 1808document.getElementById(_datosVideo.idObjeto).height = _datosVideo.altoPlayer; 1809} 1810} 1811_divVideo.style.width = _datosVideo.anchoPlayer + "px"; 1812_divVideo.style.height = _datosVideo.altoPlayer + "px"; 1813if (_datosVideo.modoSiguientesVideos > 0) 1814{ 1815MultimediaPEP[_id_video].datos.anchoPlayer = _datosVideo.anchoPlayer; 1816MultimediaPEP[_id_video].datos.altoPlayer = _datosVideo.altoPlayer; 1817} 1818} 1819function ocultaFotograma() 1820{ 1821clearTimeout(intervalTimmerFotograma); 1822_divCaratula.style.visibility = "hidden"; 1823_divCaratula.innerHTML= ""; 1824} 1825function dibujaPlayer() 1826{ 1827if (typeof(_datosVideo.publiActiva) == "string") 1828if (_datosVideo.publiActiva == "true") 1829_datosVideo.publiActiva = true; 1830else 1831{ 1832_datosVideo.publiActiva = false; 1833} 1834if (!_datosVideo.seekTimeout) 1835_datosVideo.seekTimeout = 7; 1836if (_datosVideo.publiActiva) 1837{ 1838_datosVideo.publicidad_pre_roll = true; 1839} 1840else 1841{ 1842_datosVideo.publicidad_pre_roll = false; 1843_datosVideo.publicidad_post_roll = false; 1844} 1845_marcado._datosMarcado.publicidad = _datosVideo.publiActiva ? "con publicidad" : "sin publicidad"; 1846var keywords = ""; 1847if (_datosVideo.tagsNombreNormalizado != undefined && _datosVideo.tagsNombreNormalizado != "") 1848keywords = _datosVideo.tagsNombreNormalizado; 1849else 1850if (typeof(listado_norm_tags) != "undefined" && listado_norm_tags != "") 1851keywords = listado_norm_tags; 1852if (_datosVideo.keywordsVideo != undefined && _datosVideo.keywordsVideo != "") 1853{ 1854if (keywords != "") 1855keywords += "," + _datosVideo.keywordsVideo; 1856else 1857keywords = _datosVideo.keywordsVideo; 1858} 1859if (_datosVideo.agrsNombreNormalizado != undefined && _datosVideo.agrsNombreNormalizado != "") 1860{ 1861_marcado._datosMarcado.agrs_video = _datosVideo.agrsNombreNormalizado; 1862if (keywords != "") 1863keywords += "," + _datosVideo.agrsNombreNormalizado; 1864else 1865keywords = _datosVideo.agrsNombreNormalizado; 1866} 1867keywords = "&hl=" + (LANG == "pt-br" ? "pt" : LANG ) + "&cust_params=pbskey%3D" + escape(keywords) + "%26pos%3D{cuePointType}" + 1868(typeof(PBS) != "undefined" && typeof(PBS.slm) != "undefined" && typeof(PBS.slm.cf) != "undefined" && typeof(PBS.slm.cf.key) != "undefined" && typeof(PBS.slm.cf.key.cXseg) != "undefined" ? "%26CxSegments%3D" + escape(PBS.slm.cf.key.cXseg.join(",")) : ""); 1869if (_datosVideo.keywordsVideo.indexOf("agencia_overonaelpais") > -1 || _datosVideo.keywordsVideo.indexOf("agencia_reuters_live") > -1 || _datosVideo.keywordsVideo.indexOf("overon_stream") > -1) 1870urlAdServer = UrlPublicidadOveron + keywords; 1871else 1872{ 1873if (_datosVideo.keywordsVideo.indexOf("agencia_cnbc") > -1) 1874urlAdServer = UrlPublicidadCnbc + keywords; 1875else 1876urlAdServer = UrlPublicidad + keywords; 1877} 1878if (versionMovil || (MPEP_responsive && dimensionesPEP.ancho < anchoReferenciaMobile)) 1879urlAdServer = urlAdServer.replace("_web%2F", "_mob%2F"); 1880_marcado._datosMarcado.duracion = 0; 1881_marcado._datosMarcado.adCue = ""; 1882_marcado._datosMarcado.ad = ""; 1883_marcado._datosMarcado.adTitle = ""; 1884_marcado._datosMarcado.tags = ""; 1885_marcado._datosMarcado.autores = ""; 1886_marcado._datosMarcado.modoReproduccion = _datosVideo.modoReproduccion; 1887_datosVideo._HTML5vsFLASH = ""; 1888if ( primero_flash) 1889{ 1890_datosVideo._HTML5vsFLASH = "flash"; 1891pideDatosVideo(_id_video); 1892} 1893else 1894{ 1895if (canPlayMP4 || canPlayHLS) 1896{ 1897_datosVideo._HTML5vsFLASH = "html5"; 1898creaPlayerHTML5(); 1899} 1900else 1901{ 1902if (videoFlash ) 1903{ 1904_datosVideo._HTML5vsFLASH = "flash"; 1905pideDatosVideo(_id_video); 1906} 1907else 1908sinPlayer(); 1909} 1910} 1911} 1912function creaPlayerFlash() 1913{ 1914_datosVideo.adServerURL = urlAdServer + "%26fpd%3Dvpaid"; 1915var params = {"menu":"false", "wmode":"opaque", "allowscriptaccess":"always", "bgcolor":"#000000", "allowfullscreen":"true" }; 1916for(var key in _datosVideo.playerEPETOpcionesSWF) 1917{ 1918params[key] = _datosVideo.playerEPETOpcionesSWF[key]; 1919} 1920_datosVideo.autoplay = true; 1921_datosVideo.idioma = LANG; 1922_datosVideo.un = UN; 1923_datosVideo.enlazados = _datosVideo.modoSiguientesVideos > 0; 1924params["flashvars"] = "datosVideo=" + escape(JSON.stringify(_datosVideo)); 1925var multimedia_player;
1926var player = (_datosVideo.hlsod && _datosVideo.hlsod != "") ? url_reproductor_epet_live : url_reproductor_epet; 1927multimedia_player = new EPET_FlashHTML(11, player, _datosVideo.anchoPlayer, _datosVideo.altoPlayer, params, _idObjeto ); 1928_datosVideo.idObjeto = _idObjeto; 1929multimedia_player.append(_idDivVideo); 1930if (_datosVideo.hlsod && _datosVideo.hlsod != "") 1931{ 1932_datosVideo.loading = document.createElement("div"); 1933_datosVideo.loading.className = "playerMPEPV_cloading"; 1934var circulo = document.createElement("div"); 1935circulo.className = "playerMPEPV_loading"; 1936_datosVideo.loading.appendChild(circulo); 1937_divVideo.appendChild(_datosVideo.loading); 1938} 1939ocultaFotograma(); 1940} 1941function creaPlayerHTML5() 1942{ 1943if (_datosVideo.tipoReproduccion != undefined && _datosVideo.tipoReproduccion == "streaming") 1944{ 1945if (_datosVideo.m3u8 == undefined || _datosVideo.m3u8 == "" || (!dispositivoMovil && !canPlayHLS)) 1946{ 1947sinPlayer(1); 1948return; 1949} 1950} 1951if (_datosVideo.publiActiva && publicidad_HTML5 && code_ima3_HTML5_cargado == "cargado" ) 1952{ 1953_datosVideo.publicidad_pre_roll = true; 1954_datosVideo.publicidad_post_roll = _datosVideo.publicidad_post_roll && postroll_HTML5; 1955} 1956else 1957{ 1958_datosVideo.publiActiva = false; 1959_datosVideo.publicidad_pre_roll = false; 1960_datosVideo.publicidad_post_roll = false; 1961} 1962if (_marcado._datosMarcado.tipoReproduccion == "streaming") 1963_marcado._datosMarcado.playerName = "HTML5 VÃÂDEO V2 - Transmisiones"; 1964else 1965_marcado._datosMarcado.playerName = "HTML5 VÃÂDEO V2"; 1966_datosVideo.marcado = _marcado; 1967_datosVideo.adServerURL = urlAdServer.replace("%2Fflash","%2Fhtml5"); 1968_datosVideo.nodoVideo = document.createElement("video"); 1969_datosVideo.nodoVideo.className = "playerMPEPV_video"; 1970if (dispositivoMovil) 1971_datosVideo.nodoVideo.play(); 1972_mainController = new MainController(new playerHTML5(_divVideo,_datosVideo, _id_video)); 1973pideDatosVideo(_id_video); 1974ocultaFotograma(); 1975} 1976function sinPlayer(cod) 1977{ 1978clearTimeout(intervalTimmerFotograma); 1979_span.parentNode.parentNode.className += " video_previa video_no_disponible"; 1980var spanFondo = document.createElement("span"); 1981spanFondo.className = "fondo_mensaje_video"; 1982var spanBoton = document.createElement("span"); 1983spanFondo.appendChild(spanBoton); 1984_span.parentNode.appendChild(spanFondo); 1985if (cod) 1986{ 1987spanBoton.innerHTML = LANG_MSG[LANG].trans_no_disponible; 1988} 1989else 1990{ 1991if (versionFlash > 0) { 1992spanBoton.innerHTML = LANG_MSG[LANG].actualizar_plugin; 1993} 1994else { 1995spanBoton.innerHTML = LANG_MSG[LANG].no_mp4; 1996} 1997} 1998} 1999this.resize = changeOrientation; 2000} 2001var playerHTML5 = function(contenedor, datosVideo, padre) 2002{ 2003this.padre = padre; 2004this.contenedorVideo = typeof contenedor == 'object' ? contenedor : document.getElementById(contenedor); 2005this.datosVideo = datosVideo; 2006this.width = this.datosVideo.anchoPlayer; 2007this.height = this.datosVideo.altoPlayer; 2008this.contenedorVideo.style.width = this.width + "px"; 2009this.contenedorVideo.style.height = this.height + "px"; 2010this.contenedorVideo.className = "playerMPEPV_c_video playerMPEPV_unselectable"; 2011this.adContainer = null; 2012this.controles = null; 2013this.adTagUrl = this.datosVideo.adServerURL; 2014this.primeraVez = true; 2015this.autoplay = this.datosVideo.autoplay; 2016this.controlesNativosVideo = controlesNativosVideo ? controlesNativosVideo : (dispositivoMovil ? true : false); 2017this.adSaltar = null; 2018this.playing = false; 2019this.inFullscreen = false; 2020this.fullscreenWidth = 0; 2021this.fullscreenHeight = 0; 2022this.marcado = this.datosVideo.marcado; 2023this.nodoVideo = this.datosVideo.nodoVideo; 2024this.nodoVideo.style.position = 'absolute'; 2025this.nodoVideo.style.zIndex = 0; 2026this.nodoVideo.style.top = '0px'; 2027this.nodoVideo.style.left = '0px'; 2028this.nodoVideo.setAttribute("id", "pepvideo_" + this.datosVideo.id_video); 2029this.datosVideo.isMuted = ( typeof(this.datosVideo.mute) != "undefined" && this.datosVideo.mute); 2030if (this.datosVideo.modoSiguientesVideos == 0) 2031this.nodoVideo.setAttribute("poster", this.datosVideo.playerEPETParams.URLMediaStill); 2032this.nodoVideo.style.display = 'none'; 2033this.contenedorVideo.appendChild(this.nodoVideo); 2034this.volumenActual = this.nodoVideo.volume; 2035this.ancho_controles = 0; 2036if (typeof(google) == "undefined" || typeof(google.ima) == "undefined") 2037this.datosVideo.publiActiva = false;
2038if (this.datosVideo.publiActiva) 2039{ 2040this.adContainer = document.createElement('div'); 2041this.adContainer.style.position = "absolute"; 2042this.adContainer.style.cursor = "pointer"; 2043this.adContainer.style.left = "0px"; 2044this.adContainer.style.top = "0px"; 2045this.adContainer.style.width = this.width + "px"; 2046this.adContainer.style.height = this.height + "px"; 2047this.adContainer.style.zIndex = 2; 2048this.contenedorVideo.appendChild(this.adContainer); 2049if (!isIphone) 2050{ 2051this.creaControles(); 2052this.adSaltar = document.createElement('div'); 2053this.adSaltar.className = "playerMPEPV_adsaltar"; 2054if (dispositivoMovil) 2055this.adSaltar.innerHTML = '<img src="'+ LANG_MSG[LANG].vervideo_svg+'" width="146" height="40" border="0" style="width:146px;height:40px" \/>'; 2056else 2057this.adSaltar.innerHTML = '<img src="'+ LANG_MSG[LANG].vervideo_svg+'" width="84" height="23" border="0" style="width:84px;height:23px" \/>'; 2058this.contenedorVideo.appendChild(this.adSaltar); 2059} 2060} 2061else 2062{ 2063this.nodoVideo.style.display = 'block'; 2064if (this.controlesNativosVideo) 2065this.nodoVideo.setAttribute ( "controls" , "controls" ); 2066else 2067this.creaControles(); 2068} 2069}; 2070playerHTML5.prototype.preloadContent = function(contentLoadedAction) { 2071if (dispositivoMovil) 2072{ 2073this.nodoVideo.addEventListener( 2074'loadedmetadata', 2075contentLoadedAction, 2076false); 2077this.nodoVideo.load(); 2078} 2079else 2080contentLoadedAction(); 2081}; 2082playerHTML5.prototype.play = function() { 2083this.nodoVideo.play(); 2084this.playing = true; 2085if (!this.controlesNativosVideo && this.controles) 2086this.controles.playpause.className = "playerMPEPV_boton_play_pause playerMPEPV_boton_pause"; 2087MultimediaReproduciendo(this.datosVideo.id_video, false); 2088}; 2089playerHTML5.prototype.pause = function() { 2090this.nodoVideo.pause(); 2091this.playing = false; 2092if (!this.controlesNativosVideo && this.controles) 2093this.controles.playpause.className = "playerMPEPV_boton_play_pause playerMPEPV_boton_play"; 2094}; 2095playerHTML5.prototype.setVolume = function(volumen) { 2096if (volumen > 1 || volumen < 0 ) 2097return; 2098this.nodoVideo.volume = volumen; 2099this.actualizaVolumen(); 2100}; 2101playerHTML5.prototype.actualizaVolumen = function() 2102{ 2103var volumen = this.nodoVideo.volume || 0; 2104if (volumen == 0) 2105this.controles.volumen.nivel.style.height = '0px'; 2106else 2107this.controles.volumen.nivel.style.height = (this.controles.volumen.maximo * volumen) + 'px'; 2108volumen_global = volumen; 2109}; 2110playerHTML5.prototype.resize = function( 2111position, top, left, width, height) { 2112this.videoPlayerContainer.style.position = position; 2113this.videoPlayerContainer.style.top = top + 'px'; 2114this.videoPlayerContainer.style.left = left + 'px'; 2115this.videoPlayerContainer.style.width = width + 'px'; 2116this.videoPlayerContainer.style.height = height + 'px'; 2117}; 2118playerHTML5.prototype.getVideoPlayer = function() { 2119return this.nodoVideo; 2120}; 2121playerHTML5.prototype.creaControles = function() { 2122this.controles = document.createElement("div"); 2123this.controles.className = "playerMPEPV_controles"; 2124this.controles.style.zIndex = "10"; 2125var ancho_maximo = 640; 2126var margen = 0; 2127if (this.width > 640) 2128{ 2129margen = this.width / 2 - 320; 2130this.controles.style.width = "640px"; 2131this.controles.style.left = margen + "px"; 2132this.controles.style.marginLeft = (-1 * margen) + "px"; 2133this.controles.style.paddingLeft = margen + "px"; 2134this.controles.style.paddingRight = margen + "px"; 2135} 2136else 2137{ 2138this.controles.style.width = this.width + "px"; 2139ancho_maximo = this.width; 2140} 2141this.controles.style.visibility = 'hidden'; 2142var boton_play_pause = document.createElement("span"); 2143boton_play_pause.className = "playerMPEPV_boton_play_pause playerMPEPV_boton_play"; 2144var em = document.createElement("em"); 2145em.appendChild ( document.createTextNode ( "PLAY" ) ); 2146boton_play_pause.appendChild(em); 2147this.controles.appendChild(boton_play_pause); 2148this.controles.playpause = boton_play_pause; 2149var tiempo = document.createElement("span"); 2150tiempo.className = "playerMPEPV_posicion"; 2151em = document.createElement("em"); 2152em.appendChild ( document.createTextNode ( "00:00" ) ); 2153tiempo.appendChild(em); 2154tiempo.texto = em; 2155this.controles.appendChild(tiempo); 2156this.controles.tiempo = tiempo; 2157var barra = document.createElement("span"); 2158barra.className = "playerMPEPV_barra"; 2159em = document.createElement("em"); 2160barra.appendChild(em); 2161barra.progreso = em; 2162var sliderseek = document.createElement("div"); 2163sliderseek.className = "playerMPEPV_sliderseek"; 2164barra.appendChild(sliderseek); 2165barra.sliderseek = sliderseek; 2166this.controles.appendChild(barra); 2167this.controles.barra = barra; 2168var duracion = document.createElement("span"); 2169duracion.className = "playerMPEPV_duracion"; 2170em = document.createElement("em"); 2171em.appendChild ( document.createTextNode ( "00:00" ) ); 2172duracion.appendChild(em); 2173duracion.texto = em; 2174this.controles.appendChild(duracion); 2175this.controles.textoDuracion = duracion; 2176var pantalla_completa = document.createElement("span"); 2177pantalla_completa.className = "playerMPEPV_pantalla_completa"; 2178pantalla_completa.innerHTML = "PC"; 2179this.controles.appendChild(pantalla_completa); 2180this.controles.fullscreen = pantalla_completa; 2181var volumen = document.createElement("span"); 2182em = document.createElement("em"); 2183var altavoz = document.createElement("span"); 2184altavoz.className = "playerMPEPV_altavoz"; 2185em.appendChild ( altavoz ); 2186volumen.appendChild(em); 2187this.controles.appendChild(volumen); 2188volumen.altavoz = em; 2189volumen.style.position = "relative"; 2190var slider = document.createElement("div"); 2191slider.className = "playerMPEPV_slider"; 2192var selectorNivel = document.createElement("div"); 2193selectorNivel.className = 'playerMPEPV_selector_nivel'; 2194selectorNivel.id = "vdpep_audio" 2195slider.appendChild(selectorNivel); 2196var nivel = document.createElement("div"); 2197nivel.className = "playerMPEPV_nivel_slider"; 2198slider.appendChild(nivel); 2199volumen.appendChild(slider); 2200volumen.slider = slider; 2201volumen.selectorNivel = selectorNivel; 2202volumen.nivel = nivel; 2203this.contenedorVideo.appendChild(this.controles); 2204this.controles.volumen = volumen;
2205slider.style.bottom = ( volumen.offsetHeight ) + "px"; 2206this.ancho_controles += boton_play_pause.offsetWidth; 2207this.ancho_controles += tiempo.offsetWidth; 2208this.ancho_controles += duracion.offsetWidth; 2209this.ancho_controles += pantalla_completa.offsetWidth; 2210this.ancho_controles += volumen.offsetWidth; 2211barra.style.width = (this.controles.offsetWidth - 2 * margen - this.ancho_controles) + "px"; 2212barra.sliderseek.style.width = barra.style.width; 2213this.controles.volumen.maximo = slider.offsetHeight - 6; 2214this.controles.style.display = "block"; 2215if (!dispositivoMovil) 2216{ 2217var datosv = this.datosVideo; 2218volumen.onmouseover = function() { 2219if (!datosv.isMuted) slider.style.visibility = "visible" 2220}; 2221volumen.onmouseout = function() { slider.style.visibility = "hidden" }; 2222this.actualizaVolumen(); 2223this.pausado = document.createElement("div"); 2224this.pausado.className = "playerMPEPV_pausado"; 2225var play = document.createElement("span"); 2226play.className = "playerMPEPV_pausado_play"; 2227this.pausado.appendChild(play); 2228this.contenedorVideo.appendChild(this.pausado); 2229} 2230}; 2231playerHTML5.prototype.fullscreenChange = function(e) 2232{ 2233if (!screenfull.isFullscreen) 2234{ 2235document.removeEventListener(screenfull.raw.fullscreenchange, screenfull.func,true); 2236this.fullscreenWidth = MultimediaPEP[this.padre].datos.playerEPETParams.mediaWidth; 2237this.inFullscreen = false; 2238if (!versionMovil) 2239MultimediaPEP[this.padre].multimedia.resize(this.fullscreenWidth); 2240} 2241}; 2242playerHTML5.prototype.fullscreen = function() { 2243if (dispositivoMovil && this.datosVideo.webkitSupportFullscreen) 2244{ 2245this.nodoVideo.webkitEnterFullscreen(); 2246this.nodoVideo.addEventListener('webkitendfullscreen', this.bind(this, this.fullscreenChange),false); 2247} 2248else 2249{ 2250if (screenfull.enabled) 2251{ 2252if (screenfull.isFullscreen) 2253{ 2254screenfull.exit(); 2255this.inFullscreen = false; 2256this.fullscreenWidth = MultimediaPEP[this.padre].datos.playerEPETParams.mediaWidth; 2257this.fullscreenHeight = MultimediaPEP[this.padre].datos.playerEPETParams.mediaHeight; 2258} 2259else 2260{ 2261screenfull.request(this.contenedorVideo); 2262this.inFullscreen = true; 2263this.fullscreenWidth = IEv > 9 ? window.innerWidth : window.screen.width; 2264this.fullscreenHeight = IEv > 9 ? window.innerHeight :window.screen.height; 2265screenfull.func = this.fullscreenChange.bind(this); 2266document.addEventListener(screenfull.raw.fullscreenchange, screenfull.func, true); 2267} 2268var padre = this.padre; 2269var w = this.fullscreenWidth; 2270if (!versionMovil) 2271setTimeout( function(){MultimediaPEP[padre].multimedia.resize(w);},30); 2272} 2273} 2274}; 2275var MainController = function(playerHTML5) { 2276this.playerHTML5 = playerHTML5; 2277this.duracion = -1; 2278this.firstTime = false; 2279this.adsActive = false; 2280this.adsDone = false; 2281this.fullscreen = false; 2282this.adPlaying = false; 2283this.adsController = null; 2284this.puntoMedio = false; 2285this.finVideo = false; 2286this.hlsObj = null; 2287this.playerHTML5.datosVideo.loading = null; 2288this.playerHTML5.datosVideo.webkitSupportFullscreen = false; 2289this.video = this.playerHTML5.nodoVideo; 2290if (this.playerHTML5.controles) 2291{ 2292this.barra = this.playerHTML5.controles.barra; 2293this.playButton = this.playerHTML5.controles.playpause; 2294this.boton = -1; 2295if (this.playerHTML5.adSaltar != null) 2296{ 2297this.adSkip = this.playerHTML5.adSaltar; 2298this.adSkip.addEventListener( 2299'click', 2300this.bind(this, this.onAdSkip), 2301false); 2302} 2303this.playButton.addEventListener( 2304'click', 2305this.bind(this, this.onClick), 2306false); 2307this.fullscreenButton = this.playerHTML5.controles.fullscreen; 2308this.fullscreenButton.addEventListener( 2309'click', 2310this.bind(this, this.onFullscreenClick), 2311false); 2312this.barra.sliderseek.addEventListener( 2313'click', 2314this.bind(this, this.seek), 2315false); 2316this.volumen = this.playerHTML5.controles.volumen; 2317this.tiempo = this.playerHTML5.controles.tiempo; 2318this.textoDuracion = this.playerHTML5.controles.textoDuracion; 2319this.volumen.altavoz.addEventListener( 2320'click', 2321this.bind(this, this.onAltavozClick), 2322false); 2323this.volumen.selectorNivel.addEventListener( 2324'click', 2325this.bind(this, this.onSliderClick), 2326false); 2327this.volumen.selectorNivel.addEventListener( 2328'mousemove', 2329this.bind(this, this.onSliderMouseMove), 2330false); 2331this.volumen.selectorNivel.addEventListener( 2332'mousedown', 2333this.bind(this, this.onSliderMouseDown), 2334false); 2335this.volumen.selectorNivel.addEventListener( 2336'mouseup', 2337this.bind(this, this.onSliderMouseUp), 2338false); 2339this.volumen.selectorNivel.addEventListener( 2340mouseWheelEvent, 2341this.bind(this, this.onMousewheel),
2342false); 2343if (this.playerHTML5.datosVideo.isMuted && !dispositivoMovil) 2344this.onAltavozClick(); 2345} 2346this.video.addEventListener( 2347'timeupdate', 2348this.bind(this, this.onTimeupdate), 2349false); 2350 2351this.video.addEventListener( 2352mouseWheelEvent, 2353this.bind(this, this.onMousewheel), 2354false); 2355if (this.playerHTML5.adContainer != null) 2356this.adsController = new AdsController(this, this.playerHTML5); 2357if (this.playerHTML5.pausado) 2358{ 2359this.video.addEventListener( 2360'click', 2361this.bind(this, this.onPause), 2362false); 2363this.playerHTML5.pausado.addEventListener( 2364'mouseover', 2365this.bind(this, this.onPauseMouseOver), 2366false); 2367this.playerHTML5.pausado.addEventListener( 2368'click', 2369this.bind(this, this.onPauseClick), 2370false); 2371} 2372this.onClick(); 2373}; 2374MainController.prototype.cargaDatos = function(nuevosDatos) 2375{ 2376for (var key in nuevosDatos) 2377this.playerHTML5.datosVideo[key] = nuevosDatos[key]; 2378if (this.playerHTML5.datosVideo.m3u8 && (dispositivoMovil || canPlayHLS)) 2379{ 2380this.playerHTML5.datosVideo.hlsod = this.playerHTML5.datosVideo.m3u8; 2381} 2382if (this.playerHTML5.datosVideo.hlsod && this.playerHTML5.datosVideo.hlsod != "" ) 2383{ 2384if ( canPlayHLS && Hls) 2385{ 2386this.hlsObj = new Hls({debug:false}); 2387this.hlsObj.on(Hls.Events.MEDIA_ATTACHED, this.bind(this, this.onHlsAttached)); 2388var hls = this.hlsObj; 2389this.hlsObj.on(Hls.Events.ERROR, function(event,data) { 2390if (data.fatal) { 2391try{ 2392hls.swapAudioCodec(); 2393} 2394catch(e) 2395{ 2396console.info("fatal error"); 2397} 2398console.log("Error gordo"); 2399hls.recoverMediaError(); 2400} 2401}); 2402this.hlsObj.attachMedia(this.video); 2403this.video.addEventListener('seeking', this.bind(this, this.onSeeking),false); 2404this.video.addEventListener('seeked', this.bind(this, this.onSeeked),false); 2405this.playerHTML5.datosVideo.loading = document.createElement("div"); 2406this.playerHTML5.datosVideo.loading.className = "playerMPEPV_cloading"; 2407var circulo = document.createElement("div"); 2408circulo.className = "playerMPEPV_loading"; 2409this.playerHTML5.datosVideo.loading.appendChild(circulo); 2410this.playerHTML5.contenedorVideo.appendChild(this.playerHTML5.datosVideo.loading); 2411} 2412else 2413{ 2414if (dispositivoMovil) 2415this.video.setAttribute("src", this.playerHTML5.datosVideo.hlsod); 2416else 2417this.video.setAttribute("src", this.playerHTML5.datosVideo.src); 2418} 2419} 2420else 2421{ 2422this.video.setAttribute("src", this.playerHTML5.datosVideo.src); 2423} 2424if (userAgent.indexOf("android") > -1 && typeof(connectionPEP) != "undefined" && connectionPEP.type == "cellular") 2425{ 2426this.video.load(); 2427} 2428if (this.playerHTML5.datosVideo.spriteImg && this.playerHTML5.datosVideo.nSprites > 0 && !dispositivoMovil) 2429{ 2430var thumbnails = document.createElement("div"); 2431thumbnails.className = 'playerMPEPV_thumbnails'; 2432thumbnails.id = 'thumbnails'; 2433em = document.createElement("div"); 2434em.className = "playerMPEPV_time"; 2435em.appendChild ( document.createTextNode ( "00:00" ) ); 2436thumbnails.appendChild(em); 2437thumbnails.time = em; 2438this.barra.appendChild(thumbnails); 2439thumbnails.style.backgroundImage = 'url(' + this.playerHTML5.datosVideo.spriteImg + ')'; 2440this.playerHTML5.controles.thumbnails = thumbnails; 2441thumbnails.onmouseover = function(e) { thumbnails.style.visibility = "hidden"; 2442e.stopPropagation(); 2443} 2444this.playerHTML5.controles.barra.onmouseover = function(e) { 2445thumbnails.style.visibility = "visible" 2446} 2447this.barra.sliderseek.ns = this.playerHTML5.datosVideo.nSprites; 2448this.barra.sliderseek.onmouseout = function() { thumbnails.style.visibility = "hidden" } 2449this.barra.sliderseek.onmousemove = function(e) { 2450var pos = e.layerX / e.target.offsetWidth; 2451var n = Math.floor(pos * this.ns); 2452var fila = 0; 2453var columna = 0; 2454if (n < this.ns) 2455{ 2456fila = Math.floor(n / 10); 2457columna = n % 10; 2458thumbnails.style.backgroundPosition = (-1 * columna * 100) + 'px ' + (-1 * fila * 56) + 'px'; 2459thumbnails.style.left = (pos * e.target.offsetWidth - 30 ) + 'px'; 2460} 2461} 2462} 2463if (!dispositivoMovil) 2464{ 2465if (this.playerHTML5.controles.thumbnails) 2466{ 2467this.time = this.playerHTML5.controles.thumbnails.time; 2468this.playerHTML5.controles.barra.sliderseek.addEventListener( 2469'mousemove', 2470this.bind(this, this.seekmove), 2471false); 2472} 2473this.volumen.addEventListener( 2474'mouseout', 2475this.bind(this, this.volumenMouseOut), 2476false); 2477} 2478} 2479MainController.prototype.bind = function(thisObj, fn) 2480{ 2481return function() { 2482fn.apply(thisObj, arguments); 2483}; 2484}; 2485MainController.prototype.onHlsAttached = function(e) 2486{
2487this.hlsObj.loadSource(this.playerHTML5.datosVideo.hlsod); 2488} 2489MainController.prototype.onSeeking = function(e) 2490{ 2491if (this.playerHTML5.datosVideo.loading) 2492this.playerHTML5.datosVideo.loading.className = "playerMPEPV_cloading visible"; 2493} 2494MainController.prototype.onSeeked = function(e) 2495{ 2496if (this.playerHTML5.datosVideo.loading) 2497this.playerHTML5.datosVideo.loading.className = "playerMPEPV_cloading"; 2498} 2499MainController.prototype.onPause = function(e) 2500{ 2501if (!this.playerHTML5.playing ) 2502return; 2503this.playerHTML5.pausado.style.display = "block"; 2504this.pause(); 2505} 2506MainController.prototype.onPauseMouseOver = function(e) 2507{ 2508this.playerHTML5.controles.style.display = 'none'; 2509} 2510MainController.prototype.onPauseClick = function(e) 2511{ 2512this.resumeAfterAd(); 2513this.adsDone = true; 2514this.playerHTML5.pausado.style.display = "none"; 2515this.playerHTML5.controles.style.display = 'block'; 2516} 2517MainController.prototype.onTimeupdate = function(e) 2518{ 2519if (isNaN(e.target.duration) || e.target.duration < 0 || this.video.currentTime < 0.1 || (this.playerHTML5.datosVideo.tipoReproduccion == "streaming" && !this.playerHTML5.playing)) 2520{ 2521e.preventDefault(); 2522return false; 2523} 2524if (!this.firstTime) 2525{ 2526if (this.playerHTML5.controlesNativosVideo) 2527{ 2528this.playerHTML5.nodoVideo.setAttribute ( "controls" , "controls" ); 2529} 2530this.firstTime = true; 2531this.puntoMedio = false; 2532this.playerHTML5.nodoVideo.style.display = 'block'; 2533if (this.playerHTML5.controles) 2534{ 2535this.playerHTML5.controles.style.visibility = 'visible'; 2536if (this.playerHTML5.datosVideo.tipoReproduccion == "streaming") 2537{ 2538this.playerHTML5.controles.tiempo.style.width = (this.playerHTML5.controles.tiempo.offsetWidth + this.playerHTML5.controles.barra.offsetWidth) + "px"; 2539this.playerHTML5.controles.tiempo.style.textAlign = "left"; 2540this.playerHTML5.controles.tiempo.texto.innerHTML = (LANG_MSG[LANG].directo).toUpperCase() 2541this.playerHTML5.controles.barra.style.display = "none"; 2542this.playerHTML5.controles.textoDuracion.style.visibility = "hidden"; 2543} 2544} 2545if (this.playerHTML5.adContainer != null) 2546this.playerHTML5.adContainer.style.display = 'none'; 2547this.duracion = e.target.duration; 2548if (!this.playerHTML5.controlesNativosVideo) 2549this.actualizaTiempo(-1); 2550this.playerHTML5.marcado._datosMarcado.ad = ""; 2551this.playerHTML5.marcado._datosMarcado.adCue = ""; 2552this.playerHTML5.marcado._datosMarcado.duracion = this.duracion; 2553if (typeof(this.playerHTML5.marcado._datosMarcado.adTitle) == "undefined" || this.playerHTML5.marcado._datosMarcado.adTitle.indexOf(":-:") == -1) 2554this.playerHTML5.marcado._datosMarcado.adTitle = ""; 2555this.playerHTML5.marcado._datosMarcado.uid = this.playerHTML5.datosVideo.uid; 2556this.playerHTML5.marcado._datosMarcado.seccion_creacion = this.playerHTML5.datosVideo.seccion_creacion; 2557this.playerHTML5.marcado._datosMarcado.fuente = this.playerHTML5.datosVideo.fuente; 2558this.playerHTML5.marcado._datosMarcado.tags = this.playerHTML5.datosVideo.tagsIds; 2559this.playerHTML5.marcado._datosMarcado.autores = this.playerHTML5.datosVideo.autoresIds; 2560this.playerHTML5.marcado.marcaEvento("mediaBegin"); 2561MultimediaReproduciendo(this.playerHTML5.datosVideo.id_video, false); 2562} 2563if (this.playerHTML5.datosVideo.tipoReproduccion == 'streaming') 2564return; 2565if (!this.playerHTML5.controlesNativosVideo && this.playerHTML5.controles) 2566{ 2567this.tiempo.texto.innerHTML = tiempoBonito( this.video.currentTime ); 2568this.barra.progreso.style.width = (this.video.currentTime * 100 / this.duracion) + "%"; 2569} 2570if (!this.puntoMedio && Math.abs(this.duracion/2 - this.video.currentTime) < 0.3) 2571{ 2572this.puntoMedio = true; 2573this.playerHTML5.marcado._datosMarcado.ad = ""; 2574this.playerHTML5.marcado._datosMarcado.adCue = ""; 2575this.playerHTML5.marcado._datosMarcado.duracion = this.duracion; 2576this.playerHTML5.marcado._datosMarcado.adTitle = ""; 2577this.playerHTML5.marcado._datosMarcado.uid = this.playerHTML5.datosVideo.uid; 2578this.playerHTML5.marcado._datosMarcado.seccion_creacion = this.playerHTML5.datosVideo.seccion_creacion; 2579this.playerHTML5.marcado._datosMarcado.fuente = this.playerHTML5.datosVideo.fuente; 2580this.playerHTML5.marcado._datosMarcado.tags = this.playerHTML5.datosVideo.tagsIds; 2581this.playerHTML5.marcado._datosMarcado.autores = this.playerHTML5.datosVideo.autoresIds; 2582this.playerHTML5.marcado.marcaEvento("halfmediaComplete"); 2583} 2584if (!this.finVideo && Math.abs(this.duracion - this.video.currentTime) < 0.3) 2585{ 2586this.finVideo = true; 2587var nn = this; 2588setTimeout(function(){nn.onContentEnded();},300); 2589} 2590}; 2591MainController.prototype.onContentEnded = function() { 2592this.playerHTML5.marcado._datosMarcado.ad = ""; 2593this.playerHTML5.marcado._datosMarcado.adCue = ""; 2594this.playerHTML5.marcado._datosMarcado.duracion = this.duracion; 2595this.playerHTML5.marcado._datosMarcado.uid = this.playerHTML5.datosVideo.uid; 2596this.playerHTML5.marcado._datosMarcado.adTitle = ""; 2597this.playerHTML5.marcado._datosMarcado.seccion_creacion = this.playerHTML5.datosVideo.seccion_creacion; 2598this.playerHTML5.marcado._datosMarcado.fuente = this.playerHTML5.datosVideo.fuente; 2599this.playerHTML5.marcado._datosMarcado.tags = this.playerHTML5.datosVideo.tagsIds; 2600this.playerHTML5.marcado._datosMarcado.autores = this.playerHTML5.datosVideo.autoresIds; 2601this.playerHTML5.marcado.marcaEvento("mediaComplete"); 2602if (typeof(this.playerHTML5.datosVideo.autopromo) != "undefined" && this.playerHTML5.datosVideo.autopromo != "") 2603{ 2604this.playerHTML5.nodoVideo.setAttribute("src", this.playerHTML5.datosVideo.autopromo); 2605this.playerHTML5.controles.style.height = "0px"; 2606this.playerHTML5.nodoVideo.addEventListener("ended", this.bind(this, this.onAutopromoEnd), 2607false); 2608this.playerHTML5.datosVideo.autopromo = ""; 2609this.playerHTML5.nodoVideo.play(); 2610return; 2611} 2612if (this.playerHTML5.datosVideo.publicidad_post_roll) 2613{ 2614this.adsDone = false;
2615if (this.adsController) 2616this.adsController.contentEnded(); 2617} 2618else 2619{ 2620this.restart(); 2621} 2622}; 2623MainController.prototype.onAutopromoEnd = function() 2624{ 2625this.playerHTML5.nodoVideo.removeEventListener("ended", this.onAutopromoEnd); 2626this.restart(); 2627this.playerHTML5.controles.style.height = "30px"; 2628} 2629MainController.prototype.restart = function() 2630{ 2631if (this.playerHTML5.controlesNativosVideo) 2632this.playerHTML5.nodoVideo.setAttribute ( "controls" , "controls" ); 2633if (this.playerHTML5.controles && this.playerHTML5.controles.thumbnails) 2634this.playerHTML5.controles.thumbnails.style.visibility = "hidden"; 2635if (this.adPlaying) 2636{ 2637this.ocultaSaltar(); 2638this.adsController.adSkip(); 2639this.playerHTML5.nodoVideo.style.display = 'block'; 2640} 2641else 2642{ 2643this.playerHTML5.nodoVideo.currentTime = 0.01; 2644this.playerHTML5.nodoVideo.pause(); 2645this.playerHTML5.playing = false; 2646} 2647this.updateChrome(); 2648this.adsDone = false; 2649this.firstTime = false; 2650this.finVideo = false; 2651this.playerHTML5.marcado.eventos = {}; 2652if (this.adsController) 2653{ 2654this.adsController.contentCompleteCalled = false; 2655this.adsController.adPosition = "pre-roll"; 2656} 2657if (this.playerHTML5.datosVideo.modoSiguientesVideos > 0 ) 2658{ 2659var canal = this.playerHTML5.datosVideo.agrsNombreNormalizado.split(",")[0]; 2660siguientesVideos( canal, this.playerHTML5.datosVideo.id_video); 2661return; 2662} 2663this.playerHTML5.pausado.style.display = "block"; 2664this.playerHTML5.playing = false; 2665} 2666MainController.prototype.actualizaTiempo = function(tiempo, ad) 2667{ 2668if (isIphone) 2669return; 2670if (ad) 2671{ 2672if (tiempo == 0) 2673this.textoDuracion.texto.innerHTML = ""; 2674else 2675this.textoDuracion.texto.innerHTML = tiempo.toFixed(0) + " s"; 2676} 2677else 2678{ 2679if (!this.playerHTML5.controlesNativosVideo) 2680{ 2681if (tiempo == -1) 2682this.textoDuracion.texto.innerHTML = tiempoBonito(this.duracion); 2683else 2684this.textoDuracion.texto.innerHTML = tiempoBonito(tiempo); 2685} 2686} 2687} 2688MainController.prototype.onAltavozClick = function() { 2689this.playerHTML5.controles.volumen.altavoz.className = this.playerHTML5.controles.volumen.altavoz.className.replace(/ playerMPEPV_silencio/g,""); 2690if (this.playerHTML5.nodoVideo.volume == 0) 2691{ 2692if (this.adsActive) 2693this.adsController.setVolume(this.playerHTML5.volumenActual); 2694this.playerHTML5.setVolume(this.playerHTML5.volumenActual); 2695this.playerHTML5.datosVideo.isMuted = false; 2696this.playerHTML5.controles.volumen.onmouseover(); 2697} 2698else 2699{ 2700this.playerHTML5.volumenActual = this.playerHTML5.nodoVideo.volume; 2701this.playerHTML5.controles.volumen.altavoz.className += " playerMPEPV_silencio"; 2702if (this.adsActive) 2703this.adsController.setVolume(0); 2704this.playerHTML5.setVolume(0); 2705this.playerHTML5.datosVideo.isMuted = true; 2706this.playerHTML5.controles.volumen.onmouseout(); 2707} 2708}; 2709MainController.prototype.volumenMouseOut = function() { 2710this.boton = -1; 2711} 2712MainController.prototype.setVolume = function(volumen) { 2713if (volumen <0 || volumen > 1) 2714return; 2715if (this.adsActive) 2716this.adsController.setVolume(volumen); 2717this.playerHTML5.setVolume(volumen); 2718}; 2719MainController.prototype.seekjs = function(segundo) { 2720this.video.currentTime = segundo; 2721if (!this.playerHTML5.playing) 2722{ 2723this.playerHTML5.play(); 2724this.adsActive = false; 2725this.adsDone = true; 2726this.updateChrome(); 2727} 2728}; 2729MainController.prototype.seek = function(e) { 2730var pos = this.duracion * e.layerX / e.target.offsetWidth; 2731this.video.currentTime = pos; 2732if (!this.playerHTML5.playing) 2733{ 2734this.playerHTML5.play(); 2735this.adsActive = false; 2736this.adsDone = true; 2737this.updateChrome(); 2738} 2739}; 2740MainController.prototype.seekmove = function(e) { 2741var pos = this.video.duration * e.layerX / e.target.offsetWidth; 2742this.time.innerHTML = tiempoBonito(pos); 2743this.time.style.left = (50 - this.time.offsetWidth / 2) + "px"; 2744}; 2745MainController.prototype.onSliderClick = function(event) { 2746var volumen = 1-((event.offsetY ? event.offsetY : event.layerY) / event.target.offsetHeight); 2747this.setVolume(volumen); 2748}; 2749MainController.prototype.onSliderMouseMove = function(event) { 2750if (this.boton != 1) 2751return; 2752var volumen = 1-((event.offsetY ? event.offsetY : event.layerY) / event.target.offsetHeight); 2753this.setVolume(volumen); 2754}; 2755MainController.prototype.onSliderMouseDown = function(event) { 2756this.boton = event.buttons ? event.buttons : event.which; 2757}; 2758MainController.prototype.onSliderMouseUp = function(event) { 2759this.boton = -1 2760}; 2761MainController.prototype.onMousewheel = function(event) { 2762var e = window.event || event; 2763var delta = e.detail ? event.detail : event.wheelDelta; 2764delta = delta * factorVolumen; 2765if (delta > 0)
2766this.setVolume(this.playerHTML5.nodoVideo.volume + 0.02); 2767else 2768this.setVolume(this.playerHTML5.nodoVideo.volume - 0.02); 2769}; 2770MainController.prototype.onClick = function() { 2771if (this.playerHTML5.adContainer != null && !this.adsDone) 2772{ 2773this.adsController.initialUserAction(); 2774this.playerHTML5.preloadContent(this.bind(this, this.loadAds)); 2775this.adsDone = true; 2776return; 2777} 2778if (this.adsActive) 2779{ 2780if (this.adPlaying) 2781this.adsController.pause(); 2782else 2783this.adsController.resume(); 2784this.adPlaying = !this.adPlaying; 2785} 2786else 2787{ 2788if (this.playerHTML5.playing) 2789this.playerHTML5.pause(); 2790else 2791this.playerHTML5.play(); 2792} 2793this.updateChrome(); 2794}; 2795MainController.prototype.onFullscreenClick = function() { 2796this.playerHTML5.fullscreen(); 2797}; 2798MainController.prototype.updateChrome = function() { 2799if ( !this.playerHTML5.controles) 2800return; 2801var activo = (this.adsActive) ? this.adPlaying : this.playerHTML5.playing; 2802if (activo) 2803this.playButton.className = "playerMPEPV_boton_play_pause playerMPEPV_boton_pause"; 2804else 2805this.playButton.className = "playerMPEPV_boton_play_pause playerMPEPV_boton_play"; 2806}; 2807MainController.prototype.resumeAfterAd = function() { 2808this.adPlaying = false; 2809this.adsActive = false; 2810this.playerHTML5.play(); 2811this.updateChrome(); 2812}; 2813MainController.prototype.pause = function() { 2814if (this.adPlaying) 2815this.adsController.pause(); 2816if (this.playerHTML5.playing) 2817this.playerHTML5.pause(); 2818this.adPlaying = false; 2819this.updateChrome(); 2820}; 2821MainController.prototype.pauseForAd = function() { 2822this.adsActive = true; 2823this.adPlaying = false; 2824this.playerHTML5.pause(); 2825this.updateChrome(); 2826}; 2827MainController.prototype.startAd = function() { 2828this.adsActive = true; 2829this.adPlaying = true; 2830this.updateChrome(); 2831}; 2832MainController.prototype.adClicked = function() { 2833this.adsActive = true; 2834this.adsController.pause(); 2835this.adPlaying = false; 2836this.updateChrome(); 2837}; 2838MainController.prototype.loadAds = function() { 2839this.adsController.requestAds(this.playerHTML5.adTagUrl); 2840}; 2841MainController.prototype.onAdSkip = function() { 2842this.playerHTML5.marcado._datosMarcado.ad = this.adsController.adInfo; 2843this.playerHTML5.marcado._datosMarcado.adCue = this.adsController.adPosition; 2844this.playerHTML5.marcado._datosMarcado.duracion = this.adsController.duracionAd; 2845this.playerHTML5.marcado._datosMarcado.adTitle = this.adsController.adTitle; 2846this.playerHTML5.marcado._datosMarcado.uid = this.playerHTML5.datosVideo.uid; 2847this.playerHTML5.marcado._datosMarcado.seccion_creacion = this.playerHTML5.datosVideo.seccion_creacion; 2848this.playerHTML5.marcado._datosMarcado.fuente = this.playerHTML5.datosVideo.fuente; 2849this.playerHTML5.marcado._datosMarcado.tags = this.playerHTML5.datosVideo.tagsIds; 2850this.playerHTML5.marcado._datosMarcado.autores = this.playerHTML5.datosVideo.autoresIds; 2851this.playerHTML5.marcado.marcaEvento("adSkip"); 2852this.ocultaSaltar(); 2853this.adsController.adSkip(); 2854}; 2855MainController.prototype.muestraSaltar = function() 2856{ 2857if (this.adSkip) 2858this.adSkip.style.display = 'block'; 2859} 2860MainController.prototype.ocultaSaltar = function() 2861{ 2862if (this.adSkip) 2863this.adSkip.style.display = 'none'; 2864} 2865var AdsController = function(controller, player) { 2866this.controller = controller; 2867this.player = player; 2868this.contentCompleteCalled = false; 2869this.duracionAd = 0; 2870this.adPosition = "pre-roll"; 2871this.adInfo = "dfp"; 2872this.skippable = false; 2873this.adComplete = false; 2874this.adDisplayContainer = new google.ima.AdDisplayContainer(this.player.adContainer); 2875this.adsLoader = new google.ima.AdsLoader(this.adDisplayContainer); 2876if (this.adsLoader) 2877{ 2878var settings = this.adsLoader.getSettings(); 2879settings.setNumRedirects(5); 2880} 2881this.adsManager = null; 2882this.adsLoader.addEventListener( 2883google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, 2884this.onAdsManagerLoaded, 2885false, 2886this); 2887this.adsLoader.addEventListener( 2888google.ima.AdErrorEvent.Type.AD_ERROR, 2889this.onAdError, 2890false, 2891this); 2892}; 2893AdsController.prototype.bind = function(thisObj, fn) 2894{ 2895return function() { 2896fn.apply(thisObj, arguments); 2897}; 2898}; 2899AdsController.prototype.initialUserAction = function() { 2900this.adDisplayContainer.initialize(); 2901}; 2902AdsController.prototype.requestAds = function(adTagUrl) { 2903adTagUrl = adTagUrl.replace("{random}", String(Math.random()).substr(2,9)); 2904if (this.adPosition == "pre-roll") 2905adTagUrl = adTagUrl.replace("{cuePointType}", "pre"); 2906else 2907adTagUrl = adTagUrl.replace("{cuePointType}", "post"); 2908if (this.adsLoader) 2909{ 2910this.adsLoader.contentComplete(); 2911} 2912var adsRequest = new google.ima.AdsRequest(); 2913adsRequest.adTagUrl = adTagUrl; 2914adsRequest.linearAdSlotWidth = this.player.width; 2915adsRequest.linearAdSlotHeight = this.player.height; 2916adsRequest.nonLinearAdSlotWidth = this.player.width; 2917adsRequest.nonLinearAdSlotHeight = this.player.height; 2918var adunit = adTagUrl.replace(/^.*iu=/, ""); 2919adunit = unescape(adunit.replace(/\&.*$/, "")); 2920this.player.marcado._datosMarcado.duracion = 0; 2921this.player.marcado._datosMarcado.ad = ""; 2922this.player.marcado._datosMarcado.adCue = this.adPosition + "-" + adunit; 2923this.player.marcado._datosMarcado.adTitle = ""; 2924this.player.marcado._datosMarcado.uid = this.player.datosVideo.uid; 2925this.player.marcado._datosMarcado.seccion_creacion = this.player.datosVideo.seccion_creacion; 2926this.player.marcado._datosMarcado.fuente = this.player.datosVideo.fuente; 2927this.player.marcado._datosMarcado.tags = this.player.datosVideo.tagsIds; 2928this.player.marcado._datosMarcado.autores = this.player.datosVideo.autoresIds; 2929this.player.marcado.marcaEvento("adRequest"); 2930this.adsLoader.requestAds(adsRequest); 2931if (this.adPosition == "pre-roll") 2932this.timeoutLoadedStarted = setTimeout(this.resumeOnError.bind(this), 4000); 2933}; 2934AdsController.prototype.onAdsManagerLoaded = function(adsManagerLoadedEvent) { 2935this.controller.actualizaTiempo(0,true); 2936this.adsManager = adsManagerLoadedEvent.getAdsManager( 2937this.player.nodoVideo); 2938this.processAdsManager(this.adsManager); 2939if (this.player.datosVideo.isMuted) 2940this.adsManager.setVolume(0); 2941}; 2942AdsController.prototype.processAdsManager = function(adsManager) { 2943adsManager.addEventListener( 2944google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, 2945this.onContentPauseRequested, 2946false, 2947this); 2948adsManager.addEventListener( 2949google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, 2950this.onContentResumeRequested, 2951false, 2952this); 2953adsManager.addEventListener( 2954google.ima.AdErrorEvent.Type.AD_ERROR, 2955this.onAdError, 2956false, 2957this); 2958var events = [google.ima.AdEvent.Type.ALL_ADS_COMPLETED, 2959google.ima.AdEvent.Type.CLICK, 2960google.ima.AdEvent.Type.COMPLETE, 2961google.ima.AdEvent.Type.LOADED, 2962google.ima.AdEvent.Type.PAUSED, 2963google.ima.AdEvent.Type.RESUMED, 2964google.ima.AdEvent.Type.STARTED 2965]; 2966for (var index in events) 2967{ 2968adsManager.addEventListener( 2969events[index], 2970this.onAdEvent, 2971false, 2972this); 2973} 2974var initWidth, initHeight; 2975if (this.controller.fullscreen) 2976{ 2977initWidth = this.controller.fullscreenWidth; 2978initHeight = this.controller.fullscreenHeight; 2979} 2980else 2981{ 2982initWidth = this.player.width; 2983initHeight = this.player.height; 2984} 2985adsManager.init( 2986initWidth, 2987initHeight, 2988google.ima.ViewMode.NORMAL); 2989adsManager.start(); 2990}; 2991AdsController.prototype.pause = function() { 2992if (this.adsManager) 2993this.adsManager.pause(); 2994clearInterval(this.intervalTimmer); 2995}; 2996AdsController.prototype.resume = function() { 2997if (this.adsManager) { 2998this.adsManager.resume(); 2999} 3000}; 3001AdsController.prototype.setVolume = function(volumen) { 3002if (this.adsManager) 3003{ 3004this.adsManager.setVolume(volumen); 3005this.player.actualizaVolumen(); 3006} 3007}; 3008AdsController.prototype.onContentPauseRequested = function() { 3009this.controller.pauseForAd(); 3010}; 3011AdsController.prototype.onContentResumeRequested = function() { 3012if (this.adPosition == 'post-roll') 3013return; 3014clearInterval(this.intervalTimmer); 3015if (!this.contentCompleteCalled) 3016this.controller.resumeAfterAd(); 3017}; 3018AdsController.prototype.onAdEvent = function(adEvent) { 3019switch (adEvent.type) 3020{ 3021case google.ima.AdEvent.Type.CLICK: 3022clearInterval(this.intervalTimmer); 3023this.controller.adClicked(); 3024break; 3025case google.ima.AdEvent.Type.STARTED: 3026clearTimeout(this.timeoutLoadedStarted); 3027var ad = adEvent.getAd(); 3028if (ad.isLinear()) 3029{ 3030if (this.player.adContainer != null) 3031{ 3032this.player.adContainer.style.display = 'block'; 3033if (this.player.controles) 3034{ 3035this.player.controles.barra.style.visibility = 'hidden'; 3036this.player.controles.tiempo.style.width = this.player.controles.tiempo.offsetWidth + "px"; 3037this.player.controles.fullscreen.style.visibility = 'hidden'; 3038this.player.controles.tiempo.texto.innerHTML = (LANG_MSG[LANG].publicidad).toUpperCase(); 3039if (isIpad) 3040this.player.controles.volumen.style.visibility = 'hidden'; 3041} 3042if (dispositivoMovil || this.player.controlesNativosVideo) 3043{ 3044this.player.contenedorVideo.className = this.player.contenedorVideo.className.replace(/ playerMPEPV_touch_\w*/g,""); 3045this.player.contenedorVideo.className += " playerMPEPV_touch_publicidad"; 3046this.player.nodoVideo.removeAttribute("controls"); 3047} 3048this.controller.startAd(); 3049MultimediaReproduciendo(this.player.datosVideo.id_video, false); 3050this.duracionAd = -2; 3051this.adComplete = false;
3052this.intervalTimmer = setInterval( this.onProgress.bind(this), 300); 3053} 3054} 3055break; 3056case google.ima.AdEvent.Type.ALL_ADS_COMPLETED: 3057this.player.nodoVideo.style.display = 'block'; 3058if (this.player.controles) 3059{ 3060this.player.controles.style.visibility = 'visible'; 3061this.player.controles.barra.style.visibility = 'visible'; 3062this.player.controles.fullscreen.style.visibility = 'visible'; 3063this.player.controles.tiempo.texto.innerHTML = '00:00'; 3064} 3065this.player.adContainer.style.display = 'none'; 3066this.controller.adPlaying = false; 3067this.controller.adsActive = false; 3068this.controller.actualizaTiempo(-1); 3069this.controller.ocultaSaltar() 3070if (this.adComplete) 3071{ 3072this.adComplete = false; 3073this.player.marcado._datosMarcado.duracion = this.duracionAd; 3074this.player.marcado._datosMarcado.ad = this.adInfo; 3075this.player.marcado._datosMarcado.adCue = this.adPosition; 3076this.player.marcado._datosMarcado.adTitle = this.adTitle; 3077this.player.marcado._datosMarcado.uid = this.player.datosVideo.uid; 3078this.player.marcado._datosMarcado.seccion_creacion = this.player.datosVideo.seccion_creacion; 3079this.player.marcado._datosMarcado.fuente = this.player.datosVideo.fuente; 3080this.player.marcado._datosMarcado.tags = this.player.datosVideo.tagsIds; 3081this.player.marcado._datosMarcado.autores = this.player.datosVideo.autoresIds; 3082this.player.marcado.marcaEvento("adComplete"); 3083if (this.adPosition == "post-roll") 3084{ 3085this.adPosition = 'pre-roll'; 3086this.controller.restart(); 3087} 3088} 3089else 3090{ 3091this.controller.onAdSkip(); 3092} 3093clearInterval(this.intervalTimmer); 3094if (dispositivoMovil || this.player.controlesNativosVideo) 3095{ 3096this.player.contenedorVideo.className = this.player.contenedorVideo.className.replace(/ playerMPEPV_touch[\w_]*/g,""); 3097this.player.contenedorVideo.className += " playerMPEPV_touch"; 3098this.player.nodoVideo.setAttribute ( "controls" , "controls" ); 3099} 3100break; 3101case google.ima.AdEvent.Type.PAUSED: 3102clearInterval(this.intervalTimmer); 3103break; 3104case google.ima.AdEvent.Type.RESUMED: 3105this.intervalTimmer = setInterval( this.onProgress.bind(this), 300); 3106MultimediaReproduciendo(this.player.datosVideo.id_video, false); 3107break; 3108case google.ima.AdEvent.Type.LOADED: 3109clearTimeout(this.timeoutLoadedStarted); 3110var ad = adEvent.getAd(); 3111if (typeof(ad.isSkippable()) != "undefined" && ad.isSkippable()) 3112this.skippable = true; 3113this.adTitle = ad.getAdId() + " - " + ad.getTitle(); 3114if (!ad.isLinear()) { 3115this.controller.resumeAfterAd(); 3116return; 3117} 3118if (ad.getWrapperAdIds().length == 0) 3119this.adInfo = "dfp"; 3120else 3121this.adInfo = "tercero"; 3122if (this.player.controles && this.player.controles.thumbnails) 3123this.player.controles.thumbnails.style.visibility = "hidden"; 3124break; 3125} 3126}; 3127AdsController.prototype.resumeOnError = function() 3128{ 3129if (this.adsManager) 3130this.adsManager.stop(); 3131else 3132this.onContentResumeRequested(); 3133} 3134AdsController.prototype.onProgress = function() 3135{ 3136if (this.adsManager.getRemainingTime() <= 0) 3137return; 3138if (!this.controller.adPlaying || this.duracionAd <= 1 || this.duracionAd >99 ) 3139{ 3140this.duracionAd = this.adsManager.getRemainingTime(); 3141if (this.player.controles) 3142this.player.controles.style.visibility = 'visible'; 3143this.player.marcado._datosMarcado.duracion = this.duracionAd; 3144this.player.marcado._datosMarcado.ad = this.adInfo; 3145this.player.marcado._datosMarcado.adCue = this.adPosition; 3146this.player.marcado._datosMarcado.adTitle = this.adTitle; 3147this.player.marcado._datosMarcado.uid = this.player.datosVideo.uid; 3148this.player.marcado._datosMarcado.seccion_creacion = this.player.datosVideo.seccion_creacion; 3149this.player.marcado._datosMarcado.fuente = this.player.datosVideo.fuente; 3150this.player.marcado._datosMarcado.tags = this.player.datosVideo.tagsIds; 3151this.player.marcado._datosMarcado.autores = this.player.datosVideo.autoresIds; 3152this.player.marcado.marcaEvento("adStart"); 3153return; 3154} 3155if (this.adPosition == "pre-roll" ) 3156{ 3157if (!isIphone && !this.skippable && this.adsManager.getRemainingTime() > 2 && this.adsManager.getRemainingTime() < this.duracionAd - 7) 3158{ 3159this.controller.muestraSaltar(); 3160} 3161if (isIphone && this.adsManager.getRemainingTime() < this.duracionAd - 21) 3162{ 3163clearInterval(this.intervalTimmer); 3164this.adsManager.stop(); 3165} 3166} 3167if (!isIphone && this.adsManager.getRemainingTime() > 1) 3168this.controller.actualizaTiempo(this.adsManager.getRemainingTime(), true); 3169if (this.adsManager.getRemainingTime() < 0.5) 3170this.adComplete = true; 3171}; 3172AdsController.prototype.onAdError = function(adErrorEvent) { 3173var adError = adErrorEvent.getError(); 3174this.player.marcado._datosMarcado.adCue = this.adPosition; 3175this.player.marcado._datosMarcado.ad = this.adInfo; 3176this.player.marcado._datosMarcado.uid = this.player.datosVideo.uid; 3177this.player.marcado._datosMarcado.seccion_creacion = this.player.datosVideo.seccion_creacion; 3178this.player.marcado._datosMarcado.fuente = this.player.datosVideo.fuente; 3179this.player.marcado._datosMarcado.adTitle = (this.adTitle ? this.adTitle : "error ad_load")+ ":-:" + adError.getErrorCode() + (adError.getErrorCode() != adError.getVastErrorCode() ? ("-" + adError.getVastErrorCode() ): ""); 3180this.player.marcado.marcaEvento("adError"); 3181this.player.nodoVideo.style.display = 'block'; 3182if (this.player.controles) 3183this.player.controles.style.visibility = 'visible'; 3184this.player.adContainer.style.display = 'none'; 3185if (dispositivoMovil || this.player.controlesNativosVideo) 3186{ 3187this.player.contenedorVideo.className = this.player.contenedorVideo.className.replace(/ playerMPEPV_touch[\w_]+/g,""); 3188this.player.contenedorVideo.className += " playerMPEPV_touch"; 3189this.player.nodoVideo.setAttribute ( "controls" , "controls" ); 3190} 3191if (this.adPosition == 'post-roll') 3192{ 3193this.adPosition = 'pre-roll'; 3194this.controller.restart(); 3195} 3196else 3197{ 3198clearTimeout(this.timeoutLoadedStarted); 3199this.controller.resumeAfterAd(); 3200} 3201if (this.adsManager) { 3202this.adsManager.destroy(); 3203} 3204this.controller.adPlaying = false;
3205this.controller.adsActive = false; 3206}; 3207AdsController.prototype.resize = function(width, height) { 3208if (this.adsManager) 3209this.adsManager.resize(width, height, google.ima.ViewMode.FULLSCREEN); 3210}; 3211AdsController.prototype.contentEnded = function() { 3212if (!dispositivoMovil) 3213{ 3214this.adPosition = 'post-roll'; 3215this.contentCompleteCalled = true; 3216this.controller.adsActive = false; 3217this.duracionAd = -2; 3218this.controller.onClick(); 3219} 3220else 3221this.controller.restart(); 3222}; 3223AdsController.prototype.adSkip = function() { 3224clearInterval(this.intervalTimmer); 3225this.adsManager.stop(); 3226this.controller.adsActive = false; 3227this.controller.adPlaying = false; 3228}; 3229function VDPEP_Player_Cartelera(refVideo, ancho, alto, idDiv, publi, keywords, fotograma, urlNoticia, genero) 3230{ 3231id_div_ReproductorVideo = idDiv; 3232datosVideo = {}; 3233datosVideo.playerEPETParams = {"mediaWidth":ancho, "mediaHeight":alto, "URLMediaFile":"", "URLMediaStill":fotograma, "URLFirstFrame":fotograma, "compactMode": 'false'}; 3234datosVideo.anchoPlayer = ancho; 3235datosVideo.altoPlayer = alto; 3236datosVideo.idRefBrightcove = refVideo.replace(/_0$/,""); 3237datosVideo.publiActiva = publi; 3238datosVideo.keywordsVideo = keywords; 3239datosVideo.urlNoticia = ""; 3240datosVideo.tituloVideo = ""; 3241var video = new EPET_Video(datosVideo, id_div_ReproductorVideo); 3242} 3243function EPET_VideoPlayerGeobloqueado(idReferencia, ancho, alto, fotograma, idDivContenedor) 3244{ 3245EPET_VideoPlayerBloqueado(idReferencia, ancho, alto, fotograma, '0', idDivContenedor); 3246} 3247function EPET_VideoPlayerBloqueado(idReferencia, ancho, alto, fotograma, causaBloqueo, idDivContenedor, esAudio) 3248{ 3249if ( !css_multimedia_cargado) 3250{ 3251css_multimedia_cargado = true; 3252var css = document.createElement("link"); 3253css.type = "text/css"; 3254css.rel = "stylesheet"; 3255css.href = css_multimedia; 3256document.getElementsByTagName("head")[0].appendChild(css); 3257} 3258var id_div_ReproductorVideo; 3259var idImage = "img_" + idReferencia; 3260var texto_error; 3261switch(String(causaBloqueo)) { 3262case "0": 3263texto_error = esAudio ? LANG_MSG[LANG].audio_geobloqueado : LANG_MSG[LANG].geobloqueado; 3264break; 3265case "1": 3266texto_error = esAudio ? LANG_MSG[LANG].audio_aun_no_disponible : LANG_MSG[LANG].aun_no_disponible; 3267break;
3268case "2": 3269texto_error = esAudio ? LANG_MSG[LANG].audio_no_disponible : LANG_MSG[LANG].no_disponible; 3270break; 3271case "3": 3272texto_error = LANG_MSG[LANG].actualizar_plugin; 3273break; 3274case "4": 3275texto_error = LANG_MSG[LANG].bloqueado; 3276break; 3277case "-1": 3278case "-2": 3279texto_error = esAudio ? LANG_MSG[LANG].audio_no_encontrado : LANG_MSG[LANG].no_encontrado; 3280break; 3281default : 3282texto_error = " Error Cod. " + String(causaBloqueo); 3283break; 3284} 3285if (typeof(idDivContenedor) == "undefined" ) 3286{ 3287id_div_ReproductorVideo = "VideoPlayer_" + String(Math.random()).substr(2,9); 3288document.write('<div id="' + id_div_ReproductorVideo + '"></div>'); 3289} 3290else 3291id_div_ReproductorVideo = idDivContenedor; 3292if (typeof(SiguientesVideosPEP._id) != "undefined" && SiguientesVideosPEP._id != "" && document.getElementById(SiguientesVideosPEP._id)) 3293{ 3294document.getElementById(SiguientesVideosPEP._id).style.paddingTop = "0px"; 3295document.getElementById(SiguientesVideosPEP._id).style.marginLeft = "0px"; 3296} 3297if (versionMovil || MPEP_responsive) 3298{ 3299document.getElementById(id_div_ReproductorVideo).innerHTML = '<div class="video_previa video_no_disponible" id="' + idImage + 3300'"><div class="fondo_mensaje_video" ><span>'+texto_error+'</span></div><img src="' + 3301fotograma + '" style="height:auto;width:100%"/></div>'; 3302} 3303else 3304{ 3305document.getElementById(id_div_ReproductorVideo).innerHTML = '<div class="video_previa video_no_disponible" id="' + idImage + 3306'"><div class="fondo_mensaje_video" ><span>'+texto_error+'</span></div><img src="' + 3307fotograma + '" width="' + ancho + '" height="' + alto + '" style="height:' + alto + 'px;width:' + ancho + 'px"/></div>'; 3308} 3309} 3310function EPET_MultimediaPlayer(player, MP_params, flash_params, flash_width, flash_height, idDivContenedor, idObject, autoplay) 3311{ 3312var id_div_ReproductorVideo; 3313if (typeof(idDivContenedor) == "undefined" ) 3314{ 3315id_div_ReproductorVideo = "VideoPlayer_" + String(Math.random()).substr(2,9);
3316document.write('<div id="' + id_div_ReproductorVideo + '"></div>'); 3317} 3318else 3319id_div_ReproductorVideo = idDivContenedor; 3320var datosVideo = {}; 3321datosVideo.playerEPETParams = {"mediaWidth":flash_width, "mediaHeight":flash_height, "URLMediaFile":MP_params.URLMediaFile, "URLMediaStill":MP_params.URLMediaStill, "URLFirstFrame":"", "compactMode": 'false'}; 3322datosVideo.anchoPlayer = flash_width; 3323datosVideo.altoPlayer = flash_height; 3324datosVideo.idRefBrightcove = idObject; 3325datosVideo.publiActiva = false; 3326datosVideo.keywordsVideo = ""; 3327datosVideo.urlNoticia = ""; 3328datosVideo.tituloVideo = ""; 3329datosVideo.autoplay = (typeof(autoplay) != "undefined" && autoplay) ? autoplay : false; 3330var video = new EPET_Video(datosVideo, id_div_ReproductorVideo); 3331} 3332function EPET_VideoPlayerBrightcoveExterno(ancho, alto, idVideo, playerKey ) 3333{ 3334var idDiv = "div_" + idVideo; 3335document.write('<div id="' + idDiv + '"></div>'); 3336var bcParams = {}; 3337bcParams.playerKey = playerKey; 3338bcParams.isVid = "true"; 3339bcParams.isUI = "true"; 3340bcParams.dynamicStreaming = "true"; 3341bcParams.width = ancho ; 3342bcParams.height = alto; 3343bcParams.bgcolor = "#000000"; 3344bcParams.autoStart = "false"; 3345bcParams.videoSmoothing = "true"; 3346bcParams.forceHTML = "true"; 3347var idIframe = "Iframe_" + idVideo; 3348var codigoHTML = '<html>\n<head><style type="text/css"> body { margin: 0px;}</style>\n' + 3349'<script language="JavaScript" type="text/javascript" src="//admin.brightcove.com/js/BrightcoveExperiences.js"></scr' + 'ipt>\n<\head>\n' + 3350'<body>\n'+ 3351'<object id="Video_' + idVideo + '" class="BrightcoveExperience">\n'; 3352for(var p in bcParams) 3353{ 3354codigoHTML += '<param name="' + p + '" value="' + bcParams[p] + '" />\n'; 3355} 3356codigoHTML += '<param name="@videoPlayer" value="' + idVideo + '" />\n'; 3357codigoHTML += '</object>\n' + 3358'</body>\n</html>\n'; 3359EPETCreaIframe(idIframe, bcParams.width, bcParams.height, "no", 0, idDiv, codigoHTML); 3360} 3361function tiempoBonito(tiempo) 3362{ 3363if ( tiempo == -1 ) 3364return("--:--") 3365else 3366if (tiempo == 0) 3367return("00:00") 3368tiempo = parseInt(tiempo); 3369var horas = parseInt ( tiempo / 3600 ); 3370var minutos = parseInt ( (tiempo - horas * 3600) / 60 ); 3371var segundos = tiempo - horas * 3600 - minutos * 60; 3372if ( minutos < 10 ) minutos = "0" + minutos; 3373if ( segundos < 10 ) segundos = "0" + segundos; 3374if (tiempo > 3599) 3375return horas+":"+minutos+":"+segundos; 3376else 3377return minutos+":"+segundos; 3378}; 3379var mouseWheelEvent; 3380var factorVolumen; 3381if (/Firefox/i.test(navigator.userAgent)) 3382{ 3383mouseWheelEvent = "DOMMouseScroll"; 3384factorVolumen = -1; 3385} 3386else 3387{ 3388mouseWheelEvent = "mousewheel"; 3389factorVolumen = 1; 3390} 3391function wheel(event) { 3392if (typeof(event.target) != "undefined" && typeof(event.target.id) != "undefined" && event.target.id == "vdpep_audio" ) 3393{ 3394event.preventDefault(); 3395event.stopPropagation(); 3396} 3397} 3398function EPETUtils_calcPosition(obj, attr) { 3399var val=0; 3400while (obj) { 3401val+=obj[attr]; 3402obj=obj.offsetParent 3403} 3404return val 3405} 3406function EPETUtils_calcAbsPosition(el) { 3407if (document.documentElement.getBoundingClientRect && el.getBoundingClientRect) { 3408var box = el.getBoundingClientRect(); 3409var rootNode; 3410if (el.ownerDocument) { 3411rootNode = el.ownerDocument; 3412} else { 3413rootNode = document; 3414} 3415return [box.left + Math.max(rootNode.documentElement.scrollLeft, rootNode.body.scrollLeft), 3416box.top + Math.max(rootNode.documentElement.scrollTop, rootNode.body.scrollTop)]; 3417} else { 3418var pos = [el.offsetLeft, el.offsetTop]; 3419var parentNode = el.offsetParent; 3420var accountForBody = (isSafari && 3421el.style.position == 'absolute' && 3422el.offsetParent == el.ownerDocument.body); 3423if (parentNode != el) { 3424while (parentNode) { 3425pos[0] += parentNode.offsetLeft; 3426pos[1] += parentNode.offsetTop; 3427if (!accountForBody && isSafari && 3428parentNode.style.position == 'absolute' ) { 3429accountForBody = true; 3430} 3431parentNode = parentNode.offsetParent; 3432} 3433} 3434if (accountForBody) { 3435pos[0] -= el.ownerDocument.body.offsetLeft; 3436pos[1] -= el.ownerDocument.body.offsetTop; 3437} 3438if (el.parentNode) { 3439parentNode = el.parentNode; 3440var ROOT_TAG = /^body|html$/i; 3441while ( parentNode.tagName && !ROOT_TAG.test(parentNode.tagName) ) { 3442if (parentNode.style.display.search(/^inline|table-row.*$/i)) { 3443pos[0] -= parentNode.scrollLeft; 3444pos[1] -= parentNode.scrollTop; 3445} 3446parentNode = parentNode.parentNode; 3447} 3448} 3449return pos; 3450} 3451} 3452function EPETUtils_calcAbsPositionV2(el) { 3453if (document["documentElement"]["getBoundingClientRect"]) { 3454var scrollLeft, scrollTop, box, doc, 3455off1, off2, mode, bLeft, bTop, 3456xy = false;
3457if (el.style.display != 'none' && el["getBoundingClientRect"]) { 3458try { 3459box = el["getBoundingClientRect"](); 3460} catch (e) { 3461return ([0,0]); 3462} 3463doc = el["ownerDocument"]; 3464scrollLeft = Math.max(doc["documentElement"].scrollLeft, doc.body.scrollLeft); 3465scrollTop = Math.max(doc["documentElement"].scrollTop, doc.body.scrollTop); 3466xy = [Math.round(box["left"]), Math.round(box["top"])]; 3467if (isIE && isIE < 8) { 3468off1 = 2; 3469off2 = 2; 3470mode = doc["compatMode"]; 3471if (window["getComputedStyle"]) { 3472bLeft = doc["documentElement"]["defaultView"]["getComputedStyle"](doc["documentElement"], null)["borderLeftWidth"]; 3473bTop = doc["documentElement"]["defaultView"]["getComputedStyle"](doc["documentElement"], null)["borderTopWidth"]; 3474} else if (doc["documentElement"]["currentStyle"]) { 3475bLeft = doc["documentElement"]["clientLeft"]; 3476bTop = doc["documentElement"]["clientTop"]; 3477} 3478if (isIE == 6) { 3479if (mode != "BackCompat" && mode != "CSS1Compat") { 3480off1 = 0; 3481off2 = 0; 3482} 3483} 3484if ((mode == "BackCompat" || mode == "CSS1Compat")) { 3485if (bLeft != "medium") { 3486off1 = parseInt(bLeft, 10); 3487} 3488if (bTop != "medium") { 3489off2 = parseInt(bTop, 10); 3490} 3491} 3492xy[0] -= off1; 3493xy[1] -= off2; 3494} 3495if ((scrollTop || scrollLeft)) { 3496xy[0] += scrollLeft; 3497xy[1] += scrollTop; 3498} 3499xy[0] = Math.round(xy[0]); 3500xy[1] = Math.round(xy[1]); 3501} else { 3502xy = [0,0]; 3503} 3504return xy; 3505} else { 3506var doc, docScrollLeft, docScrollTop, 3507scrollTop, scrollLeft, 3508bCheck, 3509xy = false, 3510parentNode = el; 3511if (el.style.display != 'none') { 3512xy = [el["offsetLeft"], el["offsetTop"]]; 3513doc = el["ownerDocument"]; 3514docScrollLeft = Math.max(doc["documentElement"].scrollLeft, doc.body.scrollLeft); 3515docScrollTop = Math.max(doc["documentElement"].scrollTop, doc.body.scrollTop); 3516bCheck = ((isGecko || isSafari > 519) ? true : false); 3517while ((parentNode = parentNode["offsetParent"])) { 3518xy[0] += parentNode["offsetLeft"]; 3519xy[1] += parentNode["offsetTop"]; 3520if (bCheck) { 3521var t = 0, l = 0; 3522if (window["getComputedStyle"]) { 3523t = parseInt(parentNode["ownerDocument"]["defaultView"]["getComputedStyle"](parentNode, null)["borderTopWidth"], 10) || 0; 3524l = parseInt(parentNode["ownerDocument"]["defaultView"]["getComputedStyle"](parentNode, null)["borderLeftWidth"], 10) || 0; 3525} else if (parentNode["currentStyle"]) { 3526t = parseInt(parentNode["clientTop"], 10) || 0; 3527l = parseInt(parentNode["clientLeft"], 10) || 0; 3528} 3529if (isGecko) { 3530if (/^t(?:able|d|h)$/i.test(parentNode["tagName"])) { 3531t = 0; 3532l = 0; 3533} 3534} 3535xy[0] += l; 3536xy[1] += t; 3537} 3538} 3539if (el.style.position != "fixed") { 3540parentNode = el; 3541while ((parentNode = parentNode["parentNode"]) && parentNode["tagName"]) { 3542scrollTop = parentNode["scrollTop"]; 3543scrollLeft = parentNode["scrollLeft"]; 3544if (scrollTop || scrollLeft) { 3545xy[0] -= scrollLeft; 3546xy[1] -= scrollTop; 3547} 3548} 3549xy[0] += docScrollLeft; 3550xy[1] += docScrollTop; 3551} else { 3552if (isOpera) { 3553xy[0] -= docScrollLeft; 3554xy[1] -= docScrollTop; 3555} else if (isSafari || isGecko) { 3556xy[0] += docScrollLeft; 3557xy[1] += docScrollTop; 3558} 3559} 3560xy[0] = Math.round(xy[0]); 3561xy[1] = Math.round(xy[1]); 3562} else { 3563xy[0] = 0; 3564xy[1] = 0; 3565} 3566} 3567return xy; 3568} 3569function EPETUtils_posicionarScrollEnPagina(posY) { 3570if (typeof document.documentElement.scrollTop != "undefined") { 3571document.documentElement.scrollTop = parseInt(posY); 3572} 3573if (typeof document.body.scrollTop != "undefined" && !isOpera) { 3574document.body.scrollTop = parseInt(posY); 3575} 3576} 3577function EPETUtils_windowOpen(url, nombreVentana, attrs) { 3578var nuevoNombre = nombreVentana; 3579if (nuevoNombre == '') { 3580nuevoNombre = Math.random(); 3581} 3582var _window = window.open(url, nombreVentana, attrs); 3583} 3584function EPETUtils_IFrameRequest() { 3585var reqCount = 0; 3586this.readyState = 0; 3587this.status = 0; 3588this.responseText = ""; 3589reqCount++; 3590this.req_id = reqCount; 3591} 3592EPETUtils_IFrameRequest.prototype = { 3593open: function(protocol, url, async) { 3594this.protocol = protocol; 3595this.url = url; 3596}, 3597onreadystatechange: function() { }, 3598send: function(postBody) { 3599var self = this; 3600if (this.protocol.toUpperCase()=='POST') { 3601this.url = this.url + "&" + postBody; 3602} 3603var IFrameDoc = document.createElement('iframe'); 3604IFrameDoc.setAttribute('id', 'req'+this.req_id); 3605IFrameDoc.setAttribute('name', 'req'+this.req_id); 3606IFrameDoc.style.width = "0";IFrameDoc.style.height = "0";IFrameDoc.style.border = "0"; 3607document.body.appendChild(IFrameDoc); 3608try { 3609IFrameDoc.src = this.url; 3610}catch(e){ 3611return false;
3612} 3613this.readyState = 1; this.onreadystatechange(); 3614setTimeout(function(){self.IFht(4);}, 4); 3615}, 3616overrideMimeType: function() { }, 3617getResponseHeader: function (name) { return ''; }, 3618setRequestHeader: function (name, data) { }, 3619IFht: function (d) { 3620var self=this; 3621var el=document.getElementById('req'+self.req_id); 3622if (el.readyState=='complete') { 3623self.responseText = document.frames['req'+self.req_id].document.body.innerHTML.replace(/[\n\r]+/ig, ""); 3624el.parentNode.removeChild(el); 3625self.status = 200; 3626self.readyState = 4; 3627self.onreadystatechange(); 3628}else{ 3629d*=1.5; 3630setTimeout(function(){self.IFht(d);},d); 3631} 3632} 3633}; 3634function EPETUtils_makeHttpRequest(callbackFunction, url, postData, contentType) { 3635if (typeof contentType =="undefined") { contentType = 'application/x-www-form-urlencoded'; } 3636var EPETUtils_xmlHttpRequest = EPETUtils_createHttpRequestObj(contentType); 3637if (!EPETUtils_xmlHttpRequest) return; 3638EPETUtils_xmlHttpRequest.onreadystatechange = function () { 3639if (EPETUtils_xmlHttpRequest.readyState != 4) return; 3640callbackFunction(EPETUtils_xmlHttpRequest); 3641} 3642EPETUtils_xmlHttpRequest.open('POST', url, true); 3643EPETUtils_xmlHttpRequest.setRequestHeader('Content-type', contentType); 3644EPETUtils_xmlHttpRequest.send(postData); 3645} 3646function EPETUtils_makeHttpRequestGet (callbackFunction, url, contentType) { 3647if (typeof contentType =="undefined" ) { contentType = 'application/x-www-form-urlencoded'; } 3648var EPETUtils_xmlHttpRequest = EPETUtils_createHttpRequestObj(contentType); 3649if (!EPETUtils_xmlHttpRequest) return; 3650EPETUtils_xmlHttpRequest.onreadystatechange = function () { 3651if (EPETUtils_xmlHttpRequest.readyState != 4) return; 3652callbackFunction(EPETUtils_xmlHttpRequest); 3653} 3654EPETUtils_xmlHttpRequest.open('GET', url, true); 3655EPETUtils_xmlHttpRequest.setRequestHeader('Content-type', contentType); 3656EPETUtils_xmlHttpRequest.send(null); 3657} 3658function EPETUtils_createHttpRequestObj(contentType) { 3659var httpRequest; 3660if (window.XMLHttpRequest) { 3661httpRequest = new XMLHttpRequest(); 3662if (httpRequest.overrideMimeType && contentType) { 3663httpRequest.overrideMimeType(contentType); 3664} 3665}else if (window.ActiveXObject) { 3666try { 3667httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); 3668} 3669catch (e) { 3670try { 3671httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); 3672} 3673catch (e) { 3674try { 3675httpRequest = new EPETUtils_IFrameRequest(); 3676} 3677catch (e) { 3678httpRequest = false; 3679} 3680} 3681} 3682} 3683return httpRequest; 3684} 3685function marcadoAmpliaFoto(tituloPagina, fotoUrl) 3686{ 3687if (typeof(launchAjaxOMN) == "function") 3688{ 3689tituloPagina = tituloPagina.replace(/'|"|\|/g, ""); 3690launchAjaxOMN("39|46", tituloPagina + "|" + fotoUrl, "event76"); 3691} 3692} 3693function EPETtrackNewInfoFromAJAX() 3694{ 3695var rndPXLAJAX = parseInt(Math.random()*10000000); 3696var imgMMDAJAX = new Image(1,1); 3697imgMMDAJAX.src = "/pxlctl.gif?"+rndPXLAJAX; 3698if (typeof(launchAjaxOMN) == "function" && typeof(omnEvars) != "undefined" && typeof(omnInfo) != "undefined" && typeof(omnEvents) != "undefined" ) 3699{ 3700launchAjaxOMN(omnEvars, omnInfo, omnEvents); 3701} 3702} 3703function EPETtrackWidgetNewInfoFromAJAX() 3704{ 3705var rndPXLAJAX = parseInt(Math.random()*10000000); 3706var imgMMDAJAX = new Image(1,1); 3707imgMMDAJAX.src = "/pxlctl.gif?"+rndPXLAJAX; 3708} 3709 3710function EPETCreaIframe(id, ancho, alto, scroll, borde, div, code) 3711{ 3712var iframe=document.createElement("iframe"); 3713iframe.setAttribute("id",id); 3714iframe.setAttribute("width",ancho); 3715iframe.setAttribute("height",alto); 3716iframe.setAttribute("scrolling", scroll); 3717iframe.frameBorder = borde; 3718document.getElementById(div).innerHTML = ""; 3719document.getElementById(div).appendChild(iframe); 3720iFrDoc = document.getElementById(id).contentWindow.document || document.getElementById(id).contentDocument.document; 3721iFrDoc.write(code); 3722iFrDoc.close(); 3723} 3724 3725function EPETaddClass(id, name) { 3726var obj; 3727if ( typeof(id) == 'string' ) { 3728if ( document.getElementById(id) ) { 3729obj = document.getElementById(id); 3730} else { 3731return true; 3732} 3733} else if ( typeof(id) == 'object' ) { 3734obj = id; 3735} else { 3736return true; 3737} 3738var estilo = obj.className; 3739estilo += ' ' + name; 3740obj.className = estilo; 3741} 3742function EPETremoveClass(id, name) { 3743var obj; 3744if ( typeof(id) == 'string' ) { 3745if ( document.getElementById(id) ) { 3746obj = document.getElementById(id); 3747} else { 3748return true; 3749} 3750} else if ( typeof(id) == 'object' ) { 3751obj = id; 3752} else { 3753return true; 3754} 3755var estilo = obj.className; 3756var Exp = new RegExp('\\s*'+name+'(\\s|$)','g'); 3757estilo = estilo.replace(Exp, ' '); 3758obj.className = estilo; 3759} 3760function EPETUtils_userSelectOff() { 3761if (isGecko) { document.body.style.MozUserSelect = "none"; } 3762if (isSafari) { document.body.style.KhtmlUserSelect = "none"; } 3763if (isIE) { document.body.unselectable = "on"; } 3764document.body.style.userSelect = "none"; 3765} 3766function EPETUtils_userSelectOn() { 3767if (isGecko) { document.body.style.MozUserSelect = "text"; } 3768if (isSafari) { document.body.style.KhtmlUserSelect = "text"; } 3769if (isIE) { document.body.unselectable = "off"; } 3770document.body.style.userSelect = "text"; 3771} 3772function EPETUtils_fullEncodeURIComponent(str) { 3773str = encodeURIComponent(str) 3774return (str.replace(/'/g, "%27")); 3775} 3776function EPETnewsNotify() { 3777EPETUtils_makeHttpRequestGet ( function() { return true; }, '/notificarelacionadas', ''); 3778} 3779function EPETgetVScrollPosition() 3780{ 3781if (typeof(document.documentElement.scrollTop) != "undefined" && document.documentElement.scrollTop) 3782return document.documentElement.scrollTop; 3783else 3784if (typeof(window.pageYOffset) != "undefined") 3785return window.pageYOffset; 3786else 3787return 0; 3788} 3789 3790function EPETBrowserDims() 3791{ 3792var viewportwidth = 0; 3793var viewportheight = 0; 3794if (typeof window.innerWidth != 'undefined') { 3795viewportwidth = window.innerWidth, 3796viewportheight = window.innerHeight 3797} 3798else if (typeof document.documentElement != 'undefined' 3799&& typeof document.documentElement.clientWidth != 3800'undefined' && document.documentElement.clientWidth != 0) { 3801viewportwidth = document.documentElement.clientWidth, 3802viewportheight = document.documentElement.clientHeight 3803} 3804else { 3805viewportwidth = document.getElementsByTagName('body')[0].clientWidth, 3806viewportheight = document.getElementsByTagName('body')[0].clientHeight 3807} 3808if (dispositivoMovil && typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) 3809{ 3810viewportwidth = document.documentElement.clientWidth; 3811viewportheight = document.documentElement.clientHeight; 3812} 3813return {"ancho" : viewportwidth , "alto" : viewportheight}; 3814} 3815function EPETalternacampos(id_campo1, estilo_campo1, id_campo2, estilo_campo2) { 3816if (document.getElementById(id_campo1)) { 3817document.getElementById(id_campo1).style.display = estilo_campo1; 3818} 3819if (document.getElementById(id_campo2)) { 3820document.getElementById(id_campo2).style.display = estilo_campo2; 3821} 3822} 3823function teclaPulsada(key) 3824{ 3825var keycode; 3826if (window.event) 3827keycode = window.event.keyCode; 3828else
3829if (key) 3830keycode = key.which; 3831if (keycode == 27) 3832cerrarTelonMultimedia(); 3833} 3834function teclaTelonEvent(e) 3835{ 3836if (e.keyCode == 27 ){ 3837cerrarTelonMultimedia(); 3838} 3839} 3840var htmlCapaCentral = '<img id="imagen_contenedor" src="/t.gif" width="" height="" alt="' + LANG_MSG[LANG].foto + '"/><p id="pie_contenedor" class="figcaption estirar"></p>'; 3841var htmlCapaFlotante = '<div id="flotante_foto" class="flotante_foto">\n' + 3842' <div class="contenedor_foto estirar">\n' + 3843' <a title="' + LANG_MSG[LANG].cerrar + '" href="javascript:void(0);" id="id_cerrar_arriba" class="cerrar" onClick="javascript:cerrarTelonMultimedia()">' + LANG_MSG[LANG].cerrar + '</a>\n' + 3844' <a id="ampliar" style="display:none" class="boton ampliar" href="javascript:void(0);">' + LANG_MSG[LANG].tamanio_real + '</a>\n' + 3845' <div id="contenedor_central_telon" class="foto figure">' + htmlCapaCentral + '</div>' + 3846' </div>\n' + 3847'</div>\n'; 3848var fotoTamanioReal = false; 3849function bloqueaClick(e) 3850{ 3851if (!e) var e = window.event; 3852e.cancelBubble = true; 3853if (e.stopPropagation) e.stopPropagation(); 3854} 3855function crearTelonMultimedia() 3856{ 3857if (document.getElementById("id_telon")) 3858document.getElementById("id_telon").parentNode.removeChild(document.getElementById("id_telon")); 3859if (document.getElementById("id_contenedorCapaFlotante")) 3860document.getElementById("id_contenedorCapaFlotante").parentNode.removeChild(document.getElementById("id_contenedorCapaFlotante")); 3861var telon = document.createElement('div'); 3862telon.id = 'id_telon'; 3863telon.style.display = 'none'; 3864telon.className = 'telon'; 3865telon.onclick = function() { cerrarTelonMultimedia();}; 3866document.body.appendChild(telon); 3867var contenedor = document.createElement('div'); 3868contenedor.id = 'id_contenedorCapaFlotante'; 3869contenedor.style.top = '0px'; 3870contenedor.style.left = '0px'; 3871contenedor.style.display = 'none'; 3872contenedor.className = 'contenedor_capa_flotante'; 3873contenedor.onclick = function() { cerrarTelonMultimedia();}; 3874contenedor.innerHTML = htmlCapaFlotante; 3875document.body.appendChild(contenedor); 3876} 3877function cerrarTelonMultimedia() 3878{ 3879if (document.getElementById("id_telon").style.display != "none") 3880{ 3881EPETalternacampos('id_telon', 'none', 'id_contenedorCapaFlotante', 'none'); 3882var nodoCentral = document.getElementById("contenedor_central_telon"); 3883if (nodoCentral) 3884nodoCentral.innerHTML = htmlCapaCentral; 3885if (window.addEventListener) 3886window.removeEventListener('keydown', teclaTelonEvent,true); 3887else 3888document.onkeydown = null; 3889} 3890} 3891function ampliaFoto(boton, url_foto, ancho_foto, alto_foto, pie_foto) 3892{ 3893var nodoCentral = document.getElementById("contenedor_central_telon"); 3894if (!nodoCentral) 3895crearTelonMultimedia(); 3896setTimeout(function() { 3897if (ancho_foto > 0 && alto_foto > 0) 3898{ 3899setTimeout(function(){ 3900ampliaFotoCallback(boton, url_foto, ancho_foto, alto_foto, pie_foto); 3901}, 100); 3902} 3903else 3904{ 3905var oculto = document.createElement('div'); 3906oculto.style.width = '0px'; 3907oculto.style.height = '0px'; 3908oculto.style.overflow = 'hidden'; 3909document.body.appendChild(oculto); 3910var oImg=document.createElement("img"); 3911oImg.onload = function() { ampliaFotoCallback(boton, url_foto, (this.naturalWidth != undefined ? this.naturalWidth : this.offsetWidth), (this.naturalHeight != undefined ? this.naturalHeight : this.offsetHeight), pie_foto); oculto.parentNode.removeChild(oculto) }; 3912oImg.setAttribute('src', url_foto + "?" + Math.random()); 3913oculto.appendChild(oImg); 3914} 3915}, 100); 3916} 3917function ampliaFotoCallback(boton, url_foto, ancho_foto, alto_foto, pie_foto) 3918{ 3919var telon = document.getElementById('id_telon'); 3920var capaFlotante = document.getElementById('id_contenedorCapaFlotante'); 3921document.getElementById('ampliar').className = 'boton ampliar'; 3922document.getElementById('ampliar').innerHTML= LANG_MSG[LANG].tamanio_real; 3923fotoTamanioReal = false; 3924var altoPie = 0 ; 3925if (telon != undefined && capaFlotante != undefined ) 3926{ 3927pie_foto = pie_foto.replace(new RegExp("\&", "gm"), "&"); 3928pie_foto = pie_foto.replace(new RegExp("\<", "gm"), "<"); 3929pie_foto = pie_foto.replace(new RegExp("\>", "gm"), ">"); 3930document.getElementById('pie_contenedor').onclick = bloqueaClick; 3931document.getElementById('pie_contenedor').innerHTML = pie_foto; 3932EPETalternacampos('id_telon','block', 'id_contenedorCapaFlotante','block'); 3933if (dispositivoMovil) 3934{ 3935var altoBody = document.body.scrollHeight; 3936telon.style.position = 'absolute'; 3937telon.style.height = altoBody + 'px'; 3938telon.style.width = dimensionesPEP.ancho + 'px'; 3939capaFlotante.style.position = 'absolute'; 3940} 3941else 3942{ 3943capaFlotante.style.position = 'fixed'; 3944telon.style.position = 'fixed'; 3945} 3946altoPie = document.getElementById('pie_contenedor').offsetHeight; 3947var YscrollVertical = EPETgetVScrollPosition(); 3948var altoBloqueCentral = parseInt(alto_foto) + parseInt(altoPie) + 60; 3949if (altoBloqueCentral <= dimensionesPEP.alto) 3950{ 3951document.getElementById('ampliar').style.display = 'none'; 3952if (dispositivoMovil) 3953{ 3954capaFlotante.style.top = Math.round(YscrollVertical + (dimensionesPEP.alto - altoBloqueCentral ) / 2 ) + 'px'; 3955} 3956else 3957capaFlotante.style.top = (Math.round(dimensionesPEP.alto / 2 - altoBloqueCentral / 2)) + 'px' ; 3958capaFlotante.style.left = '0px'; 3959document.getElementById('imagen_contenedor').style.height = alto_foto + 'px'; 3960document.getElementById('imagen_contenedor').style.width = ancho_foto + 'px'; 3961document.getElementById('flotante_foto').style.width = (parseInt(ancho_foto) + 20) + "px"; 3962} 3963else 3964{ 3965if (dispositivoMovil) 3966{ 3967capaFlotante.style.top = YscrollVertical + 'px'; 3968} 3969else 3970capaFlotante.style.top = '0px' ; 3971altoPie = 55; 3972var imgH = dimensionesPEP.alto - parseInt(altoPie) - 60; 3973var imgW = Math.round(imgH * ancho_foto / alto_foto); 3974document.getElementById('imagen_contenedor').style.height = imgH + "px"; 3975document.getElementById('imagen_contenedor').style.width = imgW + "px"; 3976document.getElementById('flotante_foto').style.width = (imgW + 20) + "px"; 3977document.getElementById('ampliar').style.display = 'block'; 3978document.getElementById('ampliar').onclick = function (e) {
3979bloqueaClick(e); 3980if (!fotoTamanioReal) 3981{ 3982document.getElementById('ampliar').className = 'boton reducir'; 3983document.getElementById('ampliar').innerHTML = LANG_MSG[LANG].tamanio_ventana; 3984capaFlotante.style.position = 'absolute'; 3985capaFlotante.style.top = YscrollVertical + 'px'; 3986document.getElementById('flotante_foto').style.width = (parseInt(ancho_foto) + 20) + "px"; 3987document.getElementById('imagen_contenedor').style.width = ancho_foto + 'px'; 3988document.getElementById('imagen_contenedor').style.height = alto_foto + 'px'; 3989} 3990else 3991{ 3992document.getElementById('ampliar').className = 'boton ampliar'; 3993document.getElementById('ampliar').innerHTML= LANG_MSG[LANG].tamanio_real; 3994if (dispositivoMovil) 3995{ 3996capaFlotante.style.position = 'absolute'; 3997capaFlotante.style.top = YscrollVertical + 'px'; 3998} 3999else 4000{ 4001capaFlotante.style.position = 'fixed'; 4002capaFlotante.style.top = '0px'; 4003} 4004document.getElementById('imagen_contenedor').style.height = (dimensionesPEP.alto - parseInt(altoPie) - 60) + "px"; 4005document.getElementById('imagen_contenedor').style.width = imgW + "px"; 4006document.getElementById('flotante_foto').style.width = (imgW + 20) + "px"; 4007} 4008fotoTamanioReal = !fotoTamanioReal; 4009}; 4010} 4011document.getElementById('imagen_contenedor').onclick = bloqueaClick; 4012document.getElementById('imagen_contenedor').src = url_foto; 4013if (window.addEventListener) 4014{ 4015window.addEventListener('keydown', teclaTelonEvent,true); 4016} 4017else 4018{ 4019document.onkeydown = teclaPulsada; 4020} 4021marcadoAmpliaFoto(document.getElementsByTagName('title')[0] ? document.getElementsByTagName('title')[0].innerHTML : "", url_foto); 4022} 4023} 4024 4025function f_pinta_datos(nick, datosUsuario, idVentana, boton) { 4026var nombreCompleto = nick; 4027var descripcionUsuario = ''; 4028var fotoUsuario = ''; 4029if ( (datosUsuario.perfilesUsuarios) && (datosUsuario.perfilesUsuarios[nick]) ) { 4030datosUsuario = datosUsuario.perfilesUsuarios[nick]; 4031var nombreUsuario = datosUsuario.nombre; 4032var apellidosUsuario = datosUsuario.apellidos; 4033var descripcionUsuario = datosUsuario.descripcion; 4034var fotoUsuario = datosUsuario.pathfoto; 4035if (apellidosUsuario != '') { 4036nombreCompleto = apellidosUsuario + ', ' + nombreUsuario; 4037} 4038else { 4039if (nombreUsuario != '') { 4040nombreCompleto = nombreUsuario; 4041} 4042} 4043} 4044var contenido_html = ''; 4045contenido_html = contenido_html + '<div class="encabezado estirar">'; 4046contenido_html = contenido_html + '<a onclick="javascript:document.getElementById(\'' + idVentana + '\').style.display=\'none\';" title="' + LANG_MSG[LANG].cerrar + '" class="autor" href="javascript:void(0);">' + nombreCompleto + '</a>'; 4047contenido_html = contenido_html + '<a title="' + LANG_MSG[LANG].ver_perfil_completo + '" href="//eskup.elpais.com/' + nick + '" target="_blank">' + LANG_MSG[LANG].ver_perfil_eskup + ' »</a>'; 4048contenido_html = contenido_html + '<a onclick="javascript:document.getElementById(\'' + idVentana + '\').style.display=\'none\';" title="' + LANG_MSG[LANG].cerrar + '" class="cerrar" href="javascript:void(0);"></a>'; 4049contenido_html = contenido_html + '</div><!-- === .encabezado === -->'; 4050contenido_html = contenido_html + '<div class="contenido estirar">'; 4051if (fotoUsuario != '' ) { 4052contenido_html = contenido_html + '<div class="foto"><img width="100" height="100" src="' + fotoUsuario + '" alt="' + LANG_MSG[LANG].avatar + '"></div><!-- === .foto === -->'; 4053} 4054contenido_html = contenido_html + '<p>' + descripcionUsuario + '</p>'; 4055contenido_html = contenido_html + '</div><!-- === .contenido === -->'; 4056var posX = boton.offsetLeft; 4057var posY = boton.offsetTop; 4058if (posY < 0) { 4059posY = 0; 4060} 4061var panel = document.getElementById(idVentana); 4062panel.innerHTML = contenido_html; 4063panel.style.display = 'block'; 4064panel.style.top = posY + 'px'; 4065panel.style.left = posX + 'px'; 4066} 4067function f_muestra_ficha_colaborador(nick, idDiv, boton) { 4068var urlEskup = '/Profileeskup'; 4069var date_actual = new Date(); 4070var ts_actual = date_actual.getTime(); 4071var cadena_params = 'action=info_usuarios&user=' + nick; 4072cadena_params += '&ts=' + parseInt(ts_actual); 4073EPETUtils_makeHttpRequestGet(function(httpRequest) { 4074if (httpRequest.status != 200) { 4075var hashDatos = {}; 4076f_pinta_datos(nick, hashDatos, idDiv, boton); 4077} 4078else { 4079var hashDatos = Array(); 4080var data = httpRequest.responseText; 4081eval("_hashDatos = " + data); 4082f_pinta_datos(nick, _hashDatos, idDiv, boton); 4083} 4084}, urlEskup + "?" + cadena_params); 4085} 4086function f_comprobar_submit(evento, idFormulario, idCampoLogin, idCampoPasswd) { 4087if (window.event) { 4088tecla = evento.keyCode; 4089src = evento.srcElement; 4090} 4091else if (evento.which) { 4092tecla = evento.which; 4093src = evento.target; 4094} 4095if (tecla == 13) { 4096f_iniciar_sesion(idFormulario, idCampoLogin, idCampoPasswd); 4097} 4098} 4099function f_iniciar_sesion(idFormulario, idCampoLogin, idCampoPasswd) { 4100var campoLogin = document.getElementById(idCampoLogin); 4101var campoPasswd = document.getElementById(idCampoPasswd); 4102if ( (campoLogin.value == '') || (campoPasswd.value == '') ) { 4103alert(LANG_MSG[LANG].teclear_usuario); 4104return false;
4105} 4106var valor_usuario = campoLogin.value; 4107if ( valor_usuario.match(/(\w*)@(\w+)/) ) { 4108var formulario = document.getElementById(idFormulario); 4109formulario.submit(); 4110} 4111else { 4112alert(LANG_MSG[LANG].error_correo); 4113return false; 4114} 4115} 4116 4117 4118function EPETUtils_filtraAlfanumerico (datos_contaminados) 4119{ 4120var datos_filtrados= datos_contaminados.replace(/[^a-z0-9_ñÃâáÃÂéÃâ°ÃÂÃÂóÃâúÚüÃÅ]/g, ""); 4121return datos_filtrados; 4122} 4123 4124function EPETUtils_filtraJavascript (datos_contaminados) 4125{ 4126var datos_filtrados= datos_contaminados.replace(/[';"]/g, ""); 4127return datos_filtrados; 4128} 4129 4130function EPETUtils_filtraFormulario (datos_contaminados) 4131{ 4132var datos_filtrados= datos_contaminados.replace(/[<>"=]/g, ""); 4133return datos_filtrados; 4134} 4135var JSON = JSON || {}; 4136JSON.stringify = JSON.stringify || function (obj) { 4137var t = typeof (obj); 4138if (t != "object" || obj === null) { 4139if (t == "string") obj = '"'+obj+'"'; 4140return String(obj); 4141} 4142else { 4143var n, v, json = [], arr = (obj && obj.constructor == Array); 4144for (n in obj) { 4145v = obj[n]; t = typeof(v); 4146if (t == "string") v = '"'+v+'"'; 4147else if (t == "object" && v !== null) v = JSON.stringify(v); 4148json.push((arr ? "" : '"' + n + '":') + String(v)); 4149} 4150return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}"); 4151} 4152}; 4153JSON.parse = JSON.parse || function (str) { 4154if (str === "") str = '""'; 4155eval("var p=" + str + ";"); 4156return p; 4157}; 4158if (typeof(launchAjaxOMN) != 'function') 4159{ 4160try{ 4161if (typeof(parent) != "undefined" && typeof(parent.launchAjaxOMN) == 'function') 4162{ 4163launchAjaxOMN = parent.launchAjaxOMN; 4164} 4165} 4166catch(err) 4167{} 4168} 4169function loadCSS(archivo_css, callback, hls) { 4170if (hls && typeof(Hls) == "undefined") 4171{ 4172var ss = document.createElement('script'); 4173ss.type= 'text/javascript'; 4174ss.src = '//ep02.epimg.net/js/hls/hls.js'; 4175document.getElementsByTagName('head')[0].appendChild(ss); 4176} 4177var head = document.getElementsByTagName('head')[0]; 4178var link = document.createElement('link'); 4179link.type = "text/css"; 4180link.rel = "stylesheet" 4181link.href = archivo_css; 4182if (link.addEventListener) 4183{ 4184link.addEventListener('load', callback, false); 4185} 4186else 4187{ 4188if (link.onload) { 4189link.onload = callback; 4190} 4191else 4192{ 4193if (isIE) 4194{ 4195link.onreadystatechange = function() { 4196var state = link.readyState; 4197if (state === 'loaded' || state === 'complete') { 4198callback(); 4199link.onreadystatechange = null; 4200} 4201} 4202} 4203else 4204{ 4205var cssnum = document.styleSheets.length; 4206var ti = setInterval(function() { 4207if (document.styleSheets.length > cssnum) { 4208callback(); 4209clearInterval(ti); 4210} 4211}, 30); 4212} 4213} 4214} 4215head.appendChild(link); 4216} 4217var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}} 4218function loadEmbedObjectInDiv(nombreId, str) 4219{ 4220var objDiv = document.getElementById(nombreId); 4221if (objDiv) 4222{ 4223objDiv.innerHTML = str; 4224} 4225} 4226function loadEmbedObjectInDivResponsive(nombreId, str, responsive) 4227{ 4228var objDiv = document.getElementById(nombreId); 4229if (objDiv) 4230{ 4231if (responsive) 4232{ 4233var anchoIf = /width=["']?(\d+)["']?/i; 4234var altoIf = /height=["']?(\d+)["']?/i; 4235var anchoViejo; 4236var altoViejo; 4237var anchoNuevo; 4238var altoNuevo; 4239var res = anchoIf.exec(str); 4240var res2; 4241if (res) 4242{ 4243anchoViejo = res[1]; 4244res2 = altoIf.exec(str); 4245if (res2) 4246altoViejo = res2[1]; 4247else 4248altoViejo = Math.floor(anchoViejo * 9 / 16); 4249altoNuevo = Math.floor(objDiv.offsetWidth * altoViejo / anchoViejo); 4250anchoNuevo = objDiv.offsetWidth; 4251str = str.replace(/width=(['"]?)\d+(['"]?)/ig, "width=$1" + anchoNuevo + "$2"); 4252str = str.replace(/height=(['"]?)\d+(['"]?)/ig, "height=$1" + altoNuevo + "$2"); 4253str = str.replace(/w=\d+/ig, "w=" + anchoNuevo); 4254str = str.replace(/h=\d+/ig, "h=" + altoNuevo); 4255} 4256} 4257objDiv.innerHTML = str; 4258} 4259} 4260function reproductorMultimedia(datosMultimedia, divMultimedia) 4261{ 4262var id_div_ReproductorMultimedia; 4263if (typeof(divMultimedia) == "undefined" ) 4264{ 4265id_div_ReproductorMultimedia = "multimediaPlayer_" + String(Math.random()).substr(2,9);
4266document.write('<div id="' + id_div_ReproductorMultimedia + '"></div>'); 4267} 4268else 4269id_div_ReproductorMultimedia = divMultimedia; 4270if (typeof(datosMultimedia.urls) == "undefined") 4271datosMultimedia.urls = []; 4272switch(datosMultimedia.tipo) 4273{ 4274case "video": 4275datosMultimedia.poster = datosMultimedia.caratula; 4276if (datosMultimedia.id_referencia) 4277datosMultimedia.idRefBrightcove = datosMultimedia.id_referencia; 4278if (datosMultimedia.id_multimedia) 4279datosMultimedia.id_video = datosMultimedia.id_multimedia; 4280if (!datosMultimedia.playerEPETParams) 4281datosMultimedia.playerEPETParams = {"URLMediaStill":datosMultimedia.poster}; 4282setTimeout(function(){var video = new EPET_Video(datosMultimedia, id_div_ReproductorMultimedia);},300); 4283break; 4284case "externo": case "iframe": 4285if ((typeof(datosMultimedia.urls) != "undefined" && typeof(datosMultimedia.urls[0]) != "undefined") || typeof(datosMultimedia.codigo) != "undefined") 4286{ 4287var str; 4288if (datosMultimedia.tipo == 'iframe') { 4289str = datosMultimedia.codigo; 4290} 4291else 4292str = datosMultimedia.urls[0]; 4293if (str.substr(-4,4) == "m3u8") 4294{ 4295document.getElementById(id_div_ReproductorMultimedia).className = "MPEP_video_vacio"; 4296return; 4297} 4298else 4299{ 4300document.getElementById(id_div_ReproductorMultimedia).className = "MPEP_video_externo"; 4301} 4302var srcIf = /src=["']?([^"']+)["']?/i; 4303var res1 = srcIf.exec(str); 4304if (str.indexOf("http") == 0 || res1) 4305{ 4306var factor = 9/16; 4307var url; 4308if (res1) 4309{ 4310var anchoIf = /width=["']?([\d\%]+)["']?/i; 4311var altoIf = /height=["']?([\d\%]+)["']?/i; 4312var res2 = anchoIf.exec(str); 4313var res3 = altoIf.exec(str); 4314if (res2 && res3 && res2[1].match(/^\d+$/) && res3[1].match(/^\d+$/)) 4315factor = res3[1]/res2[1]; 4316url = res1[1]; 4317} 4318else 4319{ 4320url = arreglaUrl(str); 4321} 4322var ifr = document.createElement("iframe"); 4323ifr.width = "100%"; 4324ifr.height = "100%"; 4325ifr.setAttribute("frameBorder", "0"); 4326ifr.setAttribute("scrolling", "no"); 4327ifr.setAttribute("webkitallowfullscreen", ""); 4328ifr.setAttribute("mozallowfullscreen", ""); 4329ifr.setAttribute("allowfullscreen", ""); 4330ifr.style.position = 'absolute'; 4331if (document.location.href.indexOf("autoplay=1") > -1 && !reproduciendo) 4332{ 4333reproduciendo = true; 4334datosMultimedia.autoplay = true; 4335setTimeout(function(){ 4336var posVideo = EPET_calculaTopPosition(document.getElementById(id_div_ReproductorMultimedia)); 4337if (posVideo > dimensionesPEP.alto) 4338EPET_setScrollPosition(parseInt(posVideo) - 90); 4339if (typeof(window.lzld) == 'function') 4340{ 4341setTimeout(function(){ 4342var posVideo = EPET_calculaTopPosition(document.getElementById(id_div_ReproductorMultimedia)); 4343EPET_setScrollPosition(parseInt(posVideo) - 90); 4344},800); 4345} 4346},300); 4347} 4348if (datosMultimedia.autoplay) 4349{ 4350if (url.match(/muzu/i)) 4351{ 4352url = url.replace(/&(amp;)?autostart=n/,""); 4353url += "&autostart=y"; 4354} 4355else 4356if (url.match(/youtu/i)) 4357url += "?autoplay=1"; 4358} 4359if (url.match(/youtu/i)) 4360{ 4361if(url.indexOf('?') > -1) 4362url += "&wmode=transparent"; 4363else 4364url += "?wmode=transparent"; 4365} 4366document.getElementById(id_div_ReproductorMultimedia).style.position = 'relative'; 4367document.getElementById(id_div_ReproductorMultimedia).style.width = '100%'; 4368document.getElementById(id_div_ReproductorMultimedia).style.height = '100%'; 4369document.getElementById(id_div_ReproductorMultimedia).style.paddingBottom = (factor * 100) + "%"; 4370document.getElementById(id_div_ReproductorMultimedia).appendChild(ifr); 4371ifr.src = url; 4372} 4373else 4374document.getElementById(id_div_ReproductorMultimedia).parentNode.innerHTML = str; 4375} 4376break; 4377default: 4378break; 4379} 4380} 4381function aniade_track_caja(id_componente, track) { 4382if (document.getElementById(id_componente)) { 4383var caja = document.getElementById(id_componente); 4384if (caja.getElementsByTagName("a")) { 4385var enlaces = caja.getElementsByTagName("a"); 4386for(var index in enlaces) { 4387var elemento = enlaces[index]; 4388if (typeof(elemento) == 'object' && elemento.getAttribute('href')) { 4389var hrefInicial = elemento.getAttribute('href'); 4390if (hrefInicial.substring(0, 4) != "java") { 4391var hrefFinal = ""; 4392if (hrefInicial.indexOf('?') > -1) { 4393hrefFinal = hrefInicial + "&" + track; 4394} else { 4395hrefFinal = hrefInicial + "?" + track; 4396} 4397elemento.setAttribute('href',hrefFinal); 4398} 4399} 4400} 4401} 4402} 4403} 4404 4405widgetInstagram = function () { 4406var opt = null,width,col,fill,showSiguenos,showEnInstagram; 4407ul_css = function () { 4408var css = { 4409"width": width, 4410}; 4411return css; 4412}; 4413li_css = function () { 4414var css = { 4415"width": "calc(100%/" + opt.col + ")", 4416}; 4417return css; 4418}; 4419img_css = function () { 4420var css = { 4421 4422}; 4423return css; 4424}; 4425p_css = function () { 4426var css = { 4427 4428}; 4429return css; 4430}; 4431createDOM = function (data) { 4432var div_content = document.createElement("div"); 4433div_content.classList.add("widget","widget_instagram"); 4434var div_interior = document.createElement("div"); 4435var p; 4436if (data.hasOwnProperty("error_type")) { 4437var text_error = document.createTextNode(data.error_message); 4438p = document.createElement("p"); 4439p.appendChild(text_error); 4440} else { 4441div_interior.classList.add("widget__interior"); 4442var h3 = document.createElement("h3"); 4443var span_h3 = document.createElement("span"); 4444span_h3.classList.add("sin_enlace"); 4445var span_h3_text = document.createTextNode("En Instagram"); 4446span_h3.appendChild(span_h3_text); 4447h3.appendChild(span_h3); 4448var ul = document.createElement("ul"); 4449var ul_css_value = ul_css(); 4450for (var prop in ul_css_value) { 4451ul.style[prop] = ul_css_value[prop]; 4452} 4453for (var index in data) { 4454if (data.hasOwnProperty(index)) { 4455var img = document.createElement("img"); 4456img.title = data[index].caption !== null && data[index].caption.hasOwnProperty("text") ? data[index].caption.text : ""; 4457img.alt = data[index].caption !== null && data[index].caption.hasOwnProperty("text") ? data[index].caption.text : ""; 4458img.src = data[index].images.thumbnail.url; 4459img.style.maxWidth = data[index].images.thumbnail.width + "px"; 4460var img_css_value = img_css(); 4461for (var prop in img_css_value) { 4462img.style[prop] = img_css_value[prop]; 4463} 4464var a_li = document.createElement("a"); 4465a_li.target = "_blank"; 4466a_li.href = data[index].link; 4467a_li.appendChild(img); 4468var li = document.createElement("li"); 4469var li_css_value = li_css(); 4470for (var prop in li_css_value) { 4471li.style[prop] = li_css_value[prop]; 4472} 4473li.appendChild(a_li); 4474ul.appendChild(li); 4475} 4476} 4477var a_p_text = document.createTextNode("S\u00EDguenos"); 4478p = document.createElement("a"); 4479p.target = "_blank"; 4480p.href = "//instagram.com/" + data[0].user.username; 4481p.classList.add("widget-seguir"); 4482p.rel = "nofollow"; 4483p.appendChild(a_p_text); 4484if(showEnInstagram){ 4485div_interior.appendChild(h3); 4486} 4487div_interior.appendChild(ul); 4488div_content.appendChild(div_interior); 4489} 4490if(showSiguenos){ 4491div_interior.appendChild(p); 4492} 4493return div_content; 4494}; 4495jsonpv2 = function (callback) { 4496var element; 4497var xhttp; 4498xhttp = new XMLHttpRequest(); 4499xhttp.open("GET", "/widgets/instagram/instagram-" + opt.token + ".js?callback=jsonp_callback_" + Math.round(100000 * Math.random()),true); 4500xhttp.send(); 4501xhttp.onreadystatechange = function() { 4502if (xhttp.readyState == 4 && xhttp.status == 200) { 4503var json_response = JSON.parse(xhttp.response); 4504element = createDOM(json_response.data); 4505}else if(xhttp.status == 404){ 4506element = document.createElement( 'html' ); 4507element.innerHTML = xhttp.response; 4508} 4509callback(element); 4510}; 4511}; 4512this.config = function (options) { 4513opt = options; 4514width = opt.hasOwnProperty("width") ? opt.width : "100%"; 4515col = opt.hasOwnProperty("col") ? opt.col : 1; 4516fill = opt.hasOwnProperty("fill") ? opt.fill : 1; 4517showSiguenos = typeof opt.showSiguenos === "undefined" || opt.showSiguenos === "" ? true : opt.showSiguenos;
4518showEnInstagram = typeof opt.showEnInstagram === "undefined" || opt.showEnInstagram === "" ? true : opt.showEnInstagram; 4519}; 4520this.run = function () { 4521jsonpv2(function (response) { 4522if(opt.hasOwnProperty("element") && document.getElementById(opt.element) !== null){ 4523document.getElementById(opt.element).appendChild(response); 4524}else if(opt.hasOwnProperty("element") && document.getElementsByClassName(opt.element).length > 0){ 4525document.getElementsByClassName(opt.element)[0].appendChild(response); 4526}else{ 4527document.getElementById('div_instagram_default').appendChild(response); 4528} 4529}); 4530}; 4531}; 4532 4533 4534widgetFacebook = function () { 4535var opt = null,showEnFacebook,showSiguenos; 4536createDOMWidgetFacebook = function(){ 4537var div_fb_page = document.createElement('div'); 4538div_fb_page.classList.add("fb-page"); 4539div_fb_page.dataset.href = typeof opt.user === "undefined" ? "None" : "https://www.facebook.com/" + opt.user; 4540div_fb_page.dataset.width = typeof opt.width === "undefined" ? "340" : opt.width; 4541div_fb_page.dataset.height = typeof opt.height === "undefined" ? "500" : opt.height; 4542div_fb_page.dataset.tabs = typeof opt.tabs === "undefined" ? "" : opt.tabs; 4543div_fb_page.dataset.hideCover = typeof opt.hideCover === "undefined" ? "false" : opt.hideCover; 4544div_fb_page.dataset.showFacepile = typeof opt.showFacepile === "undefined" ? "true" : opt.showFacepile; 4545div_fb_page.dataset.hideCta = typeof opt.hideCta === "undefined" ? "true" : opt.hideCta; 4546div_fb_page.dataset.smallHeader = typeof opt.smallHeader === "undefined" ? "false" : opt.smallHeader; 4547div_fb_page.dataset.adaptContainerWidth = typeof opt.adaptContainerWidth === "undefined" ? "true" : opt.adaptContainerWidth; 4548div_fb_page.dataset.stream = typeof opt.stream === "undefined" ? "false" : opt.stream; 4549div_fb_page.dataset.header = typeof opt.header === "undefined" ? "false" : opt.header; 4550showEnFacebook = typeof opt.showEnFacebook === "undefined" || opt.showEnFacebook === "" ? true : opt.showEnFacebook; 4551showSiguenos = typeof opt.showSiguenos === "undefined" || opt.showSiguenos === "" ? true : opt.showSiguenos; 4552var div_fb_xfbml = document.createElement('div'); 4553div_fb_xfbml.classList.add("fb-xfbml-parse-ignore"); 4554var blockquote = document.createElement('blockquote'); 4555blockquote.cite = "http://www.facebook.com/" + opt.user; 4556var a = document.createElement('a'); 4557a.href = "http://www.facebook.com/" + opt.user; 4558blockquote.appendChild(a); 4559div_fb_xfbml.appendChild(blockquote); 4560div_fb_page.appendChild(div_fb_xfbml); 4561return div_fb_page; 4562} 4563createDOM = function (callback) { 4564var js, fjs = document.getElementsByTagName('script')[0]; 4565if (!document.getElementById('facebook-jssdk')) { 4566js = document.createElement('script'); js.id = 'facebook-jssdk'; 4567js.async = true; js.src = "//connect.facebook.net/es_ES/sdk.js#xfbml=1&version=v2.5"; 4568fjs.parentNode.insertBefore(js, fjs); 4569} 4570var existeDivPrincipal = document.getElementsByClassName('widget_facebook')[0]; 4571if (!existeDivPrincipal) { 4572var div_content = document.createElement("div"); 4573div_content.classList.add("widget","widget_facebook"); 4574} 4575var div_interior = document.createElement("div"); 4576div_interior.classList.add("widget__interior"); 4577var h3 = document.createElement("h3"); 4578var span_h3 = document.createElement("span"); 4579span_h3.classList.add("sin_enlace"); 4580var span_h3_text = document.createTextNode("En Facebook"); 4581span_h3.appendChild(span_h3_text); 4582h3.appendChild(span_h3); 4583var div_fb_root = document.createElement('div'); 4584div_fb_root.id = "fb-root"; 4585var div_fb_page = createDOMWidgetFacebook(); 4586var a_p_text = document.createTextNode("S\u00EDguenos"); 4587p = document.createElement("a"); 4588p.target = "_blank"; 4589p.href = "//www.facebook.com/" + opt.user; 4590p.classList.add("widget-seguir"); 4591p.rel = "nofollow"; 4592p.appendChild(a_p_text); 4593if(showEnFacebook){ 4594div_interior.appendChild(h3); 4595} 4596div_interior.appendChild(div_fb_root); 4597div_interior.appendChild(div_fb_page); 4598if(showSiguenos){ 4599div_interior.appendChild(p); 4600} 4601if (!existeDivPrincipal) { 4602div_content.appendChild(div_interior); 4603return div_content; 4604}else{ 4605return div_interior; 4606} 4607}; 4608this.config = function (options) { 4609opt = options; 4610}; 4611this.run = function () { 4612var response = createDOM(); 4613if(opt.hasOwnProperty("element") && document.getElementById(opt.element) !== null){ 4614document.getElementById(opt.element).appendChild(response); 4615}else if(opt.hasOwnProperty("element") && document.getElementsByClassName(opt.element).length > 0){ 4616document.getElementsByClassName(opt.element)[0].appendChild(response); 4617}else{ 4618document.getElementById('div_facebook_default').appendChild(response); 4619} 4620}; 4621}; 4622 4623(function () { 4624'use strict'; 4625var keyboardAllowed = typeof Element !== 'undefined' && 'ALLOW_KEYBOARD_INPUT' in Element; 4626var fn = (function () { 4627var val; 4628var valLength; 4629var fnMap = [ 4630[ 4631'requestFullscreen', 4632'exitFullscreen', 4633'fullscreenElement', 4634'fullscreenEnabled', 4635'fullscreenchange', 4636'fullscreenerror' 4637], 4638[ 4639'webkitRequestFullscreen', 4640'webkitExitFullscreen', 4641'webkitFullscreenElement', 4642'webkitFullscreenEnabled', 4643'webkitfullscreenchange', 4644'webkitfullscreenerror' 4645], 4646[ 4647'webkitRequestFullScreen', 4648'webkitCancelFullScreen', 4649'webkitCurrentFullScreenElement', 4650'webkitCancelFullScreen', 4651'webkitfullscreenchange', 4652'webkitfullscreenerror' 4653], 4654[ 4655'mozRequestFullScreen', 4656'mozCancelFullScreen', 4657'mozFullScreenElement', 4658'mozFullScreenEnabled', 4659'mozfullscreenchange', 4660'mozfullscreenerror' 4661], 4662[ 4663'msRequestFullscreen', 4664'msExitFullscreen', 4665'msFullscreenElement', 4666'msFullscreenEnabled', 4667'MSFullscreenChange', 4668'MSFullscreenError' 4669] 4670]; 4671var i = 0; 4672var l = fnMap.length; 4673var ret = {}; 4674for (; i < l; i++) { 4675val = fnMap[i]; 4676if (val && val[1] in document) { 4677for (i = 0, valLength = val.length; i < valLength; i++) { 4678ret[fnMap[0][i]] = val[i]; 4679} 4680return ret; 4681} 4682} 4683return false;
4684})(); 4685var screenfull = { 4686request: function (elem) { 4687var request = fn.requestFullscreen; 4688elem = elem || document.documentElement; 4689if (/5\.1[\.\d]* Safari/.test(navigator.userAgent)) { 4690elem[request](); 4691} else { 4692elem[request](keyboardAllowed && Element.ALLOW_KEYBOARD_INPUT); 4693} 4694}, 4695exit: function () { 4696document[fn.exitFullscreen](); 4697}, 4698toggle: function (elem) { 4699if (this.isFullscreen) { 4700this.exit(); 4701} else { 4702this.request(elem); 4703} 4704}, 4705raw: fn, 4706func:null 4707}; 4708if (!fn) { 4709window.screenfull = false; 4710return; 4711} 4712Object.defineProperties(screenfull, { 4713isFullscreen: { 4714get: function () { 4715return !!document[fn.fullscreenElement]; 4716} 4717}, 4718element: { 4719enumerable: true, 4720get: function () { 4721return document[fn.fullscreenElement]; 4722} 4723}, 4724enabled: { 4725enumerable: true, 4726get: function () { 4727return !!document[fn.fullscreenEnabled]; 4728} 4729} 4730}); 4731window.screenfull = screenfull; 4732})();
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.