From 17cc10bab00c8d37813889c810649ac60b1c13bd Mon Sep 17 00:00:00 2001 From: Filipe Medeiros Date: Thu, 7 Oct 2021 20:16:15 +0100 Subject: [PATCH] feat: adds the option to toggle listen mode when watching a video --- src/components/WatchVideo.vue | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 07e695a6..911566b2 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -53,6 +53,14 @@ > {{ $t("player.watch_on") }} LBRY + + +
@@ -122,7 +130,11 @@
- + {{ showRecs ? $t("actions.minimize_recommendations") : $t("actions.show_recommendations") }}
-
+
@@ -306,6 +318,16 @@ export default { }, }, computed: { + isListening(_this) { + const listenQueryParam = _this.$route.query.listen; + return listenQueryParam === "1"; + }, + toggleListenUrl(_this) { + const newUrl = _this.isListening + ? _this.$route.fullPath.replace(/(listen=1&?)|(&?listen=1)/, "") + : `${_this.$route.fullPath}&listen=1`; + return newUrl; + }, isEmbed(_this) { return String(_this.$route.path).indexOf("/embed/") == 0; },