Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

253
Visualizações
Per CHANGELOG, since Version 3.53.0 phaser3 is preventing `AudioContext was not allowed` warnings, but I still encounter it, how do I do?

Per the CHANGELOG, since Version 3.53.0 - Anastasia - 8th March 2021

SceneManager.loadComplete will no longer try to unlock the Sound Manager, preventing AudioContext was not allowed to start console warnings after each Scene finishes loading.

However, each time I run a phaser3 app on Chrome 96.0.4664.110 (Official Build) (x86_64)

var game = new Phaser.Game();
<script src="https://cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>

I still get that annoying warning.

enter image description here

Am I missing something?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The problem is, that this is a browser "issue" (look at this link, for a chromium example: https://bugs.chromium.org/p/chromium/issues/detail?id=943258#c6)
the browser, outputs this warning, if you create an AudioContext without user interaction. Phaser creates an AudioContext on creating a Phaser Game Object new Phaser.Game(...);.

If you want to get rid of the Warning message, I have two different ideas, how you could do this:

Option 1:
Make a simple html-page with a start button/image/... and only create the Phaser.Game Object after a user iteraction, then there would be no Warning. (this is "cleaner", abit of overhead)

let button = document.querySelector('#btnStart');

button.addEventListener('click', () => {
    var game = new Phaser.Game();
});
<script src="https://cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<button id="btnStart"> Start </button>

Option 2:
Or you could clear the console, with console.clear(); after creating the object. (easy quick fix)

var game = new Phaser.Game();
console.clear();
<script src="https://cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>

Just so that you know the Warning has no effect, a can be ignored.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda