Skip to content

Commit

Permalink
Detect video file by URL extension
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Jan 25, 2025
1 parent f02535c commit e97826b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/post/post-attachments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const supportedVideoTypes = Object.entries(videoTypes)
video = null;

const looksLikeAVideoFile = (attachment) => {
if (attachment.inProgress) {
return false;
}
if (attachment.url.endsWith('.mp4')) {
return true;
}
const lowercaseFileName = attachment.fileName.toLowerCase();

for (const extension of supportedVideoTypes) {
Expand Down

0 comments on commit e97826b

Please sign in to comment.