I have an html Video and I am controlling the playback speed depending on the position of the mouse. When the mouse position goes into minus numbers I get this error:
Failed to set the 'playbackRate' property on 'HTMLMediaElement': The provided playback rate (-0.01) is not in the supported playback range.
This is because minus numbers do not work as a playback rate. It would be cool if the video played backwards when the value goes less then zero. How can I achieve this?
$("body").mousemove(function(event){
var relX = event.pageX - $(this).offset().left;
var relY = event.pageY - $(this).offset().top;
$('.slow-video').prop({
playbackRate: ((relY/200)+(relX/300)-2)
});
});