mirror of
https://github.com/LBRYFoundation/Watch-on-LBRY.git
synced 2025-08-23 17:47:26 +00:00
🍙 bugfix redirect to lbryapp
This commit is contained in:
parent
5396936586
commit
d32958852a
1 changed files with 2 additions and 2 deletions
|
@ -63,11 +63,12 @@ async function redirectTo({ lbryPathname, platfrom, time }: Target)
|
||||||
|
|
||||||
if (platfrom === targetPlatformSettings.app)
|
if (platfrom === targetPlatformSettings.app)
|
||||||
{
|
{
|
||||||
open(url, '_blank')
|
|
||||||
findVideoElement().then((videoElement) => {
|
findVideoElement().then((videoElement) => {
|
||||||
videoElement.addEventListener('play', () => videoElement.pause(), { once: true })
|
videoElement.addEventListener('play', () => videoElement.pause(), { once: true })
|
||||||
videoElement.pause()
|
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();
|
if (window.history.length === 1) window.close();
|
||||||
else window.history.back()
|
else window.history.back()
|
||||||
}
|
}
|
||||||
|
@ -141,7 +142,6 @@ window.addEventListener('load', async () =>
|
||||||
|
|
||||||
async function updateByURL(url: URL)
|
async function updateByURL(url: URL)
|
||||||
{
|
{
|
||||||
console.log(url)
|
|
||||||
if (url.pathname !== '/watch') return
|
if (url.pathname !== '/watch') return
|
||||||
|
|
||||||
const videoId = url.searchParams.get('v')
|
const videoId = url.searchParams.get('v')
|
||||||
|
|
Loading…
Add table
Reference in a new issue