From 99d362de0c8de3c6ff5a865ecb8dd5b690140a47 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Feb 2020 08:51:28 +0100 Subject: Support wma and wav audio files --- .../videos/+video-edit/video-add-components/video-upload.component.ts | 4 +++- server/initializers/constants.ts | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts index aa3a85995..aa87f9581 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts @@ -293,6 +293,8 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy } private isAudioFile (filename: string) { - return filename.endsWith('.mp3') || filename.endsWith('.flac') || filename.endsWith('.ogg') + const extensions = [ '.mp3', '.flac', '.ogg', '.wma', '.wav' ] + + return extensions.some(e => filename.endsWith(e)) } } diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index e4b8a8eca..8f5c1df1d 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -403,6 +403,9 @@ const MIMETYPES = { 'audio/mp3': '.mp3', 'application/ogg': '.ogg', 'audio/ogg': '.ogg', + 'audio/x-ms-wma': '.wma', + 'audio/wav': '.wav', + 'audio/x-flac': '.flac', 'audio/flac': '.flac' }, EXT_MIMETYPE: null as { [ id: string ]: string } -- cgit v1.2.3 From 26469f9ed85f5e7d67ccecaa820f33e37179b76a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Feb 2020 09:02:18 +0100 Subject: Correctly fix octet stream fallback for video ext --- server/initializers/constants.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 8f5c1df1d..13e32b6d2 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -795,6 +795,8 @@ function buildVideoMimetypeExt () { 'video/x-matroska': '.mkv', 'video/avi': '.avi', 'video/x-m4v': '.m4v', + // Could be anything + 'application/octet-stream': null, 'video/m4v': '.m4v' }) } -- cgit v1.2.3