...
 
Commits (2)
......@@ -478,6 +478,11 @@ export class AttachmentService {
private checkFileType(file): Promise<any> {
return new Promise((resolve, reject) => {
if (file.type && file.type.indexOf('video/') === 0) {
const maxFileSize = window.Minds.max_video_file_size;
if (file.size > maxFileSize) {
throw new Error(`File exceeds ${maxFileSize / Math.pow(1000, 3)}GB maximum size. Please try compressing your file.`);
}
this.attachment.mime = 'video';
this.checkVideoDuration(file).then(duration => {
......
......@@ -124,6 +124,7 @@
"stripe_key" => Minds\Core\Config::_()->get('payments')['stripe']['public_key'],
"recaptchaKey" => Minds\Core\Config::_()->get('google')['recaptcha']['site_key'],
"max_video_length" => Minds\Core\Config::_()->get('max_video_length'),
"max_video_file_size" => Minds\Core\Config::_()->get('max_video_file_size'),
"features" => (object) (Minds\Core\Config::_()->get('features') ?: []),
"blockchain" => (object) Minds\Core\Di\Di::_()->get('Blockchain\Manager')->getPublicSettings(),
"sale" => Minds\Core\Config::_()->get('blockchain')['sale'],
......
......@@ -20,6 +20,7 @@ interface Minds {
stripe_key?: any;
recaptchaKey?: string;
max_video_length?: number;
max_video_file_size?: number;
features?: any;
blockchain?: any;
sale?: boolean | string;
......