fix youtube embeds

This commit is contained in:
hzrd149
2023-10-16 15:26:51 -05:00
parent 4efbc483a5
commit 474befc20b

View File

@@ -34,14 +34,13 @@ export function renderYoutubeUrl(match: URL) {
embedUrl.searchParams.set("list", listId); embedUrl.searchParams.set("list", listId);
return ( return (
<AspectRatio ratio={560 / 315} maxWidth="40rem"> <AspectRatio ratio={560 / 315} maxWidth="40rem" zIndex={1} position="relative">
<iframe <iframe
src={embedUrl.toString()} src={embedUrl.toString()}
title="YouTube video player" title="YouTube video player"
frameBorder="0" frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen"
width="100%" width="100%"
style={{ zIndex: 1, position: "relative" }}
></iframe> ></iframe>
</AspectRatio> </AspectRatio>
); );
@@ -52,14 +51,13 @@ export function renderYoutubeUrl(match: URL) {
const embedUrl = new URL(`/embed/${videoId}`, youtubeRedirect || "https://www.youtube-nocookie.com"); const embedUrl = new URL(`/embed/${videoId}`, youtubeRedirect || "https://www.youtube-nocookie.com");
return ( return (
<AspectRatio ratio={16 / 10} maxWidth="40rem"> <AspectRatio ratio={16 / 10} maxWidth="40rem" zIndex={1} position="relative">
<iframe <iframe
src={embedUrl.toString()} src={embedUrl.toString()}
title="YouTube video player" title="YouTube video player"
frameBorder="0" frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen"
width="100%" width="100%"
style={{ zIndex: 1, position: "relative" }}
></iframe> ></iframe>
</AspectRatio> </AspectRatio>
); );