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

261
Views
Is it possible to detect low power mode using JavaScript?

We have a website with a background video. And have an issue, when a user is on Low power mode on IOS devices (iPhone, Mac, etc.).

Is it possible to handle only low power mode and set fallback image instead of video with play button?

I saw a variant with a suspend event, but it fired also when the video fully loaded, so it's not a correct solution for us.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can use javaScript battery API to track the battery status

about 4 years ago · Juan Pablo Isaza Report

0

Seems I found a solution: The most correct way, in my opinion, is just handle error throwing (in catch block) and set a fallback image instead of video.

FYI: This solution is relevant only when the video is in the background (from a UX point of view)

So the solution is:

`

useEffect(() => {
  if (videoRef.current) {
    videoRef.current?
      .play()
      .then(() => {})
      .catch((error) => {
        setVideoPaused(true);

        return error;
      });
  }
}, []);

`

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!