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

180
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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