问题
I'm trying to set the current time for the last video in the playlist, but it always fails. This is the code I'm working on with my try. It doesn't set the time at all and I don't know how to solve.
var iframe = document.querySelector('iframe.main-player');
var player = new Vimeo.Player(iframe);
var video_ids = [123456789, 987654321, 543216789];
var index = 0;
var playNext = function(data) {
if (index <= video_ids.length)
player.loadVideo(video_ids[index++])
}
let last = video_ids.length - 1;
player.loadVideo(video_ids[index++]);
player.on('loaded', function() {
if (last == index++) {
player.setCurrentTime(200);
}
player.play();
});
player.on('ended', playNext);
来源:https://stackoverflow.com/questions/64857210/how-to-use-setcurrenttime-on-vimeo-video-within-a-playlist