0

我们如何使用 video.js 来做到这一点我最初的想法是我们可以在视频结束时触发播放。

伪代码

    for (int i = number_of_times_to_loop, i>=0, i--) {
        see if the timer of the video reached the end {
            trigger play from start
        }
    }
4

1 回答 1

1

您可以在结束事件上播放视频以循环播放。然后只需跟踪您已经玩过多少次即可。

var max = 3,
  i = 1;

videojs("home_video").on('ended', function(event) {
  if (i < max) {
    this.play();
    i++;
  }
});
于 2013-10-09T13:02:00.113 回答