2013-10-07 66 views
0

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

伪代码

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 
     } 
    } 

回答

0

您可以播放视频的端事件循环。然后,只需要跟踪您已经播放了多少次。

var max = 3, 
    i = 1; 

videojs("home_video").on('ended', function(event) { 
    if (i < max) { 
    this.play(); 
    i++; 
    } 
});