From 7cba11f90c359a96b64888866f37830069eabe59 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Mon, 24 Oct 2016 18:25:57 -0400 Subject: [PATCH] add video upload support --- client/modules/IDE/components/FileUploader.js | 4 +++- client/modules/IDE/components/PreviewFrame.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/components/FileUploader.js b/client/modules/IDE/components/FileUploader.js index 20ff6f4c..3100c978 100644 --- a/client/modules/IDE/components/FileUploader.js +++ b/client/modules/IDE/components/FileUploader.js @@ -24,7 +24,9 @@ class FileUploader extends React.Component { thumbnailWidth: 200, thumbnailHeight: 200, // TODO what is a good list of MIME types???? - acceptedFiles: 'image/*,audio/*,text/javascript,text/html,text/css,application/json,application/x-font-ttf,application/x-font-truetype,text/plain,text/csv,.obj', + acceptedFiles: `image/*,audio/*,text/javascript,text/html,text/css, + application/json,application/x-font-ttf,application/x-font-truetype, + text/plain,text/csv,.obj,video/webm,video/ogg,video/quicktime,video/mp4`, dictDefaultMessage: 'Drop files here to upload or click to use the file browser', accept: this.props.dropzoneAcceptCallback, sending: this.props.dropzoneSendingCallback, diff --git a/client/modules/IDE/components/PreviewFrame.js b/client/modules/IDE/components/PreviewFrame.js index d79baa89..d6f6b8e5 100644 --- a/client/modules/IDE/components/PreviewFrame.js +++ b/client/modules/IDE/components/PreviewFrame.js @@ -174,7 +174,7 @@ class PreviewFrame extends React.Component { this.props.jsFiles.forEach(jsFile => { const newJSFile = { ...jsFile }; let jsFileStrings = newJSFile.content.match(/(['"])((\\\1|.)*?)\1/gm); - const jsFileRegex = /^('|")(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj)('|")$/i; + const jsFileRegex = /^('|")(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov)('|")$/i; jsFileStrings = jsFileStrings || []; jsFileStrings.forEach(jsFileString => { if (jsFileString.match(jsFileRegex)) {