[Glitch] Fix embedded videos restarting when interacting with post (or other posts in the same feed)

Port 97353fde68 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion authored and Claire committed 2026-07-07 18:02:09 +02:00
1 parent edf4afb82f
commit 1d0dac709d
1 file changed
+18 -9
@@ -61,15 +61,24 @@ interface CardProps {
sensitive?: boolean;
}
const CardVideo: React.FC<{ card: CardShape }> = ({ card }) => (
<div
className='status-card__image status-card-video'
dangerouslySetInnerHTML={{
__html: handleIframeUrl(card.html, card.url, card.provider_name),
}}
style={{ aspectRatio: '16 / 9' }}
/>
);
const CardVideo: React.FC<{ card: CardShape }> = ({ card }) => {
const { html, url, provider_name } = card;
const iframeContent = useMemo(
() => ({
__html: handleIframeUrl(html, url, provider_name),
}),
[html, provider_name, url],
);
return (
<div
className='status-card__image status-card-video'
dangerouslySetInnerHTML={iframeContent}
style={{ aspectRatio: '16 / 9' }}
/>
);
};
const Card: React.FC<CardProps> = ({ card: rawCard, sensitive }) => {
const card: CardShape | null = useMemo(