Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!