Commit a67f9a9b authored by jun's avatar jun
Browse files

Merge branch 'MDL-62872-master' of git://github.com/rezaies/moodle

parents b1869131 7dfa238c
......@@ -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,
......
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment