Video.js Implement video can only be detailed

The main idea is to click on the progress bar need to get a point in time before dragging me to deal with mouseup event, access to the oldTime easy to handle, and then fast forward and rewind on demand limit drag, because the project allowed back to look at, does not allow fast forward, so too maxTime recording, video recording user when viewed normally the maximum that time point, not exceed maxTime

  var isMousedown = false; var oldTime = 0 , newTime = 0, maxTime = 0; // drag the progress bar will first execute this event $ ( "vjs-progress-holder.") mouseup (function () {isMousedown = true;. oldTime = vid1.currentTime (); }); // vid1 is videojs objects vid1.on ( 'timeupdate', function () {if (isMousedown) {if (vid1.currentTime ()> maxTime) {vid1.currentTime (oldTime);} isMousedown = false;} else {if (vid1.currentTime ()> maxTime) {maxTime = vid1.currentTime ();}}});  

summed

the above is video.js small series to introduce the video can only be achieved retreat can not fast-forward the idea Hi, we want to help, if you have any questions please give me a message, Xiao Bian will promptly reply to everyone. Thank you very much for your support of Tumi Cloud Website!

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment