feat: add lightspeed.tv support

This commit is contained in:
Paul Makles 2022-05-19 13:37:24 +01:00
parent 744afe2f6a
commit 97ab6c075d
2 changed files with 28 additions and 2 deletions

View file

@ -68,7 +68,8 @@ export default function Embed({ embed }: Props) {
mh = embed.video?.height ?? 720;
break;
}
case "Twitch": {
case "Twitch":
case "Lightspeed": {
mw = 1280;
mh = 720;
break;

View file

@ -47,6 +47,17 @@ export default function EmbedMedia({ embed, width, height }: Props) {
style={{ height }}
/>
);
case "Lightspeed":
return (
<iframe
src={`https://next.lightspeed.tv/embed/${embed.special.id}`}
frameBorder="0"
allowFullScreen
scrolling="no"
loading="lazy"
style={{ height }}
/>
);
case "Spotify":
return (
<iframe
@ -83,7 +94,21 @@ export default function EmbedMedia({ embed, width, height }: Props) {
);
}
default: {
if (embed.image) {
if (embed.video) {
const url = embed.video.url;
return (
<video
loading="lazy"
className={styles.image}
style={{ width, height }}
src={client.proxyFile(url)}
loop={embed.special?.type === "GIF"}
controls={embed.special?.type !== "GIF"}
autoPlay={embed.special?.type === "GIF"}
muted={embed.special?.type === "GIF" ? true : undefined}
/>
);
} else if (embed.image) {
const url = embed.image.url;
return (
<img