feat: play downloads

This commit is contained in:
Adrian Castro
2024-03-21 14:14:30 +01:00
parent 13143a2664
commit 21b574ee87
8 changed files with 79 additions and 23 deletions

View File

@@ -9,6 +9,7 @@ import { usePlayerStore } from "~/stores/player/store";
export default function VideoPlayerWrapper() {
const playerStatus = usePlayerStore((state) => state.interface.playerStatus);
const asset = usePlayerStore((state) => state.asset);
const { presentFullscreenPlayer } = usePlayer();
const router = useRouter();
@@ -21,8 +22,15 @@ export default function VideoPlayerWrapper() {
void presentFullscreenPlayer();
if (playerStatus === PlayerStatus.SCRAPING)
return <ScraperProcess data={data} />;
if (asset) {
return <VideoPlayer />;
}
if (playerStatus === PlayerStatus.READY) return <VideoPlayer />;
if (playerStatus === PlayerStatus.SCRAPING) {
return <ScraperProcess data={data} />;
}
if (playerStatus === PlayerStatus.READY) {
return <VideoPlayer />;
}
}