How to set start and end time parameters using Vimeo player?

前端 未结 2 2028
没有蜡笔的小新
没有蜡笔的小新 2021-02-19 09:05

For Youtube player I can set start and end time parameters which will crop video in this range. How can I do the same thing using Vimeo player?

相关标签:
2条回答
  • 2021-02-19 09:11

    I was able to solve it using "setCurrentTime" for set the start of the video, and 'timeupdate' for set the end.

    For the start of the video at a specific time:

    Player.setCurrentTime(5);
    

    The video will start after 5 seconds.

    For the end of video:

    video01Player.on('timeupdate', function(data) {
      if (data.seconds > '10') {
    
        video01Player.pause();
     
      }
    });
    

    In this case the video will pause after 10 seconds.

    timeupdate This event fires when the playback position of the video changes, generally every 250 ms during playback, but the interval can vary depending on the browser.

    0 讨论(0)
  • 2021-02-19 09:27
    • Vimeo JavaScript API: seekTo(seconds:Number):void and pause():void after some progress.

    • Vimeo ActionScript API: seek(seconds:Number):void and pause():void after some progress.

    • Also basic link parameter from this Help Center article: vimeo.com/148198462#t=1m5s Stopping the video at the particular time in this case isn't implemented yet.

    0 讨论(0)
提交回复
热议问题