What I need
I need a script (Javascript, jQuery, etc.) to rewind a video after clicking. I used a script I found in some forums, but it rewinds the video with acceleration, which makes the animation look bad / strange. It would need to be at the same speed.
What I have
//[Rewind]
var video = document.getElementById('video');
var intervalRewind;
jQuery(video).on('play',function(){
video.playbackRate = 1.0;
clearInterval(intervalRewind);
});
jQuery(video).on('pause',function(){
video.playbackRate = 1.0;
clearInterval(intervalRewind);
});
jQuery("#btnVoltar").click(function() { // button function for rewind
intervalRewind = setInterval(function(){
video.playbackRate = 1.0;
if(video.currentTime == 0){
clearInterval(intervalRewind);
video.pause();
}
else{
video.currentTime += -.1;
}
},30);
});