From 5ceda9fd62dde1a2215f538b9c93e557cb019e18 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 6 May 2021 23:00:02 +0530 Subject: [PATCH] Add auto play for videos as a preference. --- src/components/Player.vue | 305 ++++++++++++++++----------------- src/components/Preferences.vue | 10 ++ 2 files changed, 159 insertions(+), 156 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 69034c9c..6f3c4a68 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -1,14 +1,9 @@ diff --git a/src/components/Preferences.vue b/src/components/Preferences.vue index cf04fbf9..220daf2c 100644 --- a/src/components/Preferences.vue +++ b/src/components/Preferences.vue @@ -30,6 +30,10 @@ Skip Music: Non-Music Section
+
+ Autoplay Video +
+

Instances List

@@ -75,6 +79,7 @@ export default { skipInteraction: true, skipSelfPromo: true, skipMusicOffTopic: true, + autoPlayVideo: true, }; }, mounted() { @@ -133,6 +138,9 @@ export default { } }); } + + this.autoPlayVideo = + localStorage.getItem("playerAutoPlay") === null || localStorage.getItem("playerAutoPlay") === "true"; } }, methods: { @@ -149,6 +157,8 @@ export default { if (this.skipSelfPromo) sponsorSelected.push("selfpromo"); if (this.skipMusicOffTopic) sponsorSelected.push("music_offtopic"); localStorage.setItem("selectedSkip", sponsorSelected); + + localStorage.setItem("playerAutoPlay", this.autoPlayVideo); } }, sslScore(url) {