Thanks for looking into that for me.
I was using Firefox Developer Edition, but I just tried it with the stable release of Firefox 53 and experienced the same problem. I wonder if this is an operating system-level incompatibility (I'm using macOS Yosemite 10.10.5).
Anyway, I did a little digging. I hope you don't mind.
When you click the 'rewind 10 seconds' button, it calls the function
seek(-10). Similarly, when you click the 'rewind 60 seconds' button, it calls
seek(-60).
The function definition of
seek is as follows:
Code:
function seek(seekTime) {
var seekedTime = dmmplayer.currentTime + dmmvideo.second2millisecond(seekTime)
if (
isActive
&& 0 <= seekedTime
&& seekedTime <= dmmplayer.duration
) {
dmmplayer.currentTime = seekedTime
}
}
I checked the definition of
dmmvideo.second2millisecond (I have prettified the source):
Code:
function a(e) {
var t = new Date(0);
t.setSeconds(e);
var r = t.getTime();
return r;
}
When you call
dmmvideo.second2millisecond(-10), it returns
3590000.
When you call
dmmvideo.second2millisecond(-60), it returns
3540000.
This is probably because of an integer underflow.
So it is actually
adding 3,590,000 milliseconds or 3,540,000 milliseconds depending on which button you press.
Maybe other browsers or operating systems behave differently.
It should be possible to resolve this by changing the definition of
dmmvideo.second2millisecond to simply:
Code:
function a(e) {
return e * 1000;
}
As another issue, the keyboard controls don't seem to work for me. Bringing up the browser console shows a "ReferenceError: event is not defined" error. I might see what's going on with that another time.
EDIT: I have figured out why keyboard controls aren't working.
In
r18h5p.js:
Code:
$(document).on({
keydown: function(evt) {
openPanel()
seekTime = 1
if (event.shiftKey) {
seekTime = 6
}
[...]
The event object is called
evt as the parameter, but there is an attempt to access it with
event.shiftKey. This should be
evt.shiftKey. Note that this same problem occurs a couple more times in the same file, for the Alt+Enter fullscreen toggle and the Shift+D window close shortcut.