mirror of
https://github.com/LBRYFoundation/Watch-on-LBRY.git
synced 2025-08-23 17:47:26 +00:00
🍘 made video pause on all redirects not only app
This commit is contained in:
parent
d32958852a
commit
5bcd33890d
1 changed files with 5 additions and 4 deletions
|
@ -61,12 +61,13 @@ async function redirectTo({ lbryPathname, platfrom, time }: Target)
|
||||||
|
|
||||||
if (time) url.searchParams.set('t', time.toFixed(0))
|
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)
|
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 }))
|
if (document.hidden) await new Promise((resolve) => document.addEventListener('visibilitychange', resolve, { once: true }))
|
||||||
open(url, '_blank')
|
open(url, '_blank')
|
||||||
if (window.history.length === 1) window.close();
|
if (window.history.length === 1) window.close();
|
||||||
|
|
Loading…
Add table
Reference in a new issue