Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting to turn on subtitles by default #4450

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
},

enableSubtitlesByDefault: function () {
return this.$store.getters.getEnableSubtitlesByDefault
},

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

if (this.enableSubtitlesByDefault) {
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
enableSubtitlesByDefault: function () {
return this.$store.getters.getEnableSubtitlesByDefault
},

forceLocalBackendForLegacy: function () {
Expand Down Expand Up @@ -295,7 +295,7 @@ export default defineComponent({
'updateAutoplayVideos',
'updateAutoplayPlaylists',
'updatePlayNextVideo',
'updateEnableSubtitles',
'updateEnableSubtitlesByDefault',
'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="enableSubtitlesByDefault"
@change="updateEnableSubtitlesByDefault"
/>
<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 @@ -184,7 +184,7 @@ const state = {
disableSmoothScrolling: false,
displayVideoPlayButton: true,
enableSearchSuggestions: true,
enableSubtitles: true,
enableSubtitlesByDefault: false,
enterFullscreenOnDisplayRotate: false,
externalLinkHandling: '',
externalPlayer: '',
Expand Down