luizcrf

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Hello, I've been trying to solve a problem for about 3 days and can't. I added the "adsense" preroll html5 to my online gaming site. It works correctly, and after clicking the "skip ad" button, the game appears correctly. You can check in this video: https://youtu.be/Az2TdBNL6bM The problem is that the "skip ad" button doesn't seem to work with non-countdown ads. You can check in this video: https://youtu.be/u2MwlhW8QaA I don't know why, but when this type of ad appears, preroll can't remove the ad, leaving a black screen in place of the game. What can I be doing wrong? <html> <head> <meta content='text/html; charset=utf-8' http-equiv='Content-Type' /> <meta content='IE=9' http-equiv='X-UA-Compatible' /> <title>Pizza Party</title> <link rel="stylesheet" type="text/css" media="all" href="/style.css" /> <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'></script> </head> <body> <div id="flashok"> <h1 id="volta01h1" itemprop="name">Pizza Party</h1> </div> <div class="game-content"><div id="area"> <div id="filme"><div id="my_container"> <div id="game"> <iframe frameborder="0" id="game_src" scrolling="no" src="https://m.playdora.com/gamesource/pizza/index.html" width="800" height="600"></iframe> </div> </div> <!-- FIM: Jogo Swf --></div><div id="preload"></div> </div> </div> <div class="footer"> <script type="text/javascript"> function showcontent() { document.getElementById("preload").style.display = "none"; document.getElementById("game").style.display = "block"; } function removeAdSwf() { document.getElementById("preload").style.visibility = "hidden"; showcontent(); } function noAdsReturned() { showcontent(); } </script> <script type="text/javascript" src="//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_image&client=ca-games-pub-6347577570466218&description_url=https%3A%2F%2Fmysite.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> </div> </body> </html>
  2. Hello, I added the preloader in my game using the API of facebook instant games, but I'm having trouble figuring out how to add the blue "play now" button Image: https://imgur.com/a/YmggUIP And make the game start only after the user clicks this video button: https://youtu.be/Sjj_UKX549A How to proceed to give this action to the game? HTML HTML <!DOCTYPE html> <html manifest="offline.appcache"> <head><script src="https://connect.facebook.net/en_US/fbinstant.6.0.js"></script> <script src = "game.js"></script> </head> <body> GAME </body> </html> game.js FBInstant.initializeAsync().then(function() { FBInstant.setLoadingProgress(100); Module._fbinstant_inited = true; FBInstant.startGameAsync().then(function() { var windowWidth = window.innerWidth; var windowHeight = window.innerHeight; if(windowWidth > windowHeight){ windowWidth = windowHeight / 1.8; } var gameWidth = windowWidth * gameOptions.gameHeight / windowHeight; game = new Phaser.Game(gameWidth, gameOptions.gameHeight, Phaser.CANVAS); game.state.add("Boot", boot); game.state.add("Preload", preload); game.state.add("TitleScreen", titleScreen); game.state.add("PlayGame", playGame); game.state.start("Boot"); }) }) FBInstant.startGameAsync().then(function() { // Here we can be sure the player has already tapped play. myGame.start(); });