修复无法显示mp4以外的文件的BUG
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user