diff --git a/src/_oldvideo/components/actions/CaptionRendererAction.tsx b/src/_oldvideo/components/actions/CaptionRendererAction.tsx index 8858ee28..fd3cc4e9 100644 --- a/src/_oldvideo/components/actions/CaptionRendererAction.tsx +++ b/src/_oldvideo/components/actions/CaptionRendererAction.tsx @@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef } from "react"; import { useAsync } from "react-use"; import { ContentCaption } from "subsrt-ts/dist/types/handler"; +import { getPlayerState } from "@/_oldvideo/state/cache"; import { parseSubtitles, sanitize } from "@/backend/helpers/captions"; import { Transition } from "@/components/Transition"; import { useSettings } from "@/state/settings"; @@ -52,6 +53,7 @@ export function CaptionRendererAction({ const videoTime = useProgress(descriptor).time; const { captionSettings, setCaptionDelay } = useSettings(); const captions = useRef([]); + const isCasting = getPlayerState(descriptor).casting.isCasting; const captionSetRef = useRef<(delay: number) => void>(setCaptionDelay); useEffect(() => { @@ -96,6 +98,7 @@ export function CaptionRendererAction({ }, [] ); + if (isCasting) return null; if (!captions.current.length) return null; const visibileCaptions = captions.current.filter(({ start, end }) => isVisible(start, end, captionSettings.delay, videoTime) diff --git a/src/_oldvideo/components/actions/ProgressAction.tsx b/src/_oldvideo/components/actions/ProgressAction.tsx index 0eeeb403..1b0b7e40 100644 --- a/src/_oldvideo/components/actions/ProgressAction.tsx +++ b/src/_oldvideo/components/actions/ProgressAction.tsx @@ -22,6 +22,7 @@ export function ProgressAction() { const controlRef = useRef(controls); const [hoverPosition, setHoverPosition] = useState(0); const [isThumbnailVisible, setIsThumbnailVisible] = useState(false); + const isCasting = getPlayerState(descriptor).casting.isCasting; const onMouseOver = useCallback((e: MouseActivity) => { setHoverPosition(e.clientX); setIsThumbnailVisible(true); @@ -106,7 +107,7 @@ export function ProgressAction() { - {isThumbnailVisible ? ( + {isThumbnailVisible && !isCasting ? ( console.log("Captions cleared"), + (error) => console.log(error) + ); + updateSource(descriptor, state); } },