mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-26 23:42:11 -05:00
fix: append youtube timestamp to embed url if provided by january
This commit is contained in:
parent
4787a2166f
commit
64f1cc5e4a
1 changed files with 9 additions and 2 deletions
|
@ -18,15 +18,22 @@ export default function EmbedMedia({ embed, width, height }: Props) {
|
|||
const client = useClient();
|
||||
|
||||
switch (embed.special?.type) {
|
||||
case "YouTube":
|
||||
case "YouTube": {
|
||||
let timestamp = "";
|
||||
|
||||
if (embed.special.timestamp) {
|
||||
timestamp = `&start=${embed.special.timestamp}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<iframe
|
||||
loading="lazy"
|
||||
src={`https://www.youtube-nocookie.com/embed/${embed.special.id}?modestbranding=1`}
|
||||
src={`https://www.youtube-nocookie.com/embed/${embed.special.id}?modestbranding=1${timestamp}`}
|
||||
allowFullScreen
|
||||
style={{ height }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
case "Twitch":
|
||||
return (
|
||||
<iframe
|
||||
|
|
Loading…
Reference in a new issue