mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-12 18:29:57 -05:00
feat: add lightspeed.tv support
This commit is contained in:
parent
744afe2f6a
commit
97ab6c075d
2 changed files with 28 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue