diff --git a/src/pages/developer/TestView.tsx b/src/pages/developer/TestView.tsx index 9a6293fb..b257f463 100644 --- a/src/pages/developer/TestView.tsx +++ b/src/pages/developer/TestView.tsx @@ -1,83 +1,14 @@ -import { useCallback, useState } from "react"; +import { useState } from "react"; import { Button } from "@/components/buttons/Button"; -import { usePlayer } from "@/components/player/hooks/usePlayer"; -import { PlaybackErrorPart } from "@/pages/parts/player/PlaybackErrorPart"; -import { PlayerPart } from "@/pages/parts/player/PlayerPart"; -import { - CaptionListItem, - PlayerMeta, - playerStatus, -} from "@/stores/player/slices/source"; -import { SourceSliceSource } from "@/stores/player/utils/qualities"; - -const subtitlesTestMeta: PlayerMeta = { - type: "movie", - title: "Subtitles Test", - releaseYear: 2024, - tmdbId: "0", -}; - -const subtitlesTestSource: SourceSliceSource = { - type: "hls", - url: "http://localhost:8000/media/master.m3u8", -}; - -const subtitlesTestSubs: CaptionListItem[] = [ - { - id: "http://localhost:8000/subs/en.srt", - display: "English", - language: "en", - url: "http://localhost:8000/subs/en.srt", - needsProxy: false, - }, - { - id: "http://localhost:8000/subs/en-small.srt", - display: "English Small", - language: "en", - url: "http://localhost:8000/subs/en-small.srt", - needsProxy: false, - }, - { - id: "http://localhost:8000/subs/ro.srt", - display: "Romanian", - language: "ro", - url: "http://localhost:8000/subs/ro.srt", - needsProxy: false, - }, -]; // mostly empty view, add whatever you need export default function TestView() { - const player = usePlayer(); - const [showPlayer, setShowPlayer] = useState(false); const [shouldCrash, setShouldCrash] = useState(false); if (shouldCrash) { throw new Error("I crashed"); } - const subtitlesTest = useCallback(async () => { - setShowPlayer(true); - player.reset(); - await new Promise((r) => { - setTimeout(r, 100); - }); - player.setShouldStartFromBeginning(true); - player.setMeta(subtitlesTestMeta); - player.playMedia(subtitlesTestSource, subtitlesTestSubs, null); - }, [player]); - - return showPlayer ? ( - - {player && (player as any).status === playerStatus.PLAYBACK_ERROR ? ( - - ) : null} - - ) : ( - <> - - - - ); + return ; }