video.js - Looping a html5 video set number of times -
how using video.js initial thoughts can trigger play when video ends.
pseudo code
(int = number_of_times_to_loop, i>=0, i--) { see if timer of video reached end { trigger play start } }
you can play video on ended event loop. it's matter of tracking how many times have played already.
var max = 3, = 1; videojs("home_video").on('ended', function(event) { if (i < max) { this.play(); i++; } });
Comments
Post a Comment