From 5bcd33890d0909f7ebd4140d9204688f6e953566 Mon Sep 17 00:00:00 2001 From: Shiba <44804845+DeepDoge@users.noreply.github.com> Date: Mon, 10 Jan 2022 00:39:28 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=98=20made=20video=20pause=20on=20all?= =?UTF-8?q?=20redirects=20not=20only=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/ytContent.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/scripts/ytContent.tsx b/src/scripts/ytContent.tsx index 8650a2c..12cdb2a 100644 --- a/src/scripts/ytContent.tsx +++ b/src/scripts/ytContent.tsx @@ -61,12 +61,13 @@ async function redirectTo({ lbryPathname, platfrom, time }: Target) if (time) url.searchParams.set('t', time.toFixed(0)) + findVideoElement().then((videoElement) => { + videoElement.addEventListener('play', () => videoElement.pause(), { once: true }) + videoElement.pause() + }) + if (platfrom === targetPlatformSettings.app) { - findVideoElement().then((videoElement) => { - videoElement.addEventListener('play', () => videoElement.pause(), { once: true }) - videoElement.pause() - }) if (document.hidden) await new Promise((resolve) => document.addEventListener('visibilitychange', resolve, { once: true })) open(url, '_blank') if (window.history.length === 1) window.close();