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
},
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

View File

@ -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',

View File

@ -73,6 +73,15 @@
</div>
</div>
<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
:label="$t('Settings.Player Settings.Next Video Interval')"
:default-value="defaultInterval"

View File

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

View File

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