mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-62872 atto_recordrtc: max_filesize detection fix
This commit is contained in:
parent
ec819146cc
commit
7dfa238c08
9 changed files with 14 additions and 19 deletions
|
@ -34,8 +34,6 @@ defined('MOODLE_INTERNAL') || die();
|
|||
* @param stdClass $fpoptions - unused.
|
||||
*/
|
||||
function atto_recordrtc_params_for_js($elementid, $options, $fpoptions) {
|
||||
global $CFG;
|
||||
|
||||
$context = $options['context'];
|
||||
if (!$context) {
|
||||
$context = context_system::instance();
|
||||
|
@ -62,7 +60,10 @@ function atto_recordrtc_params_for_js($elementid, $options, $fpoptions) {
|
|||
$allowedtypes = '';
|
||||
}
|
||||
|
||||
$maxrecsize = ini_get('upload_max_filesize');
|
||||
$maxrecsize = get_max_upload_file_size();
|
||||
if (!empty($options['maxbytes'])) {
|
||||
$maxrecsize = min($maxrecsize, $options['maxbytes']);
|
||||
}
|
||||
$audiortcicon = 'i/audiortc';
|
||||
$videortcicon = 'i/videortc';
|
||||
$params = array('contextid' => $context->id,
|
||||
|
|
|
@ -346,7 +346,7 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
|
|||
},
|
||||
|
||||
/**
|
||||
* Maximum upload size set on server, in MB.
|
||||
* Maximum upload size set on server, in bytes.
|
||||
*
|
||||
* @attribute maxrecsize
|
||||
* @type String
|
||||
|
|
|
@ -346,7 +346,7 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
|
|||
},
|
||||
|
||||
/**
|
||||
* Maximum upload size set on server, in MB.
|
||||
* Maximum upload size set on server, in bytes.
|
||||
*
|
||||
* @attribute maxrecsize
|
||||
* @type String
|
||||
|
|
|
@ -543,8 +543,7 @@ M.atto_recordrtc.audiomodule = {
|
|||
cm.startStopBtn = Y.one('button#start-stop');
|
||||
cm.uploadBtn = Y.one('button#upload');
|
||||
cm.recType = 'audio';
|
||||
// Extract the numbers from the string, and convert to bytes.
|
||||
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
|
||||
cm.maxUploadSize = scope.get('maxrecsize');
|
||||
|
||||
// Show alert and close plugin if WebRTC is not supported.
|
||||
ccm.check_has_gum();
|
||||
|
@ -692,8 +691,7 @@ M.atto_recordrtc.videomodule = {
|
|||
cm.startStopBtn = Y.one('button#start-stop');
|
||||
cm.uploadBtn = Y.one('button#upload');
|
||||
cm.recType = 'video';
|
||||
// Extract the numbers from the string, and convert to bytes.
|
||||
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
|
||||
cm.maxUploadSize = scope.get('maxrecsize');
|
||||
|
||||
// Show alert and close plugin if WebRTC is not supported.
|
||||
ccm.check_has_gum();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -543,8 +543,7 @@ M.atto_recordrtc.audiomodule = {
|
|||
cm.startStopBtn = Y.one('button#start-stop');
|
||||
cm.uploadBtn = Y.one('button#upload');
|
||||
cm.recType = 'audio';
|
||||
// Extract the numbers from the string, and convert to bytes.
|
||||
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
|
||||
cm.maxUploadSize = scope.get('maxrecsize');
|
||||
|
||||
// Show alert and close plugin if WebRTC is not supported.
|
||||
ccm.check_has_gum();
|
||||
|
@ -692,8 +691,7 @@ M.atto_recordrtc.videomodule = {
|
|||
cm.startStopBtn = Y.one('button#start-stop');
|
||||
cm.uploadBtn = Y.one('button#upload');
|
||||
cm.recType = 'video';
|
||||
// Extract the numbers from the string, and convert to bytes.
|
||||
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
|
||||
cm.maxUploadSize = scope.get('maxrecsize');
|
||||
|
||||
// Show alert and close plugin if WebRTC is not supported.
|
||||
ccm.check_has_gum();
|
||||
|
|
|
@ -344,7 +344,7 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
|
|||
},
|
||||
|
||||
/**
|
||||
* Maximum upload size set on server, in MB.
|
||||
* Maximum upload size set on server, in bytes.
|
||||
*
|
||||
* @attribute maxrecsize
|
||||
* @type String
|
||||
|
|
|
@ -49,8 +49,7 @@ M.atto_recordrtc.audiomodule = {
|
|||
cm.startStopBtn = Y.one('button#start-stop');
|
||||
cm.uploadBtn = Y.one('button#upload');
|
||||
cm.recType = 'audio';
|
||||
// Extract the numbers from the string, and convert to bytes.
|
||||
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
|
||||
cm.maxUploadSize = scope.get('maxrecsize');
|
||||
|
||||
// Show alert and close plugin if WebRTC is not supported.
|
||||
ccm.check_has_gum();
|
||||
|
|
|
@ -49,8 +49,7 @@ M.atto_recordrtc.videomodule = {
|
|||
cm.startStopBtn = Y.one('button#start-stop');
|
||||
cm.uploadBtn = Y.one('button#upload');
|
||||
cm.recType = 'video';
|
||||
// Extract the numbers from the string, and convert to bytes.
|
||||
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
|
||||
cm.maxUploadSize = scope.get('maxrecsize');
|
||||
|
||||
// Show alert and close plugin if WebRTC is not supported.
|
||||
ccm.check_has_gum();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue