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

170
Views
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
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!