//Versao 1.3 //GMCEmbedCreator ------------------- function GMCEmbedCreator(config) { this.id = null; this.config = config; this.jaDeuPlay = false; } GMCEmbedCreator.prototype.getBanda = function() { return this.config.banda; } GMCEmbedCreator.prototype.incrementaCookiePropaganda = function() { if( !gmcEmbedDetecter.isWmpEmbed() ) { var i = gmcEmbedUtil.getCookie("Propaganda"); var contador; try { contador = eval(i); } catch(e) { } if(!contador) contador=0; //alert(contador); contador++; gmcEmbedUtil.setCookie("Propaganda",contador,2); } } GMCEmbedCreator.prototype.zeraCookiePropaganda = function() { gmcEmbedUtil.setCookie("Propaganda","0",2); } GMCEmbedCreator.prototype.play = function() { if( !this.jaDeuPlay ) { this.config.autoStart = true; var url = gmcEmbedUtil.getUrlPlay(this.config); location.href = url; } } GMCEmbedCreator.prototype.reloadImagem = function() { this.config.autoStart = false; var url = gmcEmbedUtil.getUrlPlay(this.config); location.href = url; } GMCEmbedCreator.prototype.showWmp = function() { this.putWmpTag(); this.jaDeuPlay = true; } GMCEmbedCreator.prototype.showFimDeVideo = function() { if( this.config.mostraFimVideo=="true" && !this.config.escondeFimVideo ) { this.config.autoStart = true; var url = gmcEmbedUtil.getUrlFim(this.config); location.href = url; } else { this.config.autoStart = false; var url = gmcEmbedUtil.getUrlPlay(this.config); location.href = url; } } GMCEmbedCreator.prototype.showImagem = function() { try { document.getElementById(this.config.div).innerHTML = ""; document.getElementById(this.config.div).style.display = "none"; document.getElementById(this.config.divTitulo).style.display = "block"; document.getElementById(this.config.divImagem).style.display = "block"; document.getElementById(this.config.divFormEnviar).className = "off"; document.getElementById(this.config.divParabens).className = "off"; } catch(e) {} this.jaDeuPlay = false; } GMCEmbedCreator.prototype.putWmpTag = function() { document.getElementById(this.config.divTitulo).style.display = "none"; document.getElementById(this.config.divImagem).style.display = "none"; document.getElementById(this.config.div).style.display = "block"; var p; var largura = gmcEmbedUtil.getLargura(this.config.banda); var altura = gmcEmbedUtil.getAltura(this.config.banda); if( gmcEmbedDetecter.isWmpEmbed() ) { p = new GMCEmbedTag(largura, altura + this.config.barra_embed,this.config.url); document.getElementById(this.config.div).innerHTML = p.toString(); } else { p = new GMCObjectTag(largura, altura + this.config.barra_wmp,this); document.getElementById(this.config.div).innerHTML = p.toString(); document.getElementById(p.id).URL = config.url; p.monitora(); } this.id = p.id; } GMCEmbedCreator.prototype.adaptaBanda = function() { //this.setaCookieBanda(); gmcEmbedUtil.adaptaBanda( this.config.banda ); } GMCEmbedCreator.prototype.telaCheia = function() { if( !gmcEmbedDetecter.isWmpEmbed() ) { var m = document.getElementById(this.id); if( m && m.playState == 3 ) { var t = gmcEmbedUtil.getCookie("GMCEmbedTelaCheia"); if( !t || t.length==0 ) { var m = "Para voltar ao modo de visualizaĆ§Ć£o normal aperte a tecla ESC"; alert(m); } try { document.getElementById(this.id).fullScreen = true; gmcEmbedUtil.setCookie("GMCEmbedTelaCheia","true",30); } catch(e) { } } } } //Tags ------------------- function GMCEmbedTag(width,height,url) { this.id = "gmcPlayer_" + (new Date().getTime()) + (Math.random()+"").replace(".","_"); this.width = width; this.height = height; this.url = url; } GMCEmbedTag.prototype.toString = function() { var tag = ''; var src = ''; if(this.url) src = 'src="' + this.url + '"'; tag += '= 320 ) { this.finalizou = true; this.creator.showFimDeVideo(); } } else if( s==10 || s==1 ) { if( !this.drm ) { try{ document.getElementById("telaCheia").style.display = "none"; }catch(e){} if( !this.finalizou ) { this.finalizou = true; this.creator.reloadImagem(); } } } else { if( s==3 || s==6 ) this.drm = false; try{ document.getElementById("telaCheia").style.display = "inline"; }catch(e){} } } GMCObjectTag.prototype.onMediaChange = function(s) { if( this.isPropaganda() ) { this.creator.zeraCookiePropaganda(); } var id = this.getIdMidia(); if( id && id!=this.ultimaMidia ) { this.creator.incrementaCookiePropaganda(); this.ultimaMidia = id; } }