movie-web/src/pages/PlayerView.tsx

31 lines
792 B
TypeScript
Raw Normal View History

2023-09-30 20:57:00 +02:00
import { MWStreamType } from "@/backend/helpers/streams";
import { Player } from "@/components/player";
2023-09-30 20:57:00 +02:00
import { usePlayer } from "@/components/player/hooks/usePlayer";
import { playerStatus } from "@/stores/player/slices/source";
export function PlayerView() {
2023-09-30 20:57:00 +02:00
const { status, playMedia } = usePlayer();
function scrape() {
playMedia({
type: MWStreamType.MP4,
url: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
});
}
return (
<Player.Container>
<Player.Pause />
2023-09-30 20:57:00 +02:00
{status === playerStatus.IDLE ? (
<div>
<p>Its now scraping</p>
<button type="button" onClick={scrape}>
Finish scraping
</button>
</div>
) : null}
</Player.Container>
);
}