From e5acfffa04810ab9405a4218a23ea2ccfb4f9866 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 20 Jul 2023 14:22:01 +0800 Subject: [PATCH] MDL-78770 atto_recordrtc: Use proper window.console.warn() function --- .../moodle-atto_recordrtc-recording-debug.js | 2 +- .../moodle-atto_recordrtc-recording-min.js | 2 +- .../moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording.js | 2 +- lib/editor/atto/plugins/recordrtc/yui/src/recording/js/commonmodule.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-debug.js b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-debug.js index 9b2eafc3934..691a99c55da 100644 --- a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-debug.js +++ b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-debug.js @@ -204,7 +204,7 @@ M.atto_recordrtc.commonmodule = { } } - window.console.warning('Unknown file type for MediaRecorder API'); + window.console.warn('Unknown file type for MediaRecorder API'); return ''; }, diff --git a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-min.js b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-min.js index 02a03763d5e..27b3cf0fc92 100644 --- a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-min.js +++ b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-atto_recordrtc-recording",function(r,t){var l,n,e;M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.commonmodule={editorScope:null,alertWarning:null,alertDanger:null,player:null,playerDOM:null,startStopBtn:null,uploadBtn:null,countdownSeconds:null,countdownTicker:null,recType:null,stream:null,mediaRecorder:null,chunks:null,blobSize:null,maxUploadSize:null,capture_user_media:function(t,e,o){window.navigator.mediaDevices.getUserMedia(t).then(e)["catch"](o)},handle_data_available:function(t){l.chunks.push(t.data),l.blobSize+=t.data.size,l.blobSize>=l.maxUploadSize&&(window.localStorage.getItem("alerted")?window.localStorage.removeItem("alerted"):(window.localStorage.setItem("alerted","true"),l.startStopBtn.simulate("click"),n.show_alert("nearingmaxsize")),l.chunks.pop())},handle_stop:function(){var t=new window.Blob(l.chunks,{type:l.mediaRecorder.mimeType});l.player.set("srcObject",null),l.player.set("src",window.URL.createObjectURL(t)),l.player.set("muted",!1),l.player.set("controls",!0),l.player.ancestor().ancestor().removeClass("hide"),l.uploadBtn.ancestor().ancestor().removeClass("hide"),l.uploadBtn.set("textContent",M.util.get_string("attachrecording","atto_recordrtc")),l.uploadBtn.set("disabled",!1),l.editorScope.getDialogue().centered(),l.uploadBtn.on("click",function(){0===l.chunks.length?n.show_alert("norecordingfound"):(l.uploadBtn.set("disabled",!0),l.upload_to_server(l.recType,function(t,e){"ended"===t?(l.uploadBtn.set("disabled",!1),l.insert_annotation(l.recType,e)):"upload-failed"===t?(l.uploadBtn.set("disabled",!1),l.uploadBtn.set("textContent",M.util.get_string("uploadfailed","atto_recordrtc")+" "+e)):"upload-failed-404"===t?(l.uploadBtn.set("disabled",!1),l.uploadBtn.set("textContent",M.util.get_string("uploadfailed404","atto_recordrtc"))):"upload-aborted"===t?(l.uploadBtn.set("disabled",!1),l.uploadBtn.set("textContent",M.util.get_string("uploadaborted","atto_recordrtc")+" "+e)):l.uploadBtn.set("textContent",t)}))})},start_recording:function(t,e){var o=n.select_rec_options(t);l.mediaRecorder=new window.MediaRecorder(e,o),l.mediaRecorder.ondataavailable=l.handle_data_available,l.mediaRecorder.onstop=l.handle_stop,l.mediaRecorder.start(1e3),l.player.set("muted",!0),l.countdownSeconds="audio"===t?l.editorScope.get("audiotimelimit"):"video"===t?l.editorScope.get("videotimelimit"):l.editorScope.get("defaulttimelimit"),l.countdownSeconds++,e=M.util.get_string("stoprecording","atto_recordrtc"),l.startStopBtn.setHTML(e+=' (:)'),l.set_time(),l.countdownTicker=window.setInterval(l.set_time,1e3),l.startStopBtn.set("disabled",!1)},stop_recording:function(t){var e,o;for(l.mediaRecorder.stop(),e=t.getTracks(),o=0;o":"")},insert_annotation:function(t,e){t=l.create_annotation(t,e);t?l.editorScope.setLink(l.editorScope,t):l.uploadBtn.set("textContent",M.util.get_string("attachrecording","atto_recordrtc"))}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.compatcheckmodule={check_has_gum:function(){navigator.mediaDevices&&window.MediaRecorder||n.show_alert("nowebrtc",function(){l.editorScope.closeDialogue(l.editorScope)})},check_secure:function(){"https:"===window.location.protocol||-1!==window.location.host.indexOf("localhost")||l.alertDanger.ancestor().ancestor().removeClass("hide")}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.abstractmodule={show_alert:function(e,o){r.use("moodle-core-notification-alert",function(){var t=new M.core.alert({ +YUI.add("moodle-atto_recordrtc-recording",function(r,t){var l,n,e;M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.commonmodule={editorScope:null,alertWarning:null,alertDanger:null,player:null,playerDOM:null,startStopBtn:null,uploadBtn:null,countdownSeconds:null,countdownTicker:null,recType:null,stream:null,mediaRecorder:null,chunks:null,blobSize:null,maxUploadSize:null,capture_user_media:function(t,e,o){window.navigator.mediaDevices.getUserMedia(t).then(e)["catch"](o)},handle_data_available:function(t){l.chunks.push(t.data),l.blobSize+=t.data.size,l.blobSize>=l.maxUploadSize&&(window.localStorage.getItem("alerted")?window.localStorage.removeItem("alerted"):(window.localStorage.setItem("alerted","true"),l.startStopBtn.simulate("click"),n.show_alert("nearingmaxsize")),l.chunks.pop())},handle_stop:function(){var t=new window.Blob(l.chunks,{type:l.mediaRecorder.mimeType});l.player.set("srcObject",null),l.player.set("src",window.URL.createObjectURL(t)),l.player.set("muted",!1),l.player.set("controls",!0),l.player.ancestor().ancestor().removeClass("hide"),l.uploadBtn.ancestor().ancestor().removeClass("hide"),l.uploadBtn.set("textContent",M.util.get_string("attachrecording","atto_recordrtc")),l.uploadBtn.set("disabled",!1),l.editorScope.getDialogue().centered(),l.uploadBtn.on("click",function(){0===l.chunks.length?n.show_alert("norecordingfound"):(l.uploadBtn.set("disabled",!0),l.upload_to_server(l.recType,function(t,e){"ended"===t?(l.uploadBtn.set("disabled",!1),l.insert_annotation(l.recType,e)):"upload-failed"===t?(l.uploadBtn.set("disabled",!1),l.uploadBtn.set("textContent",M.util.get_string("uploadfailed","atto_recordrtc")+" "+e)):"upload-failed-404"===t?(l.uploadBtn.set("disabled",!1),l.uploadBtn.set("textContent",M.util.get_string("uploadfailed404","atto_recordrtc"))):"upload-aborted"===t?(l.uploadBtn.set("disabled",!1),l.uploadBtn.set("textContent",M.util.get_string("uploadaborted","atto_recordrtc")+" "+e)):l.uploadBtn.set("textContent",t)}))})},start_recording:function(t,e){var o=n.select_rec_options(t);l.mediaRecorder=new window.MediaRecorder(e,o),l.mediaRecorder.ondataavailable=l.handle_data_available,l.mediaRecorder.onstop=l.handle_stop,l.mediaRecorder.start(1e3),l.player.set("muted",!0),l.countdownSeconds="audio"===t?l.editorScope.get("audiotimelimit"):"video"===t?l.editorScope.get("videotimelimit"):l.editorScope.get("defaulttimelimit"),l.countdownSeconds++,e=M.util.get_string("stoprecording","atto_recordrtc"),l.startStopBtn.setHTML(e+=' (:)'),l.set_time(),l.countdownTicker=window.setInterval(l.set_time,1e3),l.startStopBtn.set("disabled",!1)},stop_recording:function(t){var e,o;for(l.mediaRecorder.stop(),e=t.getTracks(),o=0;o":"")},insert_annotation:function(t,e){t=l.create_annotation(t,e);t?l.editorScope.setLink(l.editorScope,t):l.uploadBtn.set("textContent",M.util.get_string("attachrecording","atto_recordrtc"))}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.compatcheckmodule={check_has_gum:function(){navigator.mediaDevices&&window.MediaRecorder||n.show_alert("nowebrtc",function(){l.editorScope.closeDialogue(l.editorScope)})},check_secure:function(){"https:"===window.location.protocol||-1!==window.location.host.indexOf("localhost")||l.alertDanger.ancestor().ancestor().removeClass("hide")}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.abstractmodule={show_alert:function(e,o){r.use("moodle-core-notification-alert",function(){var t=new M.core.alert({ title:M.util.get_string(e+"_title","atto_recordrtc"),message:M.util.get_string(e,"atto_recordrtc")});o&&t.after("complete",o)})},handle_gum_errors:function(t,e){var o=M.util.get_string("recordingfailed","atto_recordrtc"),r=function(){e.onMediaStopped(o)},t="gum"+t.name.replace("Error","").toLowerCase();"gumsecurity"!=t?n.show_alert(t,r):n.show_alert(t,function(){l.editorScope.closeDialogue(l.editorScope)})},select_rec_options:function(t){var t="audio"===t?(e=["audio/ogg;codecs=opus","audio/mp4;codecs=opus","audio/mp4;codecs=wav","audio/mp4;codecs=mp3"],{audioBitsPerSecond:window.parseInt(l.editorScope.get("audiobitrate"))}):(e=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/mp4;codecs=h264,opus","video/mp4;codecs=h264,wav","video/mp4;codecs=v9,opus"],{audioBitsPerSecond:window.parseInt(l.editorScope.get("audiobitrate")),videoBitsPerSecond:window.parseInt(l.editorScope.get("videobitrate"))}),e=e.reduce(function(t,e){return t.push(e),t.push(e.replace("=",":")),t},[]).filter(function(t){return window.MediaRecorder.isTypeSupported(t)});return 0!==e.length&&(t.mimeType=e[0]),t}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,e=M.atto_recordrtc.compatcheckmodule,M.atto_recordrtc.audiomodule={init:function(t){l.editorScope=t,l.alertWarning=r.one("div#alert-warning"),l.alertDanger=r.one("div#alert-danger"),l.player=r.one("audio#player"),l.playerDOM=document.querySelector("audio#player"),l.startStopBtn=r.one("button#start-stop"),l.uploadBtn=r.one("button#upload"),l.recType="audio",l.maxUploadSize=t.get("maxrecsize"),e.check_has_gum(),e.check_secure(),l.startStopBtn.on("click",function(){var e;l.startStopBtn.set("disabled",!0),l.startStopBtn.get("textContent")===M.util.get_string("startrecording","atto_recordrtc")||l.startStopBtn.get("textContent")===M.util.get_string("recordagain","atto_recordrtc")||l.startStopBtn.get("textContent")===M.util.get_string("recordingfailed","atto_recordrtc")?(l.player.ancestor().ancestor().addClass("hide"),l.uploadBtn.ancestor().ancestor().addClass("hide"),l.startStopBtn.replaceClass("btn-outline-danger","btn-danger"),l.chunks=[],l.blobSize=0,l.uploadBtn.detach("click"),e={onMediaCaptured:function(t){l.stream=t,l.start_recording(l.recType,l.stream)},onMediaStopped:function(t){l.startStopBtn.set("textContent",t),l.startStopBtn.set("disabled",!1),l.startStopBtn.replaceClass("btn-danger","btn-outline-danger")},onMediaCapturingFailed:function(t){n.handle_gum_errors(t,e)}},M.atto_recordrtc.audiomodule.capture_audio(e)):(window.clearInterval(l.countdownTicker),window.setTimeout(function(){l.startStopBtn.set("disabled",!1)},1e3),l.stop_recording(l.stream),l.startStopBtn.set("textContent",M.util.get_string("recordagain","atto_recordrtc")),l.startStopBtn.replaceClass("btn-danger","btn-outline-danger")),l.editorScope.getDialogue().centered()})},capture_audio:function(e){l.capture_user_media({audio:!0},function(t){l.playerDOM.srcObject=t,e.onMediaCaptured(t)},function(t){e.onMediaCapturingFailed(t)})}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,e=M.atto_recordrtc.compatcheckmodule,M.atto_recordrtc.videomodule={init:function(t){l.editorScope=t,l.alertWarning=r.one("div#alert-warning"),l.alertDanger=r.one("div#alert-danger"),l.player=r.one("video#player"),l.playerDOM=document.querySelector("video#player"),l.startStopBtn=r.one("button#start-stop"),l.uploadBtn=r.one("button#upload"),l.recType="video",l.maxUploadSize=t.get("maxrecsize"),e.check_has_gum(),e.check_secure(),l.startStopBtn.on("click",function(){var e;l.startStopBtn.set("disabled",!0),l.startStopBtn.get("textContent")===M.util.get_string("startrecording","atto_recordrtc")||l.startStopBtn.get("textContent")===M.util.get_string("recordagain","atto_recordrtc")||l.startStopBtn.get("textContent")===M.util.get_string("recordingfailed","atto_recordrtc")?(l.uploadBtn.ancestor().ancestor().addClass("hide"),l.startStopBtn.replaceClass("btn-outline-danger","btn-danger"),l.chunks=[],l.blobSize=0,l.uploadBtn.detach("click"),e={onMediaCaptured:function(t){l.stream=t,l.start_recording(l.recType,l.stream)},onMediaStopped:function(t){l.startStopBtn.set("textContent",t),l.startStopBtn.set("disabled",!1),l.startStopBtn.replaceClass("btn-danger","btn-outline-danger")},onMediaCapturingFailed:function(t){n.handle_gum_errors(t,e)}},l.player.ancestor().ancestor().removeClass("hide"),l.player.set("controls",!1),M.atto_recordrtc.videomodule.capture_audio_video(e)):(window.clearInterval(l.countdownTicker),window.setTimeout(function(){l.startStopBtn.set("disabled",!1)},1e3),l.stop_recording(l.stream),l.startStopBtn.set("textContent",M.util.get_string("recordagain","atto_recordrtc")),l.startStopBtn.replaceClass("btn-danger","btn-outline-danger")),l.editorScope.getDialogue().centered()})},capture_audio_video:function(e){l.capture_user_media({audio:!0,video:{width:{ideal:640},height:{ideal:480}}},function(t){l.playerDOM.srcObject=t,l.playerDOM.play(),e.onMediaCaptured(t)},function(t){e.onMediaCapturingFailed(t)})}}},"@VERSION@",{requires:["moodle-atto_recordrtc-button"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording.js b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording.js index 9b2eafc3934..691a99c55da 100644 --- a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording.js +++ b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording.js @@ -204,7 +204,7 @@ M.atto_recordrtc.commonmodule = { } } - window.console.warning('Unknown file type for MediaRecorder API'); + window.console.warn('Unknown file type for MediaRecorder API'); return ''; }, diff --git a/lib/editor/atto/plugins/recordrtc/yui/src/recording/js/commonmodule.js b/lib/editor/atto/plugins/recordrtc/yui/src/recording/js/commonmodule.js index bed2e414740..73a82fb144a 100644 --- a/lib/editor/atto/plugins/recordrtc/yui/src/recording/js/commonmodule.js +++ b/lib/editor/atto/plugins/recordrtc/yui/src/recording/js/commonmodule.js @@ -202,7 +202,7 @@ M.atto_recordrtc.commonmodule = { } } - window.console.warning('Unknown file type for MediaRecorder API'); + window.console.warn('Unknown file type for MediaRecorder API'); return ''; }, -- 2.11.4.GIT