Skip to content

Commit

Permalink
Add back 'Turn on Subtitles by Default'
Browse files Browse the repository at this point in the history
  • Loading branch information
kommunarr committed Dec 13, 2023
1 parent acf3db5 commit 6ee911c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
8 changes: 8 additions & 0 deletions src/renderer/components/ft-video-player/ft-video-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ export default defineComponent({
return playbackRates
},

defaultSubtitles: function () {
return this.$store.getters.getDefaultSubtitles
},

enableScreenshot: function () {
return this.$store.getters.getEnableScreenshot
},
Expand Down Expand Up @@ -1873,6 +1877,10 @@ export default defineComponent({
type: caption.type
}, true)
}

if (this.defaultSubtitles) {
this.toggleCaptions()
}
},

toggleFullWindow: function () {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/player-settings/player-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export default defineComponent({
return this.$store.getters.getPlayNextVideo
},

enableSubtitles: function () {
return this.$store.getters.getEnableSubtitles
defaultSubtitles: function () {
return this.$store.getters.getDefaultSubtitles
},

forceLocalBackendForLegacy: function () {
Expand Down Expand Up @@ -295,7 +295,7 @@ export default defineComponent({
'updateAutoplayVideos',
'updateAutoplayPlaylists',
'updatePlayNextVideo',
'updateEnableSubtitles',
'updateDefaultSubtitles',
'updateForceLocalBackendForLegacy',
'updateProxyVideos',
'updateDefaultTheatreMode',
Expand Down
13 changes: 6 additions & 7 deletions src/renderer/components/player-settings/player-settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
>
<div class="switchColumnGrid">
<div class="switchColumn">
<ft-toggle-switch
v-if="false"
label="Enable Subtitles by Default"
:compact="true"
:default-value="enableSubtitles"
@change="updateEnableSubtitles"
/>
<ft-toggle-switch
:label="$t('Settings.Player Settings.Force Local Backend for Legacy Formats')"
:compact="true"
Expand All @@ -26,6 +19,12 @@
:tooltip="$t('Tooltips.Player Settings.Proxy Videos Through Invidious')"
@change="updateProxyVideos"
/>
<ft-toggle-switch
:label="$t('Settings.Player Settings.Turn on Subtitles by Default')"
:compact="true"
:default-value="defaultSubtitles"
@change="updateDefaultSubtitles"
/>
<ft-toggle-switch
:label="$t('Settings.Player Settings.Enable Theatre Mode by Default')"
:compact="true"
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ const state = {
defaultProfile: MAIN_PROFILE_ID,
defaultQuality: '720',
defaultSkipInterval: 5,
defaultSubtitles: false,
defaultTheatreMode: false,
defaultVideoFormat: 'dash',
disableSmoothScrolling: false,
displayVideoPlayButton: true,
enableSearchSuggestions: true,
enableSubtitles: true,
enterFullscreenOnDisplayRotate: false,
externalLinkHandling: '',
externalPlayer: '',
Expand Down

0 comments on commit 6ee911c

Please sign in to comment.