MDL-60848 atto_recordrtc: removed 'oldermoodle' variable

This commit is contained in:
Mark Nelson
2018-04-09 16:15:24 +08:00
parent a8d022d814
commit 0174e72ba8
11 changed files with 36 additions and 118 deletions
@@ -36,9 +36,6 @@ defined('MOODLE_INTERNAL') || die();
function atto_recordrtc_params_for_js($elementid, $options, $fpoptions) {
global $CFG;
$moodleversion = intval($CFG->version, 10);
$moodle32 = 2016120500;
$context = $options['context'];
if (!$context) {
$context = context_system::instance();
@@ -59,7 +56,6 @@ function atto_recordrtc_params_for_js($elementid, $options, $fpoptions) {
'timelimit' => $timelimit,
'audiortcicon' => $audiortcicon,
'videortcicon' => $videortcicon,
'oldermoodle' => $moodleversion < $moodle32,
'maxrecsize' => $maxrecsize
);
@@ -216,12 +216,11 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
*/
_createContent: function(type) {
var isAudio = (type === 'audio'),
bsRow = this.get('oldermoodle') ? 'row-fluid' : 'row',
bsCol = this.get('oldermoodle') ? 'span' : 'col-xs-',
bsAlWarn = this.get('oldermoodle') ? '' : 'alert-warning',
bsAlDang = this.get('oldermoodle') ? 'alert-error' : 'alert-danger',
bsSsBtn = this.get('oldermoodle') ? 'btn btn-large btn-danger btn-block'
: 'btn btn-lg btn-outline-danger btn-block';
bsRow = 'row',
bsCol = 'col-xs-',
bsAlWarn = 'alert-warning',
bsAlDang = 'alert-danger',
bsSsBtn = 'btn btn-lg btn-outline-danger btn-block';
var bodyContent = Y.Handlebars.compile(TEMPLATE)({
PLUGINNAME: PLUGINNAME,
@@ -351,16 +350,6 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
value: null
},
/**
* True if Moodle is version < 3.2.
*
* @attribute oldermoodle
* @type Boolean
*/
oldermoodle: {
value: null
},
/**
* Maximum upload size set on server, in MB.
*
@@ -1 +1 @@
YUI.add("moodle-atto_recordrtc-button",function(e,t){var n="atto_recordrtc",r='<div class="{{PLUGINNAME}} container-fluid"><div class="{{bs_row}} hide"><div class="{{bs_col}}12"><div id="alert-warning" class="alert {{bs_al_warn}}"><strong>{{browseralert_title}}</strong> {{browseralert}}</div></div></div><div class="{{bs_row}} hide"><div class="{{bs_col}}12"><div id="alert-danger" class="alert {{bs_al_dang}}"><strong>{{insecurealert_title}}</strong> {{insecurealert}}</div></div></div><div class="{{bs_row}} hide">{{#if isAudio}}<div class="{{bs_col}}1"></div><div class="{{bs_col}}10"><audio id="player"></audio></div><div class="{{bs_col}}1"></div>{{else}}<div class="{{bs_col}}12"><video id="player"></video></div>{{/if}}</div><div class="{{bs_row}}"><div class="{{bs_col}}1"></div><div class="{{bs_col}}10"><button id="start-stop" class="{{bs_ss_btn}}">{{startrecording}}</button></div><div class="{{bs_col}}1"></div></div><div class="{{bs_row}} hide"><div class="{{bs_col}}3"></div><div class="{{bs_col}}6"><button id="upload" class="btn btn-primary btn-block">{{attachrecording}}</button></div><div class="{{bs_col}}3"></div></div></div>';e.namespace("M.atto_recordrtc").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_lang:"en",initializer:function(){if(this.get("host").canShowFilepicker("media")){var e=this.get("allowedtypes");(e==="both"||e==="audio")&&this._addButton("audio",this._audio),(e==="both"||e==="video")&&this._addButton("video",this._video);var t=this.getDialogue({width:1e3,focusAfterHide:null});t.after("visibleChange",function(){var e=!t.get("visible"),n=M.atto_recordrtc.commonmodule;e&&(window.clearInterval(n.countdownTicker),n.mediaRecorder&&n.mediaRecorder.state!=="inactive"&&n.mediaRecorder.stop(),n.stream&&n.stream.getTracks().forEach(function(e){e.readyState!=="ended"&&e.stop()}))}),t.on("click",function(){this.centered()}),window.require(["atto_recordrtc/adapter"],function(e){window.adapter=e})}},_addButton:function(e,t){this.addButton({buttonName:e,icon:this.get(e+"rtcicon"),iconComponent:n,callback:t,title:e+"rtc",tags:e+"rtc",tagMatchRequiresAll:!1})},_audio:function(){var e=this.getDialogue();e.set("headerContent",M.util.get_string("audiortc","atto_recordrtc")),e.set("bodyContent",this._createContent("audio")),e.show(),M.atto_recordrtc.audiomodule.init(this)},_video:function(){var e=this.getDialogue();e.set("headerContent",M.util.get_string("videortc","atto_recordrtc")),e.set("bodyContent",this._createContent("video")),e.show(),M.atto_recordrtc.videomodule.init(this)},_createContent:function(t){var i=t==="audio",s=this.get("oldermoodle")?"row-fluid":"row",o=this.get("oldermoodle")?"span":"col-xs-",u=this.get("oldermoodle")?"":"alert-warning",a=this.get("oldermoodle")?"alert-error":"alert-danger",f=this.get("oldermoodle")?"btn btn-large btn-danger btn-block":"btn btn-lg btn-outline-danger btn-block",l=e.Handlebars.compile(r)({PLUGINNAME:n,isAudio:i,bs_row:s,bs_col:o,bs_al_warn:u,bs_al_dang:a,bs_ss_btn:f,bs_ul_btn:"btn btn-primary btn-block",browseralert_title:M.util.get_string("browseralert_title","atto_recordrtc"),browseralert:M.util.get_string("browseralert","atto_recordrtc"),insecurealert_title:M.util.get_string("insecurealert_title","atto_recordrtc"),insecurealert:M.util.get_string("insecurealert","atto_recordrtc"),startrecording:M.util.get_string("startrecording","atto_recordrtc"),attachrecording:M.util.get_string("attachrecording","atto_recordrtc")});return l},closeDialogue:function(e){e.getDialogue().hide(),e.editor.focus()},setLink:function(e,t){e.getDialogue().hide(),e.editor.focus(),e.get("host").insertContentAtFocusPoint(t),e.markUpdated()}},{ATTRS:{contextid:{value:null},sesskey:{value:null},allowedtypes:{value:null},audiobitrate:{value:null},videobitrate:{value:null},timelimit:{value:null},audiortcicon:{value:null},videortcicon:{value:null},oldermoodle:{value:null},maxrecsize:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-atto_recordrtc-recording"]});
YUI.add("moodle-atto_recordrtc-button",function(e,t){var n="atto_recordrtc",r='<div class="{{PLUGINNAME}} container-fluid"><div class="{{bs_row}} hide"><div class="{{bs_col}}12"><div id="alert-warning" class="alert {{bs_al_warn}}"><strong>{{browseralert_title}}</strong> {{browseralert}}</div></div></div><div class="{{bs_row}} hide"><div class="{{bs_col}}12"><div id="alert-danger" class="alert {{bs_al_dang}}"><strong>{{insecurealert_title}}</strong> {{insecurealert}}</div></div></div><div class="{{bs_row}} hide">{{#if isAudio}}<div class="{{bs_col}}1"></div><div class="{{bs_col}}10"><audio id="player"></audio></div><div class="{{bs_col}}1"></div>{{else}}<div class="{{bs_col}}12"><video id="player"></video></div>{{/if}}</div><div class="{{bs_row}}"><div class="{{bs_col}}1"></div><div class="{{bs_col}}10"><button id="start-stop" class="{{bs_ss_btn}}">{{startrecording}}</button></div><div class="{{bs_col}}1"></div></div><div class="{{bs_row}} hide"><div class="{{bs_col}}3"></div><div class="{{bs_col}}6"><button id="upload" class="btn btn-primary btn-block">{{attachrecording}}</button></div><div class="{{bs_col}}3"></div></div></div>';e.namespace("M.atto_recordrtc").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_lang:"en",initializer:function(){if(this.get("host").canShowFilepicker("media")){var e=this.get("allowedtypes");(e==="both"||e==="audio")&&this._addButton("audio",this._audio),(e==="both"||e==="video")&&this._addButton("video",this._video);var t=this.getDialogue({width:1e3,focusAfterHide:null});t.after("visibleChange",function(){var e=!t.get("visible"),n=M.atto_recordrtc.commonmodule;e&&(window.clearInterval(n.countdownTicker),n.mediaRecorder&&n.mediaRecorder.state!=="inactive"&&n.mediaRecorder.stop(),n.stream&&n.stream.getTracks().forEach(function(e){e.readyState!=="ended"&&e.stop()}))}),t.on("click",function(){this.centered()}),window.require(["atto_recordrtc/adapter"],function(e){window.adapter=e})}},_addButton:function(e,t){this.addButton({buttonName:e,icon:this.get(e+"rtcicon"),iconComponent:n,callback:t,title:e+"rtc",tags:e+"rtc",tagMatchRequiresAll:!1})},_audio:function(){var e=this.getDialogue();e.set("headerContent",M.util.get_string("audiortc","atto_recordrtc")),e.set("bodyContent",this._createContent("audio")),e.show(),M.atto_recordrtc.audiomodule.init(this)},_video:function(){var e=this.getDialogue();e.set("headerContent",M.util.get_string("videortc","atto_recordrtc")),e.set("bodyContent",this._createContent("video")),e.show(),M.atto_recordrtc.videomodule.init(this)},_createContent:function(t){var i=t==="audio",s="row",o="col-xs-",u="alert-warning",a="alert-danger",f="btn btn-lg btn-outline-danger btn-block",l=e.Handlebars.compile(r)({PLUGINNAME:n,isAudio:i,bs_row:s,bs_col:o,bs_al_warn:u,bs_al_dang:a,bs_ss_btn:f,bs_ul_btn:"btn btn-primary btn-block",browseralert_title:M.util.get_string("browseralert_title","atto_recordrtc"),browseralert:M.util.get_string("browseralert","atto_recordrtc"),insecurealert_title:M.util.get_string("insecurealert_title","atto_recordrtc"),insecurealert:M.util.get_string("insecurealert","atto_recordrtc"),startrecording:M.util.get_string("startrecording","atto_recordrtc"),attachrecording:M.util.get_string("attachrecording","atto_recordrtc")});return l},closeDialogue:function(e){e.getDialogue().hide(),e.editor.focus()},setLink:function(e,t){e.getDialogue().hide(),e.editor.focus(),e.get("host").insertContentAtFocusPoint(t),e.markUpdated()}},{ATTRS:{contextid:{value:null},sesskey:{value:null},allowedtypes:{value:null},audiobitrate:{value:null},videobitrate:{value:null},timelimit:{value:null},audiortcicon:{value:null},videortcicon:{value:null},maxrecsize:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-atto_recordrtc-recording"]});
@@ -216,12 +216,11 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
*/
_createContent: function(type) {
var isAudio = (type === 'audio'),
bsRow = this.get('oldermoodle') ? 'row-fluid' : 'row',
bsCol = this.get('oldermoodle') ? 'span' : 'col-xs-',
bsAlWarn = this.get('oldermoodle') ? '' : 'alert-warning',
bsAlDang = this.get('oldermoodle') ? 'alert-error' : 'alert-danger',
bsSsBtn = this.get('oldermoodle') ? 'btn btn-large btn-danger btn-block'
: 'btn btn-lg btn-outline-danger btn-block';
bsRow = 'row',
bsCol = 'col-xs-',
bsAlWarn = 'alert-warning',
bsAlDang = 'alert-danger',
bsSsBtn = 'btn btn-lg btn-outline-danger btn-block';
var bodyContent = Y.Handlebars.compile(TEMPLATE)({
PLUGINNAME: PLUGINNAME,
@@ -351,16 +350,6 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
value: null
},
/**
* True if Moodle is version < 3.2.
*
* @attribute oldermoodle
* @type Boolean
*/
oldermoodle: {
value: null
},
/**
* Maximum upload size set on server, in MB.
*
@@ -61,7 +61,6 @@ M.atto_recordrtc.commonmodule = {
mediaRecorder: null,
chunks: null,
blobSize: null,
olderMoodle: null,
maxUploadSize: null,
// Capture webcam/microphone stream.
@@ -538,7 +537,6 @@ M.atto_recordrtc.audiomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'audio';
cm.olderMoodle = scope.get('oldermoodle');
// 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);
@@ -560,9 +558,7 @@ M.atto_recordrtc.audiomodule = {
cm.uploadBtn.ancestor().ancestor().addClass('hide');
// Change look of recording button.
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
}
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
// Empty the array containing the previously recorded chunks.
cm.chunks = [];
@@ -582,9 +578,7 @@ M.atto_recordrtc.audiomodule = {
onMediaStopped: function(btnLabel) {
cm.startStopBtn.set('textContent', btnLabel);
cm.startStopBtn.set('disabled', false);
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
},
// Handle recording errors.
@@ -609,9 +603,7 @@ M.atto_recordrtc.audiomodule = {
// Change button to offer to record again.
cm.startStopBtn.set('textContent', M.util.get_string('recordagain', 'atto_recordrtc'));
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
// Get dialogue centered.
@@ -693,7 +685,6 @@ M.atto_recordrtc.videomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'video';
cm.olderMoodle = scope.get('oldermoodle');
// 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);
@@ -714,9 +705,7 @@ M.atto_recordrtc.videomodule = {
cm.uploadBtn.ancestor().ancestor().addClass('hide');
// Change look of recording button.
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
}
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
// Empty the array containing the previously recorded chunks.
cm.chunks = [];
@@ -736,9 +725,7 @@ M.atto_recordrtc.videomodule = {
onMediaStopped: function(btnLabel) {
cm.startStopBtn.set('textContent', btnLabel);
cm.startStopBtn.set('disabled', false);
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
},
// Handle recording errors.
@@ -767,9 +754,7 @@ M.atto_recordrtc.videomodule = {
// Change button to offer to record again.
cm.startStopBtn.set('textContent', M.util.get_string('recordagain', 'atto_recordrtc'));
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
// Get dialogue centered.
File diff suppressed because one or more lines are too long
@@ -61,7 +61,6 @@ M.atto_recordrtc.commonmodule = {
mediaRecorder: null,
chunks: null,
blobSize: null,
olderMoodle: null,
maxUploadSize: null,
// Capture webcam/microphone stream.
@@ -538,7 +537,6 @@ M.atto_recordrtc.audiomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'audio';
cm.olderMoodle = scope.get('oldermoodle');
// 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);
@@ -560,9 +558,7 @@ M.atto_recordrtc.audiomodule = {
cm.uploadBtn.ancestor().ancestor().addClass('hide');
// Change look of recording button.
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
}
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
// Empty the array containing the previously recorded chunks.
cm.chunks = [];
@@ -582,9 +578,7 @@ M.atto_recordrtc.audiomodule = {
onMediaStopped: function(btnLabel) {
cm.startStopBtn.set('textContent', btnLabel);
cm.startStopBtn.set('disabled', false);
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
},
// Handle recording errors.
@@ -609,9 +603,7 @@ M.atto_recordrtc.audiomodule = {
// Change button to offer to record again.
cm.startStopBtn.set('textContent', M.util.get_string('recordagain', 'atto_recordrtc'));
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
// Get dialogue centered.
@@ -693,7 +685,6 @@ M.atto_recordrtc.videomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'video';
cm.olderMoodle = scope.get('oldermoodle');
// 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);
@@ -714,9 +705,7 @@ M.atto_recordrtc.videomodule = {
cm.uploadBtn.ancestor().ancestor().addClass('hide');
// Change look of recording button.
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
}
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
// Empty the array containing the previously recorded chunks.
cm.chunks = [];
@@ -736,9 +725,7 @@ M.atto_recordrtc.videomodule = {
onMediaStopped: function(btnLabel) {
cm.startStopBtn.set('textContent', btnLabel);
cm.startStopBtn.set('disabled', false);
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
},
// Handle recording errors.
@@ -767,9 +754,7 @@ M.atto_recordrtc.videomodule = {
// Change button to offer to record again.
cm.startStopBtn.set('textContent', M.util.get_string('recordagain', 'atto_recordrtc'));
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
// Get dialogue centered.
@@ -214,12 +214,11 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
*/
_createContent: function(type) {
var isAudio = (type === 'audio'),
bsRow = this.get('oldermoodle') ? 'row-fluid' : 'row',
bsCol = this.get('oldermoodle') ? 'span' : 'col-xs-',
bsAlWarn = this.get('oldermoodle') ? '' : 'alert-warning',
bsAlDang = this.get('oldermoodle') ? 'alert-error' : 'alert-danger',
bsSsBtn = this.get('oldermoodle') ? 'btn btn-large btn-danger btn-block'
: 'btn btn-lg btn-outline-danger btn-block';
bsRow = 'row',
bsCol = 'col-xs-',
bsAlWarn = 'alert-warning',
bsAlDang = 'alert-danger',
bsSsBtn = 'btn btn-lg btn-outline-danger btn-block';
var bodyContent = Y.Handlebars.compile(TEMPLATE)({
PLUGINNAME: PLUGINNAME,
@@ -349,16 +348,6 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
value: null
},
/**
* True if Moodle is version < 3.2.
*
* @attribute oldermoodle
* @type Boolean
*/
oldermoodle: {
value: null
},
/**
* Maximum upload size set on server, in MB.
*
@@ -49,7 +49,6 @@ M.atto_recordrtc.audiomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'audio';
cm.olderMoodle = scope.get('oldermoodle');
// 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);
@@ -71,9 +70,7 @@ M.atto_recordrtc.audiomodule = {
cm.uploadBtn.ancestor().ancestor().addClass('hide');
// Change look of recording button.
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
}
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
// Empty the array containing the previously recorded chunks.
cm.chunks = [];
@@ -93,9 +90,7 @@ M.atto_recordrtc.audiomodule = {
onMediaStopped: function(btnLabel) {
cm.startStopBtn.set('textContent', btnLabel);
cm.startStopBtn.set('disabled', false);
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
},
// Handle recording errors.
@@ -120,9 +115,7 @@ M.atto_recordrtc.audiomodule = {
// Change button to offer to record again.
cm.startStopBtn.set('textContent', M.util.get_string('recordagain', 'atto_recordrtc'));
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
// Get dialogue centered.
@@ -59,7 +59,6 @@ M.atto_recordrtc.commonmodule = {
mediaRecorder: null,
chunks: null,
blobSize: null,
olderMoodle: null,
maxUploadSize: null,
// Capture webcam/microphone stream.
@@ -49,7 +49,6 @@ M.atto_recordrtc.videomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'video';
cm.olderMoodle = scope.get('oldermoodle');
// 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);
@@ -70,9 +69,7 @@ M.atto_recordrtc.videomodule = {
cm.uploadBtn.ancestor().ancestor().addClass('hide');
// Change look of recording button.
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
}
cm.startStopBtn.replaceClass('btn-outline-danger', 'btn-danger');
// Empty the array containing the previously recorded chunks.
cm.chunks = [];
@@ -92,9 +89,7 @@ M.atto_recordrtc.videomodule = {
onMediaStopped: function(btnLabel) {
cm.startStopBtn.set('textContent', btnLabel);
cm.startStopBtn.set('disabled', false);
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
},
// Handle recording errors.
@@ -123,9 +118,7 @@ M.atto_recordrtc.videomodule = {
// Change button to offer to record again.
cm.startStopBtn.set('textContent', M.util.get_string('recordagain', 'atto_recordrtc'));
if (!cm.olderMoodle) {
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
cm.startStopBtn.replaceClass('btn-danger', 'btn-outline-danger');
}
// Get dialogue centered.