assume window is visible with previewthumbnailplayer

This commit is contained in:
Josh Hawkins 2024-05-15 10:43:16 -05:00
parent 1ece0e7021
commit 028fccec8a

View File

@ -311,21 +311,6 @@ function PreviewContent({
isPlayingBack, isPlayingBack,
onTimeUpdate, onTimeUpdate,
}: PreviewContentProps) { }: PreviewContentProps) {
// visibility
const [windowVisible, setWindowVisible] = useState(true);
const visibilityListener = useCallback(() => {
setWindowVisible(document.visibilityState == "visible");
}, []);
useEffect(() => {
addEventListener("visibilitychange", visibilityListener);
return () => {
removeEventListener("visibilitychange", visibilityListener);
};
}, [visibilityListener]);
// preview // preview
if (relevantPreview) { if (relevantPreview) {
@ -338,7 +323,7 @@ function PreviewContent({
setIgnoreClick={setIgnoreClick} setIgnoreClick={setIgnoreClick}
isPlayingBack={isPlayingBack} isPlayingBack={isPlayingBack}
onTimeUpdate={onTimeUpdate} onTimeUpdate={onTimeUpdate}
windowVisible={windowVisible} windowVisible={true}
/> />
); );
} else if (isCurrentHour(review.start_time)) { } else if (isCurrentHour(review.start_time)) {
@ -350,7 +335,7 @@ function PreviewContent({
setIgnoreClick={setIgnoreClick} setIgnoreClick={setIgnoreClick}
isPlayingBack={isPlayingBack} isPlayingBack={isPlayingBack}
onTimeUpdate={onTimeUpdate} onTimeUpdate={onTimeUpdate}
windowVisible={windowVisible} windowVisible={true}
/> />
); );
} }