mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 18:15:28 +00:00
feat: add lightspeed.tv support
This commit is contained in:
@@ -68,7 +68,8 @@ export default function Embed({ embed }: Props) {
|
|||||||
mh = embed.video?.height ?? 720;
|
mh = embed.video?.height ?? 720;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "Twitch": {
|
case "Twitch":
|
||||||
|
case "Lightspeed": {
|
||||||
mw = 1280;
|
mw = 1280;
|
||||||
mh = 720;
|
mh = 720;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -47,6 +47,17 @@ export default function EmbedMedia({ embed, width, height }: Props) {
|
|||||||
style={{ height }}
|
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":
|
case "Spotify":
|
||||||
return (
|
return (
|
||||||
<iframe
|
<iframe
|
||||||
@@ -83,7 +94,21 @@ export default function EmbedMedia({ embed, width, height }: Props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
default: {
|
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;
|
const url = embed.image.url;
|
||||||
return (
|
return (
|
||||||
<img
|
<img
|
||||||
|
|||||||
Reference in New Issue
Block a user