Merge pull request #383 from matrix-org/matthew/fix-video-upload
fix upload for video or image files where sniffing failspull/21833/head
commit
ff2dd74429
|
@ -104,19 +104,25 @@ class ContentMessages {
|
|||
var def = q.defer();
|
||||
if (file.type.indexOf('image/') == 0) {
|
||||
content.msgtype = 'm.image';
|
||||
infoForImageFile(file).then(function (imageInfo) {
|
||||
infoForImageFile(file).then(imageInfo=>{
|
||||
extend(content.info, imageInfo);
|
||||
def.resolve();
|
||||
}, error=>{
|
||||
content.msgtype = 'm.file';
|
||||
def.resolve();
|
||||
});
|
||||
} else if (file.type.indexOf('audio/') == 0) {
|
||||
content.msgtype = 'm.audio';
|
||||
def.resolve();
|
||||
} else if (file.type.indexOf('video/') == 0) {
|
||||
content.msgtype = 'm.video';
|
||||
infoForVideoFile(file).then(function (videoInfo) {
|
||||
extend(content.info, videoInfo);
|
||||
def.resolve();
|
||||
});
|
||||
content.msgtype = 'm.video';
|
||||
infoForVideoFile(file).then(videoInfo=>{
|
||||
extend(content.info, videoInfo);
|
||||
def.resolve();
|
||||
}, error=>{
|
||||
content.msgtype = 'm.file';
|
||||
def.resolve();
|
||||
});
|
||||
} else {
|
||||
content.msgtype = 'm.file';
|
||||
def.resolve();
|
||||
|
|
Loading…
Reference in New Issue