From b8ac67b7afd756e5abd2e0a626d8dd6cb3d87ec9 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Tue, 8 Jun 2021 02:05:45 +0530 Subject: [PATCH] Add back the Audio Only mode. --- src/components/Player.vue | 2 ++ src/components/Preferences.vue | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/components/Player.vue b/src/components/Player.vue index 56a38647..a8dcd9b0 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -105,6 +105,8 @@ export default { this.player = player; + if (localStorage && localStorage.getItem("audioOnly")) this.player.configure("manifest.disableVideo", true); + player.load("data:application/dash+xml;charset=utf-8;base64," + btoa(dash)).then(() => { this.video.subtitles.map(subtitle => { player.addTextTrackAsync( diff --git a/src/components/Preferences.vue b/src/components/Preferences.vue index 220daf2c..08a4642d 100644 --- a/src/components/Preferences.vue +++ b/src/components/Preferences.vue @@ -34,6 +34,10 @@ Autoplay Video
+
+ Audio Only +
+

Instances List

@@ -80,6 +84,7 @@ export default { skipSelfPromo: true, skipMusicOffTopic: true, autoPlayVideo: true, + audioOnly: false, }; }, mounted() { @@ -141,6 +146,7 @@ export default { this.autoPlayVideo = localStorage.getItem("playerAutoPlay") === null || localStorage.getItem("playerAutoPlay") === "true"; + this.audioOnly = localStorage.getItem("audioOnly") === "true"; } }, methods: { @@ -159,6 +165,7 @@ export default { localStorage.setItem("selectedSkip", sponsorSelected); localStorage.setItem("playerAutoPlay", this.autoPlayVideo); + localStorage.setItem("audioOnly", this.audioOnly); } }, sslScore(url) {