mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 00:20: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;
|
||||
break;
|
||||
}
|
||||
case "Twitch": {
|
||||
case "Twitch":
|
||||
case "Lightspeed": {
|
||||
mw = 1280;
|
||||
mh = 720;
|
||||
break;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue