🐛
This commit is contained in:
parent
71b6418dfa
commit
0a40f2d916
2 changed files with 17 additions and 12 deletions
|
|
@ -30,7 +30,8 @@ export default function YoutubeEmbeddedPlayer({
|
||||||
}
|
}
|
||||||
|
|
||||||
function initPlayer() {
|
function initPlayer() {
|
||||||
if (!videoId || !containerRef.current) return
|
try {
|
||||||
|
if (!videoId || !containerRef.current || !window.YT.Player) return
|
||||||
playerRef.current = new window.YT.Player(containerRef.current, {
|
playerRef.current = new window.YT.Player(containerRef.current, {
|
||||||
videoId: videoId,
|
videoId: videoId,
|
||||||
events: {
|
events: {
|
||||||
|
|
@ -43,6 +44,10 @@ export default function YoutubeEmbeddedPlayer({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Failed to initialize YouTube player:', error)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ export function getParentBech32Id(event?: Event) {
|
||||||
export function getRootETag(event?: Event) {
|
export function getRootETag(event?: Event) {
|
||||||
if (!event) return undefined
|
if (!event) return undefined
|
||||||
|
|
||||||
if (event.kind === ExtendedKind.COMMENT || ExtendedKind.VOICE_COMMENT) {
|
if (event.kind === ExtendedKind.COMMENT || event.kind === ExtendedKind.VOICE_COMMENT) {
|
||||||
return event.tags.find(tagNameEquals('E'))
|
return event.tags.find(tagNameEquals('E'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue