From 5f1818ee91c19647468dca26656bcc6f92884e5e Mon Sep 17 00:00:00 2001
From: Luca Hohmann <34301369+GilgusMaximus@users.noreply.github.com>
Date: Sat, 29 May 2021 20:35:28 +0200
Subject: [PATCH] Setting to enable and disable display of video play button
(#1370)
* Added setting to toggle play button in video player
* Fixed wrong way around boolean check
* Fixed setting not loading on startup
---
.../ft-video-player/ft-video-player.js | 8 ++++++-
.../player-settings/player-settings.js | 7 +++++-
.../player-settings/player-settings.vue | 6 +++++
src/renderer/store/modules/settings.js | 22 +++++++++++++++++--
static/locales/en-US.yaml | 1 +
5 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/src/renderer/components/ft-video-player/ft-video-player.js b/src/renderer/components/ft-video-player/ft-video-player.js
index 5b30085a..9b692e3e 100644
--- a/src/renderer/components/ft-video-player/ft-video-player.js
+++ b/src/renderer/components/ft-video-player/ft-video-player.js
@@ -165,6 +165,10 @@ export default Vue.extend({
sponsorBlockShowSkippedToast: function () {
return this.$store.getters.getSponsorBlockShowSkippedToast
+ },
+
+ displayVideoPlayButton: function() {
+ return this.$store.getters.getDisplayVideoPlayButton
}
},
mounted: function () {
@@ -223,7 +227,9 @@ export default Vue.extend({
this.player.playbackRate(this.defaultPlayback)
// Remove big play button
// https://github.com/videojs/video.js/blob/v7.12.1/docs/guides/components.md#basic-example
- this.player.removeChild('BigPlayButton')
+ if (!this.displayVideoPlayButton) {
+ this.player.removeChild('BigPlayButton')
+ }
if (this.storyboardSrc !== '') {
this.player.vttThumbnails({
diff --git a/src/renderer/components/player-settings/player-settings.js b/src/renderer/components/player-settings/player-settings.js
index f03baf8d..5e49d074 100644
--- a/src/renderer/components/player-settings/player-settings.js
+++ b/src/renderer/components/player-settings/player-settings.js
@@ -94,6 +94,10 @@ export default Vue.extend({
return this.$store.getters.getVideoVolumeMouseScroll
},
+ displayVideoPlayButton: function () {
+ return this.$store.getters.getDisplayVideoPlayButton
+ },
+
formatNames: function () {
return [
this.$t('Settings.Player Settings.Default Video Format.Dash Formats'),
@@ -132,7 +136,8 @@ export default Vue.extend({
'updateDefaultPlayback',
'updateDefaultVideoFormat',
'updateDefaultQuality',
- 'updateVideoVolumeMouseScroll'
+ 'updateVideoVolumeMouseScroll',
+ 'updateDisplayVideoPlayButton'
])
}
})
diff --git a/src/renderer/components/player-settings/player-settings.vue b/src/renderer/components/player-settings/player-settings.vue
index 6594c1d7..05c1e00b 100644
--- a/src/renderer/components/player-settings/player-settings.vue
+++ b/src/renderer/components/player-settings/player-settings.vue
@@ -43,6 +43,12 @@
:default-value="videoVolumeMouseScroll"
@change="updateVideoVolumeMouseScroll"
/>
+