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

103
Vistas
Detect play/pause interaction on video element and ignore the events triggered through seek feature

I'm having an issue with the video element events:

I only want to fire off an analytics event when the play or pause button is interacted with. The play, pause, and playing events work as expected up until the seek functionality is used.

I'd like to isolate the play/pause events from the ones fired through seek/seeking.

When the video is playing and it is clicked (moved to a different point), the play, playing, and pause events are triggered because the video will pause to buffer and start playing the video again. This order is not always the same. When paused you don't get any of these events.

When debugging the playing and pause events, I've seen the following order:

  • Order 1: Pause, Seeking, Seeked, Playing
  • Order 2: Pause, Playing, Seeking, Seeked, Playing

This link to w3.org/mediaevents gives you a good indication of the above.

I've set up my own version in jsfiddle (see console logs).

I've tried setting a flag that is reset on a timeout and setting/checking the last state for each event e.g. lastEvent = 'seeking'. None of these worked 100% because of the inconsistent fire order. If you drag the seek bar it won't fire the play, playing, or paused events which adds another scenario.

about 4 years ago · Juan Pablo Isaza
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