Skip to content

Commit 4cbf8a5

Browse files
committed
fix: video media can not play in video view
close #1645
1 parent 3b6a6ba commit 4cbf8a5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apps/renderer/src/modules/entry-column/Items/video-item.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { AudioPlayer } from "~/atoms/player"
99
import { m } from "~/components/common/Motion"
1010
import { RelativeTime } from "~/components/ui/datetime"
1111
import { Media } from "~/components/ui/media"
12+
import { usePreviewMedia } from "~/components/ui/media/hooks"
1213
import type { ModalContentComponent } from "~/components/ui/modal"
1314
import { FixedModalCloseButton } from "~/components/ui/modal/components/close"
1415
import { PlainModal } from "~/components/ui/modal/stacked/custom-modal"
@@ -35,6 +36,7 @@ export function VideoItem({ entryId, entryPreview, translation }: UniversalItemP
3536
[entry?.entries.url],
3637
)
3738
const modalStack = useModalStack()
39+
const previewMedia = usePreviewMedia()
3840

3941
const ref = useRef<HTMLDivElement>(null)
4042
const [hovered, setHovered] = useState(false)
@@ -74,6 +76,12 @@ export function VideoItem({ entryId, entryPreview, translation }: UniversalItemP
7476
CustomModalComponent: PlainModal,
7577
overlay: true,
7678
})
79+
} else {
80+
const videoMediaList =
81+
entry.entries.media?.filter((media) => media.type === "video") || []
82+
if (videoMediaList.length > 0) {
83+
previewMedia(videoMediaList)
84+
}
7785
}
7886
}}
7987
>

0 commit comments

Comments
 (0)