toggle playback rate 100% -> 200% -> 50% -> 100%

This commit is contained in:
j 2020-04-28 21:27:36 +02:00
parent cebfedfdd4
commit bd7aedb116
3 changed files with 20 additions and 1 deletions

View file

@ -237,7 +237,9 @@ Ox.VideoAnnotationPanel = function(options, self) {
setPoint('in', self.options.position);
},
key_k: function togglePlaybackRate() {
that.options({playbackRate: self.options.playbackRate == 1 ? 2 : 1});
that.options({
playbackRate: self.options.playbackRate == 1 ? 2 : self.options.playbackRate == 2 ? 0.5 : 1
});
},
key_l: toggleLoop,
key_left: function() {

View file

@ -321,6 +321,11 @@ Ox.VideoPlayer = function(options, self) {
key_g: function() {
goToNext('result', 1);
},
key_k: function togglePlaybackRate() {
that.options({
playbackRate: self.options.playbackRate == 1 ? 2 : self.options.playbackRate == 2 ? 0.5 : 1
});
},
key_l: toggleLoop,
key_left: function() {
setPosition(self.options.position - self.secondsPerFrame);

View file

@ -16,6 +16,7 @@ Ox.VideoPlayerPanel <f> VideoPlayerPanel Object
key_* <!> key_*
muted <!> muted
paused <!> paused
playbackRate: <n|1> playback rate
position <!> position
resizecalendar <!> resizecalendar
resolution <!> resolution
@ -62,6 +63,7 @@ Ox.VideoPlayerPanel = function(options, self) {
muted: false,
out: 0,
paused: true,
playbackRate: 1,
playInToOut: false,
position: 0,
poster: '',
@ -106,6 +108,11 @@ Ox.VideoPlayerPanel = function(options, self) {
paused: function() {
self.$video.options({paused: self.options.paused});
},
playbackRate: function() {
self.$video.options({
playbackRate: self.options.playbackRate
});
},
position: function() {
self.$video.options({position: self.options.position});
self.$timeline.options({position: self.options.position});
@ -167,6 +174,11 @@ Ox.VideoPlayerPanel = function(options, self) {
self.$annotationPanel.options({selected: ''});
setPoint('in', self.options.position, false, true);
},
key_k: function togglePlaybackRate() {
that.options({
playbackRate: self.options.playbackRate == 1 ? 2 : self.options.playbackRate == 2 ? 0.5 : 1
});
},
key_l: toggleLoop,
key_left: function() {
movePositionBy(-1 / self.options.fps);