mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: improve video file validation in VideoBlockComponent
This commit is contained in:
parent
b40ddde2c2
commit
016d2b3aed
1 changed files with 3 additions and 1 deletions
|
|
@ -235,7 +235,9 @@ function VideoBlockComponent(props: ExtendedNodeViewProps) {
|
|||
setIsDragging(false)
|
||||
|
||||
const file = e.dataTransfer.files[0]
|
||||
if (file && SUPPORTED_FILES.split(',').some(format => file.name.toLowerCase().endsWith(format.trim()))) {
|
||||
const fileExtension = file?.name.split('.').pop()?.toLowerCase()
|
||||
|
||||
if (file && fileExtension && ['mp4', 'webm'].includes(fileExtension)) {
|
||||
setVideo(file)
|
||||
setError(null)
|
||||
handleUpload(file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue