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

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