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

163
Vistas
How to assign the handler to the correct play button

Clicking a play button starts all videos that have been previously played - the stop button works and no video is playing when the play buttons are on display.

Starting the videos other than the one play button that was previously clicked is supposed to start, and the other videos are supposed to be stopped.

That is the bug that needs to be fixed.

Clicking one of the play buttons when videos are stopped should only start one video, not multiple videos.

To reproduce issue: Click on one play button, and the video loads.

Then Click on the X

Now click on a different play button and you will see, the video that was clicked on before is now playing, along with the video I just clicked on. So now there are 2 videos playing at the same time.


This code is run each time I create a new player.

I am assigning the handler to play the video to every play button which is why all the videos play at once.

How do I assign the handler to the correct play button for that player?

How would I find the specific play button I need?

Click Run, not update to test code.

Code: https://jsitor.com/EBO8gdOs0c

Backup copy: https://jsfiddle.net/5etxr1kg/

function createPlayHandler(player) {
    const playButtons = document.querySelectorAll(".thePlay");
    playButtons.forEach(function playButtonHandler(buttons) {
      buttons.addEventListener("click", function buttonClickHandler() {
        player.playVideo();
      });
    });
  }
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