Skip to content

Commit

Permalink
Add setting to toggle Enter fullscreen on rotate (#2808)
Browse files Browse the repository at this point in the history
It defaults to `false`. This should prevent users with
multiple displays from running into issues when they
drag the window from a portrait display to a landscape
display too quickly.
  • Loading branch information
MarmadileManteater committed Nov 4, 2022
1 parent e5b765a commit f8ff0e1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/renderer/components/ft-video-player/ft-video-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ export default Vue.extend({
return this.$store.getters.getDisplayVideoPlayButton
},

enterFullscreenOnDisplayRotate: function() {
return this.$store.getters.getEnterFullscreenOnDisplayRotate
},

sponsorSkips: function () {
const sponsorCats = ['sponsor',
'selfpromo',
Expand Down Expand Up @@ -363,8 +367,8 @@ export default Vue.extend({
})
this.player.mobileUi({
fullscreen: {
enterOnRotate: true,
exitOnRotate: true,
enterOnRotate: this.enterFullscreenOnDisplayRotate,
exitOnRotate: this.enterFullscreenOnDisplayRotate,
lockOnRotate: false
},
// Without this flag, the mobile UI will only activate
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/components/player-settings/player-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ export default Vue.extend({
return this.$store.getters.getDisplayVideoPlayButton
},

enterFullscreenOnDisplayRotate: function () {
return this.$store.getters.getEnterFullscreenOnDisplayRotate
},

maxVideoPlaybackRate: function () {
return parseInt(this.$store.getters.getMaxVideoPlaybackRate)
},
Expand Down Expand Up @@ -270,6 +274,7 @@ export default Vue.extend({
'updateVideoVolumeMouseScroll',
'updateVideoPlaybackRateMouseScroll',
'updateDisplayVideoPlayButton',
'updateEnterFullscreenOnDisplayRotate',
'updateMaxVideoPlaybackRate',
'updateVideoPlaybackRateInterval',
'updateEnableScreenshot',
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/components/player-settings/player-settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
:default-value="displayVideoPlayButton"
@change="updateDisplayVideoPlayButton"
/>
<ft-toggle-switch
:label="$t('Settings.Player Settings.Enter Fullscreen on Display Rotate')"
:compact="true"
:default-value="enterFullscreenOnDisplayRotate"
@change="updateEnterFullscreenOnDisplayRotate"
/>
</div>
<div class="switchColumn">
<ft-toggle-switch
Expand Down
1 change: 1 addition & 0 deletions src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const state = {
displayVideoPlayButton: true,
enableSearchSuggestions: true,
enableSubtitles: true,
enterFullscreenOnDisplayRotate: false,
externalLinkHandling: '',
externalPlayer: '',
externalPlayerExecutable: '',
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ Settings:
Scroll Volume Over Video Player: Scroll Volume Over Video Player
Scroll Playback Rate Over Video Player: Scroll Playback Rate Over Video Player
Display Play Button In Video Player: Display Play Button In Video Player
Enter Fullscreen on Display Rotate: Enter Fullscreen on Display Rotate
Next Video Interval: Next Video Interval
Fast-Forward / Rewind Interval: Fast-Forward / Rewind Interval
Default Volume: Default Volume
Expand Down
1 change: 1 addition & 0 deletions static/locales/en_GB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ Settings:
Playlist Next Video Interval: Playlist Next Video Interval
Next Video Interval: Next video interval
Display Play Button In Video Player: Display play button in video player
Enter Fullscreen on Display Rotate: Enter fullscreen on display rotate
Fast-Forward / Rewind Interval: Fast-forward / rewind interval
Scroll Playback Rate Over Video Player: Scroll playback rate over video player
Video Playback Rate Interval: Video playback rate interval
Expand Down

0 comments on commit f8ff0e1

Please sign in to comment.