0
What I need
I need a script (Javascript, jQuery, etc.) to rewind a video after clicking. I used a script I found on some forums, but it rewinds the video with acceleration, which makes the animation look bad/weird. It would need to be at the same speed.
What I got
//[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);
});
Try changing the interval of setInterval to 100 instead of 30 and see if it works (in the last part of the code, after Else
else{
 video.currentTime += -.1;
 }
 },100);
– Máttheus Spoo