Skip to content

Commit

Permalink
fix: video media can not play in video view
Browse files Browse the repository at this point in the history
close #1645
  • Loading branch information
hyoban committed Nov 19, 2024
1 parent 3b6a6ba commit 4cbf8a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/renderer/src/modules/entry-column/Items/video-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { AudioPlayer } from "~/atoms/player"
import { m } from "~/components/common/Motion"
import { RelativeTime } from "~/components/ui/datetime"
import { Media } from "~/components/ui/media"
import { usePreviewMedia } from "~/components/ui/media/hooks"
import type { ModalContentComponent } from "~/components/ui/modal"
import { FixedModalCloseButton } from "~/components/ui/modal/components/close"
import { PlainModal } from "~/components/ui/modal/stacked/custom-modal"
Expand All @@ -35,6 +36,7 @@ export function VideoItem({ entryId, entryPreview, translation }: UniversalItemP
[entry?.entries.url],
)
const modalStack = useModalStack()
const previewMedia = usePreviewMedia()

const ref = useRef<HTMLDivElement>(null)
const [hovered, setHovered] = useState(false)
Expand Down Expand Up @@ -74,6 +76,12 @@ export function VideoItem({ entryId, entryPreview, translation }: UniversalItemP
CustomModalComponent: PlainModal,
overlay: true,
})
} else {
const videoMediaList =
entry.entries.media?.filter((media) => media.type === "video") || []
if (videoMediaList.length > 0) {
previewMedia(videoMediaList)
}
}
}}
>
Expand Down

0 comments on commit 4cbf8a5

Please sign in to comment.