From c2ff35769c8e8a430ac959ae40af91dd60e52357 Mon Sep 17 00:00:00 2001 From: Jovan Gerodetti Date: Sun, 28 Jun 2015 11:24:21 +0200 Subject: [PATCH] fix for #837 --- app/js/services.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/js/services.js b/app/js/services.js index 45263c2a..cac4af33 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -1583,12 +1583,12 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) } else if (['image/jpeg', 'image/png', 'image/bmp'].indexOf(file.type) >= 0) { attachType = 'photo'; apiFileName = 'photo.' + file.type.split('/')[1]; + } else if (file.type.substr(0, 6) == 'audio/' || ['video/ogg'].indexOf(file.type) >= 0) { + attachType = 'audio'; + apiFileName = 'audio.' + (file.type.split('/')[1] == 'ogg' ? 'ogg' : 'mp3'); } else if (file.type.substr(0, 6) == 'video/') { attachType = 'video'; apiFileName = 'video.mp4'; - } else if (file.type.substr(0, 6) == 'audio/') { - attachType = 'audio'; - apiFileName = 'audio.' + (file.type.split('/')[1] == 'ogg' ? 'ogg' : 'mp3'); } else { attachType = 'document'; apiFileName = 'document.' + file.type.split('/')[1];