Ola a todos! Tenho um site de jogos online e estou com um problemas para rodar o pre roll do adsense junto ao swfobject. Preciso adicionar o parametro "allowNetworking:" internal " ,mas ele não funciona com o script "script" removeAdSwf" . Esse script é o que faz o pre roll ser exibido acima do jogo swf e removido logo quando o anuncio termina.
O código que utilizo fica assim:
<html>
<title>Title</style>
<link rel="stylesheet" type="text/css" media="all" href="/style.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" rel="nofollow"></script>
<script src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
</head>
<body>
<style>
#preload{margin:0 auto;display:block;overflow:hidden;height:480px;width:640px;background-color:#000;}
#game{display:none;text-align:center;margin:0 auto;}
#area{text-align:center;}
</style>
<!-- SDK ADSENSE HTML5 ROLL CODE -->
<script type="text/javascript" src="http://imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
<script>
function init(){preLoad=document.getElementById("area"),requestAds()}function createAdDisplayContainer(){google.ima.settings.setVpaidAllowed(!0),
adDisplayContainer=new google.ima.AdDisplayContainer(document.getElementById("preload"))}function requestAds(){createAdDisplayContainer(),adDisplayContainer.initialize(),adsLoader=new google.ima.AdsLoader(adDisplayContainer),adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,onAdsManagerLoaded,!1),adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,Finalizar,!0);{var e=new google.ima.AdsRequest;window.location.href}e.adTagUrl="https://googleads.g.doubleclick.net/pagead/ads?ad_type=video_text_image&client=ca-games-pub-6247777970466238&description_url=http%3A%2F%2Fmysite123.com&videoad_start_delay=0&hl=pt&max_ad_duration=30000",e.linearAdSlotWidth=640,e.linearAdSlotHeight=480,e.nonLinearAdSlotWidth=400,e.nonLinearAdSlotHeight=300,adsLoader.requestAds(e)}function onAdsManagerLoaded(e){adsManager=e.getAdsManager(preLoad),adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,onAdError),adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,onContentPauseRequested),adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,onContentResumeRequested),adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,onAdEvent),adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,onAdEvent),adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,onAdEvent),adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,Finalizar),adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,Finalizar),adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,Finalizar);try{adsManager.init(640,480,google.ima.ViewMode.NORMAL),adsManager.start()}catch(a){Finalizar()}}function onAdEvent(e){var a=e.getAd();switch(e.type){case google.ima.AdEvent.Type.LOADED:a.isLinear()||(sec=15,i=setInterval(function(){--sec,0===sec&&(clearInterval(i),Finalizar())},1e3));break;case google.ima.AdEvent.Type.STARTED:a.isLinear()&&(intervalTimer=setInterval(function(){adsManager.getRemainingTime()},300));break;case google.ima.AdEvent.Type.COMPLETE:a.isLinear()&&clearInterval(intervalTimer)}}function onAdError(e){console.log(e.getError()),adsManager.destroy(),Finalizar()}function onContentPauseRequested(){}function onContentResumeRequested(){}function Finalizar(){removeAdSwf()}function adsenseAdComplete(){removeAdSwf()}function noAdsReturned(){removeAdSwf()}var adsManager,adsLoader,adDisplayContainer,intervalTimer,playButton,preLoad;countdownTimer=setInterval(function(){adsManager.getRemainingTime()},1e3),init();
</script>
<!-- SDK ADSENSE HTML5 ROLL CODE -->
<!--START SCRIPT DESTROY PRELOADER -->
<script type="text/javascript">
function removeAdSwf() {
noAdsReturned();
}
function noAdsReturned() {
document.getElementById("game").innerHTML = my_container_html;
document.getElementById("game").style.display = "block";
document.getElementById("preload").style.display = "none";
}
var my_container_html = document.getElementById("game").innerHTML;
document.getElementById("game").innerHTML = '';
</script>
<!-- END SCRIPT DESTROY PRELOADER -->
<div id="area">
<script type="text/javascript">
var flashvars, attributes = {};
var params = {
allowNetworking:"internal"
};
swfobject.embedSWF("http://mysite123.com/angrybirds.swf", "game", "640", "480", "9.0.0"); </script>
<div id="game"> </div>
<div id="preload"> </div>
</div>
</body>
</html>
Usando a ferramenta "inspecionar elemento" do chorme, o resultado do swfobject ficou assim:
<object type="application/x-shockwave-flash" data="http://mysite123.com.angrybirds.swf" width="640" height="480" id="game" style="visibility: visible; display: block; height: 480px; width: 640px;">
</object>
Estive tentando encontrar o erro por vários dias, mas não consigo. O que posso estar fazendo de errado?