import { useCallback, useState } from "react"; import { Helmet } from "react-helmet"; import { MWStreamQuality, MWStreamType } from "@/backend/helpers/streams"; import { DetailedMeta } from "@/backend/metadata/getmeta"; import { MWMediaType } from "@/backend/metadata/types/mw"; import { Button } from "@/components/Button"; import { Dropdown } from "@/components/Dropdown"; import { Navigation } from "@/components/layout/Navigation"; import { ThinContainer } from "@/components/layout/ThinContainer"; import { MetaController } from "@/video/components/controllers/MetaController"; import { SourceController } from "@/video/components/controllers/SourceController"; import { VideoPlayer } from "@/video/components/VideoPlayer"; interface VideoData { streamUrl: string; type: MWStreamType; } const testData: VideoData = { streamUrl: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", type: MWStreamType.MP4, }; const testMeta: DetailedMeta = { imdbId: "", tmdbId: "", meta: { id: "hello-world", title: "Big Buck Bunny", type: MWMediaType.MOVIE, seasons: undefined, year: "2000", }, }; export default function VideoTesterView() { const [video, setVideo] = useState(null); const [videoType, setVideoType] = useState(MWStreamType.MP4); const [url, setUrl] = useState(""); const playVideo = useCallback( (streamUrl: string) => { setVideo({ streamUrl, type: videoType, }); }, [videoType] ); if (video) { return (
setVideo(null)}>
); } return (
setVideoType(a.id as MWStreamType)} />
setUrl(e.target.value)} />
); }