修复无法显示mp4以外的文件的BUG

This commit is contained in:
CN-JS-HuiBai
2026-04-02 17:25:52 +08:00
parent 1076727596
commit 364438b66d
2 changed files with 29 additions and 4 deletions

View File

@@ -40,8 +40,13 @@ app.get('/api/videos', async (req, res) => {
const response = await s3Client.send(command);
// Filter for common video formats
const videoExtensions = ['.mp4', '.avi', '.mov', '.mkv', '.webm', '.flv', '.wmv', '.m4v'];
// Filter for a broader set of common video formats
const videoExtensions = [
'.3gp', '.3g2', '.asf', '.avi', '.divx', '.flv', '.m2ts', '.m2v',
'.m4v', '.mkv', '.mov', '.mp4', '.mpeg', '.mpg', '.mts', '.mxf',
'.ogm', '.ogv', '.qt', '.rm', '.rmvb', '.ts', '.vob', '.vro',
'.webm', '.wmv'
];
const videos = (response.Contents || [])
.map(item => item.Key)
.filter(key => {