fix #2319 (Player View: When navigating with cursor keys, timeline may get out of sync with video)

This commit is contained in:
rolux 2014-02-17 12:07:34 +00:00
parent 6dfaf38341
commit 6a84785b5a
2 changed files with 13 additions and 1 deletions

View file

@ -302,6 +302,9 @@ Ox.VideoPlayer = function(options, self) {
key_l: toggleLoop, key_l: toggleLoop,
key_left: function() { key_left: function() {
setPosition(self.options.position - self.secondsPerFrame); setPosition(self.options.position - self.secondsPerFrame);
that.triggerEvent('position', {
position: self.options.position
});
}, },
key_minus: function() { key_minus: function() {
changeVolume(-0.1); changeVolume(-0.1);
@ -309,6 +312,9 @@ Ox.VideoPlayer = function(options, self) {
key_p: playInToOut, key_p: playInToOut,
key_right: function() { key_right: function() {
setPosition(self.options.position + self.secondsPerFrame); setPosition(self.options.position + self.secondsPerFrame);
that.triggerEvent('position', {
position: self.options.position
});
}, },
key_shift_f: function() { key_shift_f: function() {
self.options.enableFullscreen && toggleFullscreen(); self.options.enableFullscreen && toggleFullscreen();
@ -318,9 +324,15 @@ Ox.VideoPlayer = function(options, self) {
}, },
key_shift_left: function() { key_shift_left: function() {
setPosition(self.options.position - 1); setPosition(self.options.position - 1);
that.triggerEvent('position', {
position: self.options.position
});
}, },
key_shift_right: function() { key_shift_right: function() {
setPosition(self.options.position + 1); setPosition(self.options.position + 1);
that.triggerEvent('position', {
position: self.options.position
});
}, },
key_space: togglePaused, key_space: togglePaused,
key_up: function() { key_up: function() {

View file

@ -171,7 +171,7 @@ Ox.VideoPlayerPanel = function(options, self) {
}, },
key_p: playInToOut, key_p: playInToOut,
key_right: function() { key_right: function() {
movePositionBy(self.options.fps); movePositionBy(1 / self.options.fps);
}, },
key_shift_down: function() { key_shift_down: function() {
movePositionBy(self.options.duration); movePositionBy(self.options.duration);