From 354a2151df49c8b59270b88e77bc2244abcd0730 Mon Sep 17 00:00:00 2001 From: Jason <84899178+jasonhenriquez@users.noreply.github.com> Date: Thu, 5 Aug 2021 20:17:01 +0000 Subject: [PATCH] Add customized fast-forward / rewind intervals (#1390) * Setting to customize fast-forward/rewind times * Move variable placement to keep alphabetical order Moves defaultSkipInterval to be one line below defaultQuality because Q comes before S in the alphabet. This keeps the variable declarations alphabetical. --- .../ft-video-player/ft-video-player.js | 20 +++++++++++-------- .../player-settings/player-settings.js | 5 +++++ .../player-settings/player-settings.vue | 9 +++++++++ src/renderer/store/modules/settings.js | 1 + static/locales/en-US.yaml | 1 + 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/ft-video-player/ft-video-player.js b/src/renderer/components/ft-video-player/ft-video-player.js index 72edb290..662cbd19 100644 --- a/src/renderer/components/ft-video-player/ft-video-player.js +++ b/src/renderer/components/ft-video-player/ft-video-player.js @@ -143,6 +143,10 @@ export default Vue.extend({ return this.$store.getters.getDefaultPlayback }, + defaultSkipInterval: function () { + return this.$store.getters.getDefaultSkipInterval + }, + defaultQuality: function () { return parseInt(this.$store.getters.getDefaultQuality) }, @@ -1209,9 +1213,9 @@ export default Vue.extend({ break case 74: // J Key - // Rewind by 10 seconds + // Rewind by 2x the time-skip interval (in seconds) event.preventDefault() - this.changeDurationBySeconds(-10) + this.changeDurationBySeconds(-this.defaultSkipInterval * 2) break case 75: // K Key @@ -1221,9 +1225,9 @@ export default Vue.extend({ break case 76: // L Key - // Fast Forward by 10 seconds + // Fast-Forward by 2x the time-skip interval (in seconds) event.preventDefault() - this.changeDurationBySeconds(10) + this.changeDurationBySeconds(this.defaultSkipInterval * 2) break case 79: // O Key @@ -1269,15 +1273,15 @@ export default Vue.extend({ break case 37: // Left Arrow Key - // Rewind by 5 seconds + // Rewind by the time-skip interval (in seconds) event.preventDefault() - this.changeDurationBySeconds(-5) + this.changeDurationBySeconds(-this.defaultSkipInterval * 1) break case 39: // Right Arrow Key - // Fast Forward by 5 seconds + // Fast-Forward by the time-skip interval (in seconds) event.preventDefault() - this.changeDurationBySeconds(5) + this.changeDurationBySeconds(this.defaultSkipInterval * 1) break case 49: // 1 Key diff --git a/src/renderer/components/player-settings/player-settings.js b/src/renderer/components/player-settings/player-settings.js index ffb6b3c9..724acf28 100644 --- a/src/renderer/components/player-settings/player-settings.js +++ b/src/renderer/components/player-settings/player-settings.js @@ -62,6 +62,10 @@ export default Vue.extend({ return this.$store.getters.getProxyVideos }, + defaultSkipInterval: function () { + return parseInt(this.$store.getters.getDefaultSkipInterval) + }, + defaultInterval: function () { return parseInt(this.$store.getters.getDefaultInterval) }, @@ -127,6 +131,7 @@ export default Vue.extend({ 'updateForceLocalBackendForLegacy', 'updateProxyVideos', 'updateDefaultTheatreMode', + 'updateDefaultSkipInterval', 'updateDefaultInterval', 'updateDefaultVolume', 'updateDefaultPlayback', diff --git a/src/renderer/components/player-settings/player-settings.vue b/src/renderer/components/player-settings/player-settings.vue index e3eb108f..661b5a3d 100644 --- a/src/renderer/components/player-settings/player-settings.vue +++ b/src/renderer/components/player-settings/player-settings.vue @@ -73,6 +73,15 @@ +