Skip to content

Commit

Permalink
fix: video preview
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Sep 8, 2024
1 parent 2bd5b45 commit e38820c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/src/components/ui/media.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const VideoPreview: FC<{
const [isInitVideoPlayer, setIsInitVideoPlayer] = useState(!previewImageUrl)

const [videoRef, setVideoRef] = useState<VideoPlayerRef | null>(null)
const isPaused = videoRef?.getState().paused
const isPaused = videoRef ? videoRef?.getState().paused : true
const [forceUpdate] = useForceUpdate()
return (
<div
Expand All @@ -274,7 +274,7 @@ const VideoPreview: FC<{
nextFrame(forceUpdate)
}}
>
{isInitVideoPlayer ? (
{!isInitVideoPlayer ? (
<img
src={previewImageUrl}
className="size-full object-cover"
Expand Down

0 comments on commit e38820c

Please sign in to comment.