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

194
Visualizações
Is there low power mode detection for javascript in iOS? javascript game runs in half speed when low power mode is on

Iv built a javascript game, but on iOS with low power mode on the frame rate slows down to half speed giving the player a clear advantage. This Stackoverflow provides a solution that works.

A hidden video is loaded but triggers an error when it tries to autoplay, I then use that error to remove the start buttons and display a message. "please turn off low power mode!"

testVideo
.play()
.then(() => {})
 .catch((error) => {
    //Do something like adding controls to allow user to manually play
    //document.body.style.display = 'none'; <!--example-->
});

});

the problem is my testVideo method only gets triggered on the initial page load. Meaning the player can turn on LPM any time after that and play the game in half speed. I tried removing the video and having it re-load as part of the game reset method but this doesn't work because the error is triggered by browser default not allowing for autoplay which only happens on refresh.

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

0

While not a direct solution, an alternative way to handle this would be to warn the player that "the game does not work as intended on LPM" in a little banner that they can choose to turn off.

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