diff --git a/packages/react/src/components/video/VideoCard.tsx b/packages/react/src/components/video/VideoCard.tsx
index 9bdde6484..b52602cc3 100644
--- a/packages/react/src/components/video/VideoCard.tsx
+++ b/packages/react/src/components/video/VideoCard.tsx
@@ -280,6 +280,7 @@ export function VideoCard({
>
{
- const videoPlaceholder: QueueVideo = {
+ const videoPlaceholder: QueueVideo = location.state.video ?? {
id: id!,
url: `https://youtu.be/${id}`,
channel_id: "",
@@ -76,6 +74,11 @@ export default function Watch() {
type: "vtuber",
},
};
+ videoPlaceholder.url =
+ location.state?.video?.link?.includes("twitch") ??
+ data?.link?.includes("twitch")
+ ? location.state.video?.link
+ : `https://youtu.be/${id}`;
setMiniPlayer(false);
setCurrentVideo(videoPlaceholder);
if (queue.length)
@@ -95,14 +98,25 @@ export default function Watch() {
if (isSuccess) {
setCurrentVideo({
...data,
- url: isTwitch ? data.link : `https://youtu.be/${id}`,
+ url:
+ location.state?.video?.link?.includes("twitch") ??
+ data?.link?.includes("twitch")
+ ? data.link
+ : `https://youtu.be/${id}`,
});
if (queue.length)
setQueue((q) =>
q.toSpliced(
q.findIndex((q) => q.id === id),
1,
- { ...data, url: isTwitch ? data.link : `https://youtu.be/${id}` },
+ {
+ ...data,
+ url:
+ location.state?.video?.link?.includes("twitch") ??
+ data?.link?.includes("twitch")
+ ? data.link
+ : `https://youtu.be/${id}`,
+ },
),
);
}
@@ -146,7 +160,7 @@ export default function Watch() {
)}
)}
- {data &&