2023-09-30 20:57:00 +02:00
|
|
|
import { MWStreamType } from "@/backend/helpers/streams";
|
2023-07-23 15:00:08 +02:00
|
|
|
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";
|
2023-07-23 15:00:08 +02:00
|
|
|
|
|
|
|
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",
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-07-23 15:00:08 +02:00
|
|
|
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}
|
2023-07-23 15:00:08 +02:00
|
|
|
</Player.Container>
|
|
|
|
);
|
|
|
|
}
|