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

175
Vistas
How do I stop all other Plyr instances except this one

I set up this little javascript to initialize a couple of players on my webpage and add an event to make only one player active while everything else is paused. This is supposed to emulate the "autpoause" function which, for some reason, is only available on Vimeo videos, but not Youtube videos:

    const players = Plyr.setup(".myplayer", { fullscreen: { enabled: false }, autopause: true });


    $('players').each(function(index, players) {

        players[index].on('play', function(index, players, event) {

          players.not(this).each(function(index, players) {

            players[index].pause();

          });

        });

    });

Somehow, nothing really happens. The .not(this) is supposed to select all other instances except the one I am declaring the event listener on. But when I try it out, nothing is paused. All the other players keep playing.

What am I doing wrong? Any hint is appreciated.

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