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

182
Vistas
Changing embedded Vimeo video duration and setting new end time in UI through JavaScript

I currently have a Vimeo video added to my website through an embed code from Vimeo's end. I do not own this video so I can't manually alter it. Originally, I wanted to automatically pause the video at the 1:50 mark for anyone using my site and viewing the video. With help from a wonderful user in this thread, I have a working script that does just that. But now, I'd like to reflect that change in the UI of the video player. So instead of the video showing "6:34" as the video duration, I want the video UI to show the end of the video being 1:50 (110 seconds as shown in the script below).

Here is the video embed code's HTML:

<iframe id="vidz" src="https://player.vimeo.com/video/401649410?h=11d74aa27c&amp;portrait=0" width="450" height="253" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen=""></iframe>

And here is the aforementioned script:

<script src="https://player.vimeo.com/api/player.js"></script>
<script>
    var iframe = document.querySelector('iframe');
    var player = new Vimeo.Player(iframe);
    function foo() {
        
        player.getCurrentTime().then(function(time) {
            console.log('time:', time);
            if(time >= 110){  
                player.pause()
            }
        });
        setTimeout(foo, 1000);
    }
    player.on('play', function() {
        foo();
    });
</script>

Is there a way to manipulate the video player's UI/timeline to reflect a new endtime of 1:50?

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