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); setPoint('in', self.options.position);
}, },
key_k: function togglePlaybackRate() { 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_l: toggleLoop,
key_left: function() { key_left: function() {

View file

@ -321,6 +321,11 @@ Ox.VideoPlayer = function(options, self) {
key_g: function() { key_g: function() {
goToNext('result', 1); 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_l: toggleLoop,
key_left: function() { key_left: function() {
setPosition(self.options.position - self.secondsPerFrame); setPosition(self.options.position - self.secondsPerFrame);

View file

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