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

179
Views
Vimeo - Detect password prompt

I embedded a protected vimeo video on a site. Is there a method via the JavaScript API to find out if a password is currently being requested?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

At the moment there seems to be no other option than to listen to an error message. So unfortunately there is nothing else to do than keep trying to play the video and see if an error is thrown. Unfortunately not that very nice.

//check if video is playing
player.getPaused().then(function(paused) {
    //try to pause video
    player.pause().then(function() {
        //when video was already playing, play again
        if(!paused) player.play()
    }).catch(function(error) {
        //when video couldn't pause and the error is 'PasswordError'
        if(error.name == 'PasswordError') {
            //currently vimeo asks for password
            videoWrp.classList.remove('loading');
            videoWrp.classList.add("pw-protection");
            //loop over the play function, till password was entered
            pwLoop = setInterval(function (){
                player.play().then(function() {
                    //password was entered
                    videoWrp.classList.remove("pw-protection");
                    clearInterval(pwLoop);
                })
            }, 500);
        }
    });
});
about 4 years ago · Juan Pablo Isaza Report
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!