Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
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 Respuestas
Responde la pregunta

0

You can use javaScript battery API to track the battery status

about 4 years ago · Juan Pablo Isaza Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda