From ed51c6d1e8c555d0b081026aa2fad76e286ee9aa Mon Sep 17 00:00:00 2001 From: vlOd2 <66838724+vlOd2@users.noreply.github.com> Date: Fri, 26 Dec 2025 23:25:34 +0200 Subject: [PATCH] remove subtitles testing from testview --- src/pages/developer/TestView.tsx | 75 +------------------------------- 1 file changed, 2 insertions(+), 73 deletions(-) diff --git a/src/pages/developer/TestView.tsx b/src/pages/developer/TestView.tsx index 83b7997e..590bd4aa 100644 --- a/src/pages/developer/TestView.tsx +++ b/src/pages/developer/TestView.tsx @@ -1,83 +1,12 @@ -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 ; }