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.
This commit is contained in:
Jason 2021-08-05 20:17:01 +00:00 committed by GitHub
parent 0d0a2f4c26
commit 354a2151df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 8 deletions

View File

@ -143,6 +143,10 @@ export default Vue.extend({
return this.$store.getters.getDefaultPlayback return this.$store.getters.getDefaultPlayback
}, },
defaultSkipInterval: function () {
return this.$store.getters.getDefaultSkipInterval
},
defaultQuality: function () { defaultQuality: function () {
return parseInt(this.$store.getters.getDefaultQuality) return parseInt(this.$store.getters.getDefaultQuality)
}, },
@ -1209,9 +1213,9 @@ export default Vue.extend({
break break
case 74: case 74:
// J Key // J Key
// Rewind by 10 seconds // Rewind by 2x the time-skip interval (in seconds)
event.preventDefault() event.preventDefault()
this.changeDurationBySeconds(-10) this.changeDurationBySeconds(-this.defaultSkipInterval * 2)
break break
case 75: case 75:
// K Key // K Key
@ -1221,9 +1225,9 @@ export default Vue.extend({
break break
case 76: case 76:
// L Key // L Key
// Fast Forward by 10 seconds // Fast-Forward by 2x the time-skip interval (in seconds)
event.preventDefault() event.preventDefault()
this.changeDurationBySeconds(10) this.changeDurationBySeconds(this.defaultSkipInterval * 2)
break break
case 79: case 79:
// O Key // O Key
@ -1269,15 +1273,15 @@ export default Vue.extend({
break break
case 37: case 37:
// Left Arrow Key // Left Arrow Key
// Rewind by 5 seconds // Rewind by the time-skip interval (in seconds)
event.preventDefault() event.preventDefault()
this.changeDurationBySeconds(-5) this.changeDurationBySeconds(-this.defaultSkipInterval * 1)
break break
case 39: case 39:
// Right Arrow Key // Right Arrow Key
// Fast Forward by 5 seconds // Fast-Forward by the time-skip interval (in seconds)
event.preventDefault() event.preventDefault()
this.changeDurationBySeconds(5) this.changeDurationBySeconds(this.defaultSkipInterval * 1)
break break
case 49: case 49:
// 1 Key // 1 Key

View File

@ -62,6 +62,10 @@ export default Vue.extend({
return this.$store.getters.getProxyVideos return this.$store.getters.getProxyVideos
}, },
defaultSkipInterval: function () {
return parseInt(this.$store.getters.getDefaultSkipInterval)
},
defaultInterval: function () { defaultInterval: function () {
return parseInt(this.$store.getters.getDefaultInterval) return parseInt(this.$store.getters.getDefaultInterval)
}, },
@ -127,6 +131,7 @@ export default Vue.extend({
'updateForceLocalBackendForLegacy', 'updateForceLocalBackendForLegacy',
'updateProxyVideos', 'updateProxyVideos',
'updateDefaultTheatreMode', 'updateDefaultTheatreMode',
'updateDefaultSkipInterval',
'updateDefaultInterval', 'updateDefaultInterval',
'updateDefaultVolume', 'updateDefaultVolume',
'updateDefaultPlayback', 'updateDefaultPlayback',

View File

@ -73,6 +73,15 @@
</div> </div>
</div> </div>
<ft-flex-box> <ft-flex-box>
<ft-slider
:label="$t('Settings.Player Settings.Fast-Forward / Rewind Interval')"
:default-value="defaultSkipInterval"
:min-value="1"
:max-value="70"
:step="1"
value-extension="s"
@change="updateDefaultSkipInterval"
/>
<ft-slider <ft-slider
:label="$t('Settings.Player Settings.Next Video Interval')" :label="$t('Settings.Player Settings.Next Video Interval')"
:default-value="defaultInterval" :default-value="defaultInterval"

View File

@ -172,6 +172,7 @@ const state = {
defaultPlayback: 1, defaultPlayback: 1,
defaultProfile: 'allChannels', defaultProfile: 'allChannels',
defaultQuality: '720', defaultQuality: '720',
defaultSkipInterval: 5,
defaultTheatreMode: false, defaultTheatreMode: false,
defaultVideoFormat: 'dash', defaultVideoFormat: 'dash',
disableSmoothScrolling: false, disableSmoothScrolling: false,

View File

@ -181,6 +181,7 @@ Settings:
Scroll Volume Over Video Player: Scroll Volume Over Video Player Scroll Volume Over Video Player: Scroll Volume Over Video Player
Display Play Button In Video Player: Display Play Button In Video Player Display Play Button In Video Player: Display Play Button In Video Player
Next Video Interval: Next Video Interval Next Video Interval: Next Video Interval
Fast-Forward / Rewind Interval: Fast-Forward / Rewind Interval
Default Volume: Default Volume Default Volume: Default Volume
Default Playback Rate: Default Playback Rate Default Playback Rate: Default Playback Rate
Default Video Format: Default Video Format: