Prevent embeds from playing inline

This commit is contained in:
Lim Chee Aun 2024-03-02 18:53:35 +08:00
parent cef4e6373e
commit d8b0adfe97
2 changed files with 10 additions and 1 deletions

View file

@ -1609,6 +1609,11 @@ a.card:is(:hover, :focus):visited {
.card.video {
max-width: 320px;
max-height: 320px;
cursor: pointer;
lite\-youtube {
pointer-events: none;
}
}
.card.video iframe {
width: 100%;

View file

@ -2181,7 +2181,11 @@ function Card({ card, selfReferential, instance }) {
// Get ID from e.g. https://www.youtube.com/watch?v=[VIDEO_ID]
const videoID = url.match(/watch\?v=([^&]+)/)?.[1];
if (videoID) {
return <lite-youtube videoid={videoID} nocookie></lite-youtube>;
return (
<a class="card video" onClick={handleClick}>
<lite-youtube videoid={videoID} nocookie></lite-youtube>
</a>
);
}
}
// return (