From a6e697c8a42b638eb43b0c19ae0bd8caaa3a8ca9 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 23 Jun 2023 11:47:59 +0800 Subject: [PATCH] MDL-78391 tiny_recordrtc: Set filename according to container --- .../recordrtc/amd/build/audio_recorder.min.js | 2 +- .../recordrtc/amd/build/audio_recorder.min.js.map | 2 +- .../recordrtc/amd/build/video_recorder.min.js | 2 +- .../recordrtc/amd/build/video_recorder.min.js.map | 2 +- .../plugins/recordrtc/amd/src/audio_recorder.js | 15 ++++++++++++++- .../plugins/recordrtc/amd/src/video_recorder.js | 13 ++++++++++++- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/lib/editor/tiny/plugins/recordrtc/amd/build/audio_recorder.min.js b/lib/editor/tiny/plugins/recordrtc/amd/build/audio_recorder.min.js index 64ca2f4775e..bd5b410b284 100644 --- a/lib/editor/tiny/plugins/recordrtc/amd/build/audio_recorder.min.js +++ b/lib/editor/tiny/plugins/recordrtc/amd/build/audio_recorder.min.js @@ -1,3 +1,3 @@ -define("tiny_recordrtc/audio_recorder",["exports","./base_recorder","./modal","tiny_recordrtc/common"],(function(_exports,_base_recorder,_modal,_common){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_base_recorder=_interopRequireDefault(_base_recorder),_modal=_interopRequireDefault(_modal);class Audio extends _base_recorder.default{configurePlayer(){return this.modalRoot.querySelector("audio")}getSupportedTypes(){return["audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4;codecs=opus","audio/mp4;codecs=wav","audio/mp4;codecs=mp3"]}getRecordingOptions(){return{audioBitsPerSecond:parseInt(this.config.audiobitrate)}}getMediaConstraints(){return{audio:!0}}getRecordingType(){return"audio"}getTimeLimit(){return this.config.audiotimelimit}getEmbedTemplateName(){return"tiny_recordrtc/embed_audio"}getFileName(prefix){return"".concat(prefix,"-audio.ogg")}static getModalClass(){var _class;const AudioModal=(_defineProperty(_class=class extends _modal.default{},"TYPE","".concat(_common.component,"/audio_recorder")),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/audio_recorder")),_class);return AudioModal.registerModalType(),AudioModal}}return _exports.default=Audio,_exports.default})); +define("tiny_recordrtc/audio_recorder",["exports","./base_recorder","./modal","tiny_recordrtc/common"],(function(_exports,_base_recorder,_modal,_common){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_base_recorder=_interopRequireDefault(_base_recorder),_modal=_interopRequireDefault(_modal);class Audio extends _base_recorder.default{configurePlayer(){return this.modalRoot.querySelector("audio")}getSupportedTypes(){return["audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4;codecs=opus","audio/mp4;codecs=wav","audio/mp4;codecs=mp3"]}getRecordingOptions(){return{audioBitsPerSecond:parseInt(this.config.audiobitrate)}}getMediaConstraints(){return{audio:!0}}getRecordingType(){return"audio"}getTimeLimit(){return this.config.audiotimelimit}getEmbedTemplateName(){return"tiny_recordrtc/embed_audio"}getFileName(prefix){return"".concat(prefix,"-audio.").concat(this.getFileExtension())}getFileExtension(){return window.MediaRecorder.isTypeSupported("audio/webm")?"webm":window.MediaRecorder.isTypeSupported("audio/ogg")?"ogg":window.MediaRecorder.isTypeSupported("audio/mp4")?"mp4":(window.console.warning("Unknown file type for MediaRecorder API"),"")}static getModalClass(){var _class;const AudioModal=(_defineProperty(_class=class extends _modal.default{},"TYPE","".concat(_common.component,"/audio_recorder")),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/audio_recorder")),_class);return AudioModal.registerModalType(),AudioModal}}return _exports.default=Audio,_exports.default})); //# sourceMappingURL=audio_recorder.min.js.map \ No newline at end of file diff --git a/lib/editor/tiny/plugins/recordrtc/amd/build/audio_recorder.min.js.map b/lib/editor/tiny/plugins/recordrtc/amd/build/audio_recorder.min.js.map index 87aee892132..617d4b3ecd7 100644 --- a/lib/editor/tiny/plugins/recordrtc/amd/build/audio_recorder.min.js.map +++ b/lib/editor/tiny/plugins/recordrtc/amd/build/audio_recorder.min.js.map @@ -1 +1 @@ -{"version":3,"file":"audio_recorder.min.js","sources":["../src/audio_recorder.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny Record RTC - audio recorder configuration.\n *\n * @module tiny_recordrtc/audio_recorder\n * @copyright 2022 Stevani Andolo \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport BaseClass from './base_recorder';\nimport Modal from './modal';\nimport {component} from 'tiny_recordrtc/common';\n\nexport default class Audio extends BaseClass {\n configurePlayer() {\n return this.modalRoot.querySelector('audio');\n }\n\n getSupportedTypes() {\n return [\n // Firefox and Chrome both support webm and ogg.\n 'audio/webm;codecs=opus',\n 'audio/ogg;codecs=opus',\n\n // Safari supports mp4.\n 'audio/mp4;codecs=opus',\n 'audio/mp4;codecs=wav',\n 'audio/mp4;codecs=mp3',\n ];\n }\n\n getRecordingOptions() {\n return {\n audioBitsPerSecond: parseInt(this.config.audiobitrate),\n };\n }\n\n getMediaConstraints() {\n return {\n audio: true,\n };\n }\n\n getRecordingType() {\n return 'audio';\n }\n\n getTimeLimit() {\n return this.config.audiotimelimit;\n }\n\n getEmbedTemplateName() {\n return 'tiny_recordrtc/embed_audio';\n }\n\n getFileName(prefix) {\n return `${prefix}-audio.ogg`;\n }\n\n static getModalClass() {\n const AudioModal = class extends Modal {\n static TYPE = `${component}/audio_recorder`;\n static TEMPLATE = `${component}/audio_recorder`;\n };\n\n AudioModal.registerModalType();\n return AudioModal;\n }\n}\n"],"names":["Audio","BaseClass","configurePlayer","this","modalRoot","querySelector","getSupportedTypes","getRecordingOptions","audioBitsPerSecond","parseInt","config","audiobitrate","getMediaConstraints","audio","getRecordingType","getTimeLimit","audiotimelimit","getEmbedTemplateName","getFileName","prefix","AudioModal","Modal","component","registerModalType"],"mappings":"ikBA2BqBA,cAAcC,uBAC/BC,yBACWC,KAAKC,UAAUC,cAAc,SAGxCC,0BACW,CAEH,yBACA,wBAGA,wBACA,uBACA,wBAIRC,4BACW,CACHC,mBAAoBC,SAASN,KAAKO,OAAOC,eAIjDC,4BACW,CACHC,OAAO,GAIfC,yBACW,QAGXC,sBACWZ,KAAKO,OAAOM,eAGvBC,6BACW,6BAGXC,YAAYC,wBACEA,6DAIJC,mCAAa,cAAcC,kCACZC,kFACIA,qDAGzBF,WAAWG,oBACJH"} \ No newline at end of file +{"version":3,"file":"audio_recorder.min.js","sources":["../src/audio_recorder.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny Record RTC - audio recorder configuration.\n *\n * @module tiny_recordrtc/audio_recorder\n * @copyright 2022 Stevani Andolo \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport BaseClass from './base_recorder';\nimport Modal from './modal';\nimport {component} from 'tiny_recordrtc/common';\n\nexport default class Audio extends BaseClass {\n configurePlayer() {\n return this.modalRoot.querySelector('audio');\n }\n\n getSupportedTypes() {\n return [\n // Firefox and Chrome both support webm and ogg.\n 'audio/webm;codecs=opus',\n 'audio/ogg;codecs=opus',\n\n // Safari supports mp4.\n 'audio/mp4;codecs=opus',\n 'audio/mp4;codecs=wav',\n 'audio/mp4;codecs=mp3',\n ];\n }\n\n getRecordingOptions() {\n return {\n audioBitsPerSecond: parseInt(this.config.audiobitrate),\n };\n }\n\n getMediaConstraints() {\n return {\n audio: true,\n };\n }\n\n getRecordingType() {\n return 'audio';\n }\n\n getTimeLimit() {\n return this.config.audiotimelimit;\n }\n\n getEmbedTemplateName() {\n return 'tiny_recordrtc/embed_audio';\n }\n\n getFileName(prefix) {\n return `${prefix}-audio.${this.getFileExtension()}`;\n }\n\n getFileExtension() {\n if (window.MediaRecorder.isTypeSupported('audio/webm')) {\n return 'webm';\n } else if (window.MediaRecorder.isTypeSupported('audio/ogg')) {\n return 'ogg';\n } else if (window.MediaRecorder.isTypeSupported('audio/mp4')) {\n return 'mp4';\n }\n\n window.console.warning(`Unknown file type for MediaRecorder API`);\n return '';\n }\n\n static getModalClass() {\n const AudioModal = class extends Modal {\n static TYPE = `${component}/audio_recorder`;\n static TEMPLATE = `${component}/audio_recorder`;\n };\n\n AudioModal.registerModalType();\n return AudioModal;\n }\n}\n"],"names":["Audio","BaseClass","configurePlayer","this","modalRoot","querySelector","getSupportedTypes","getRecordingOptions","audioBitsPerSecond","parseInt","config","audiobitrate","getMediaConstraints","audio","getRecordingType","getTimeLimit","audiotimelimit","getEmbedTemplateName","getFileName","prefix","getFileExtension","window","MediaRecorder","isTypeSupported","console","warning","AudioModal","Modal","component","registerModalType"],"mappings":"ikBA2BqBA,cAAcC,uBAC/BC,yBACWC,KAAKC,UAAUC,cAAc,SAGxCC,0BACW,CAEH,yBACA,wBAGA,wBACA,uBACA,wBAIRC,4BACW,CACHC,mBAAoBC,SAASN,KAAKO,OAAOC,eAIjDC,4BACW,CACHC,OAAO,GAIfC,yBACW,QAGXC,sBACWZ,KAAKO,OAAOM,eAGvBC,6BACW,6BAGXC,YAAYC,wBACEA,yBAAgBhB,KAAKiB,oBAGnCA,0BACQC,OAAOC,cAAcC,gBAAgB,cAC9B,OACAF,OAAOC,cAAcC,gBAAgB,aACrC,MACAF,OAAOC,cAAcC,gBAAgB,aACrC,OAGXF,OAAOG,QAAQC,mDACR,4CAIDC,mCAAa,cAAcC,kCACZC,kFACIA,qDAGzBF,WAAWG,oBACJH"} \ No newline at end of file diff --git a/lib/editor/tiny/plugins/recordrtc/amd/build/video_recorder.min.js b/lib/editor/tiny/plugins/recordrtc/amd/build/video_recorder.min.js index cf6940897af..04099bb6fde 100644 --- a/lib/editor/tiny/plugins/recordrtc/amd/build/video_recorder.min.js +++ b/lib/editor/tiny/plugins/recordrtc/amd/build/video_recorder.min.js @@ -1,3 +1,3 @@ -define("tiny_recordrtc/video_recorder",["exports","./base_recorder","tiny_recordrtc/modal","tiny_recordrtc/common"],(function(_exports,_base_recorder,_modal,_common){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_base_recorder=_interopRequireDefault(_base_recorder),_modal=_interopRequireDefault(_modal);class Video extends _base_recorder.default{configurePlayer(){return this.modalRoot.querySelector("video")}getSupportedTypes(){return["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"]}getRecordingOptions(){return{audioBitsPerSecond:parseInt(this.config.audiobitrate),videoBitsPerSecond:parseInt(this.config.videobitrate)}}getMediaConstraints(){return{audio:!0,video:{width:{ideal:640},height:{ideal:480}}}}playOnCapture(){return!0}getRecordingType(){return"video"}getTimeLimit(){return this.config.videotimelimit}getEmbedTemplateName(){return"tiny_recordrtc/embed_video"}getFileName(prefix){return"".concat(prefix,"-video.webm")}static getModalClass(){var _class;const VideoModal=(_defineProperty(_class=class extends _modal.default{},"TYPE","".concat(_common.component,"/video_recorder")),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/video_recorder")),_class);return VideoModal.registerModalType(),VideoModal}}return _exports.default=Video,_exports.default})); +define("tiny_recordrtc/video_recorder",["exports","./base_recorder","tiny_recordrtc/modal","tiny_recordrtc/common"],(function(_exports,_base_recorder,_modal,_common){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_base_recorder=_interopRequireDefault(_base_recorder),_modal=_interopRequireDefault(_modal);class Video extends _base_recorder.default{configurePlayer(){return this.modalRoot.querySelector("video")}getSupportedTypes(){return["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"]}getRecordingOptions(){return{audioBitsPerSecond:parseInt(this.config.audiobitrate),videoBitsPerSecond:parseInt(this.config.videobitrate)}}getMediaConstraints(){return{audio:!0,video:{width:{ideal:640},height:{ideal:480}}}}playOnCapture(){return!0}getRecordingType(){return"video"}getTimeLimit(){return this.config.videotimelimit}getEmbedTemplateName(){return"tiny_recordrtc/embed_video"}getFileName(prefix){return"".concat(prefix,"-video.").concat(this.getFileExtension())}getFileExtension(){return window.MediaRecorder.isTypeSupported("audio/webm")?"webm":window.MediaRecorder.isTypeSupported("audio/mp4")?"mp4":(window.console.warning("Unknown file type for MediaRecorder API"),"")}static getModalClass(){var _class;const VideoModal=(_defineProperty(_class=class extends _modal.default{},"TYPE","".concat(_common.component,"/video_recorder")),_defineProperty(_class,"TEMPLATE","".concat(_common.component,"/video_recorder")),_class);return VideoModal.registerModalType(),VideoModal}}return _exports.default=Video,_exports.default})); //# sourceMappingURL=video_recorder.min.js.map \ No newline at end of file diff --git a/lib/editor/tiny/plugins/recordrtc/amd/build/video_recorder.min.js.map b/lib/editor/tiny/plugins/recordrtc/amd/build/video_recorder.min.js.map index 1acfdaa9e80..fbd5fc0ec13 100644 --- a/lib/editor/tiny/plugins/recordrtc/amd/build/video_recorder.min.js.map +++ b/lib/editor/tiny/plugins/recordrtc/amd/build/video_recorder.min.js.map @@ -1 +1 @@ -{"version":3,"file":"video_recorder.min.js","sources":["../src/video_recorder.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny Record RTC - Video recorder configuration.\n *\n * @module tiny_recordrtc/video_recorder\n * @copyright 2022 Stevani Andolo \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport BaseClass from './base_recorder';\nimport Modal from 'tiny_recordrtc/modal';\nimport {component} from 'tiny_recordrtc/common';\n\nexport default class Video extends BaseClass {\n configurePlayer() {\n return this.modalRoot.querySelector('video');\n }\n\n getSupportedTypes() {\n return [\n // Support webm as a preference.\n // This container supports both vp9, and vp8.\n // It does not support AVC1/h264 at all.\n // It is supported by Chromium, and Firefox browsers, but not Safari.\n 'video/webm;codecs=vp9,opus',\n 'video/webm;codecs=vp8,opus',\n\n // Fall back to mp4 if webm is not available.\n // The mp4 container supports v9, and h264 but neither of these are supported for recording on other\n // browsers.\n // In addition to this, we can record in v9, but VideoJS does not support an mp4 containern with v9 codec\n // for playback. We leave it as a final option as a just-in-case.\n 'video/mp4;codecs=h264,opus',\n 'video/mp4;codecs=h264,wav',\n 'video/mp4;codecs=v9,opus',\n ];\n\n }\n\n getRecordingOptions() {\n return {\n audioBitsPerSecond: parseInt(this.config.audiobitrate),\n videoBitsPerSecond: parseInt(this.config.videobitrate)\n };\n }\n\n getMediaConstraints() {\n return {\n audio: true,\n video: {\n width: {\n ideal: 640,\n },\n height: {\n ideal: 480,\n },\n },\n };\n }\n\n playOnCapture() {\n // Play the recording back on capture.\n return true;\n }\n\n getRecordingType() {\n return 'video';\n }\n\n getTimeLimit() {\n return this.config.videotimelimit;\n }\n\n getEmbedTemplateName() {\n return 'tiny_recordrtc/embed_video';\n }\n\n getFileName(prefix) {\n return `${prefix}-video.webm`;\n }\n\n static getModalClass() {\n const VideoModal = class extends Modal {\n static TYPE = `${component}/video_recorder`;\n static TEMPLATE = `${component}/video_recorder`;\n };\n\n VideoModal.registerModalType();\n return VideoModal;\n }\n}\n"],"names":["Video","BaseClass","configurePlayer","this","modalRoot","querySelector","getSupportedTypes","getRecordingOptions","audioBitsPerSecond","parseInt","config","audiobitrate","videoBitsPerSecond","videobitrate","getMediaConstraints","audio","video","width","ideal","height","playOnCapture","getRecordingType","getTimeLimit","videotimelimit","getEmbedTemplateName","getFileName","prefix","VideoModal","Modal","component","registerModalType"],"mappings":"8kBA2BqBA,cAAcC,uBAC/BC,yBACWC,KAAKC,UAAUC,cAAc,SAGxCC,0BACW,CAKH,6BACA,6BAOA,6BACA,4BACA,4BAKRC,4BACW,CACHC,mBAAoBC,SAASN,KAAKO,OAAOC,cACzCC,mBAAoBH,SAASN,KAAKO,OAAOG,eAIjDC,4BACW,CACHC,OAAO,EACPC,MAAO,CACHC,MAAO,CACHC,MAAO,KAEXC,OAAQ,CACJD,MAAO,OAMvBE,uBAEW,EAGXC,yBACW,QAGXC,sBACWnB,KAAKO,OAAOa,eAGvBC,6BACW,6BAGXC,YAAYC,wBACEA,8DAIJC,mCAAa,cAAcC,kCACZC,kFACIA,qDAGzBF,WAAWG,oBACJH"} \ No newline at end of file +{"version":3,"file":"video_recorder.min.js","sources":["../src/video_recorder.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny Record RTC - Video recorder configuration.\n *\n * @module tiny_recordrtc/video_recorder\n * @copyright 2022 Stevani Andolo \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport BaseClass from './base_recorder';\nimport Modal from 'tiny_recordrtc/modal';\nimport {component} from 'tiny_recordrtc/common';\n\nexport default class Video extends BaseClass {\n configurePlayer() {\n return this.modalRoot.querySelector('video');\n }\n\n getSupportedTypes() {\n return [\n // Support webm as a preference.\n // This container supports both vp9, and vp8.\n // It does not support AVC1/h264 at all.\n // It is supported by Chromium, and Firefox browsers, but not Safari.\n 'video/webm;codecs=vp9,opus',\n 'video/webm;codecs=vp8,opus',\n\n // Fall back to mp4 if webm is not available.\n // The mp4 container supports v9, and h264 but neither of these are supported for recording on other\n // browsers.\n // In addition to this, we can record in v9, but VideoJS does not support an mp4 containern with v9 codec\n // for playback. We leave it as a final option as a just-in-case.\n 'video/mp4;codecs=h264,opus',\n 'video/mp4;codecs=h264,wav',\n 'video/mp4;codecs=v9,opus',\n ];\n\n }\n\n getRecordingOptions() {\n return {\n audioBitsPerSecond: parseInt(this.config.audiobitrate),\n videoBitsPerSecond: parseInt(this.config.videobitrate)\n };\n }\n\n getMediaConstraints() {\n return {\n audio: true,\n video: {\n width: {\n ideal: 640,\n },\n height: {\n ideal: 480,\n },\n },\n };\n }\n\n playOnCapture() {\n // Play the recording back on capture.\n return true;\n }\n\n getRecordingType() {\n return 'video';\n }\n\n getTimeLimit() {\n return this.config.videotimelimit;\n }\n\n getEmbedTemplateName() {\n return 'tiny_recordrtc/embed_video';\n }\n\n getFileName(prefix) {\n return `${prefix}-video.${this.getFileExtension()}`;\n }\n\n getFileExtension() {\n if (window.MediaRecorder.isTypeSupported('audio/webm')) {\n return 'webm';\n } else if (window.MediaRecorder.isTypeSupported('audio/mp4')) {\n return 'mp4';\n }\n\n window.console.warning(`Unknown file type for MediaRecorder API`);\n return '';\n }\n\n static getModalClass() {\n const VideoModal = class extends Modal {\n static TYPE = `${component}/video_recorder`;\n static TEMPLATE = `${component}/video_recorder`;\n };\n\n VideoModal.registerModalType();\n return VideoModal;\n }\n}\n"],"names":["Video","BaseClass","configurePlayer","this","modalRoot","querySelector","getSupportedTypes","getRecordingOptions","audioBitsPerSecond","parseInt","config","audiobitrate","videoBitsPerSecond","videobitrate","getMediaConstraints","audio","video","width","ideal","height","playOnCapture","getRecordingType","getTimeLimit","videotimelimit","getEmbedTemplateName","getFileName","prefix","getFileExtension","window","MediaRecorder","isTypeSupported","console","warning","VideoModal","Modal","component","registerModalType"],"mappings":"8kBA2BqBA,cAAcC,uBAC/BC,yBACWC,KAAKC,UAAUC,cAAc,SAGxCC,0BACW,CAKH,6BACA,6BAOA,6BACA,4BACA,4BAKRC,4BACW,CACHC,mBAAoBC,SAASN,KAAKO,OAAOC,cACzCC,mBAAoBH,SAASN,KAAKO,OAAOG,eAIjDC,4BACW,CACHC,OAAO,EACPC,MAAO,CACHC,MAAO,CACHC,MAAO,KAEXC,OAAQ,CACJD,MAAO,OAMvBE,uBAEW,EAGXC,yBACW,QAGXC,sBACWnB,KAAKO,OAAOa,eAGvBC,6BACW,6BAGXC,YAAYC,wBACEA,yBAAgBvB,KAAKwB,oBAGnCA,0BACQC,OAAOC,cAAcC,gBAAgB,cAC9B,OACAF,OAAOC,cAAcC,gBAAgB,aACrC,OAGXF,OAAOG,QAAQC,mDACR,4CAIDC,mCAAa,cAAcC,kCACZC,kFACIA,qDAGzBF,WAAWG,oBACJH"} \ No newline at end of file diff --git a/lib/editor/tiny/plugins/recordrtc/amd/src/audio_recorder.js b/lib/editor/tiny/plugins/recordrtc/amd/src/audio_recorder.js index 491f75d79aa..ae72245d595 100644 --- a/lib/editor/tiny/plugins/recordrtc/amd/src/audio_recorder.js +++ b/lib/editor/tiny/plugins/recordrtc/amd/src/audio_recorder.js @@ -68,7 +68,20 @@ export default class Audio extends BaseClass { } getFileName(prefix) { - return `${prefix}-audio.ogg`; + return `${prefix}-audio.${this.getFileExtension()}`; + } + + getFileExtension() { + if (window.MediaRecorder.isTypeSupported('audio/webm')) { + return 'webm'; + } else if (window.MediaRecorder.isTypeSupported('audio/ogg')) { + return 'ogg'; + } else if (window.MediaRecorder.isTypeSupported('audio/mp4')) { + return 'mp4'; + } + + window.console.warning(`Unknown file type for MediaRecorder API`); + return ''; } static getModalClass() { diff --git a/lib/editor/tiny/plugins/recordrtc/amd/src/video_recorder.js b/lib/editor/tiny/plugins/recordrtc/amd/src/video_recorder.js index 781e6e3ae55..895bacde828 100644 --- a/lib/editor/tiny/plugins/recordrtc/amd/src/video_recorder.js +++ b/lib/editor/tiny/plugins/recordrtc/amd/src/video_recorder.js @@ -90,7 +90,18 @@ export default class Video extends BaseClass { } getFileName(prefix) { - return `${prefix}-video.webm`; + return `${prefix}-video.${this.getFileExtension()}`; + } + + getFileExtension() { + if (window.MediaRecorder.isTypeSupported('audio/webm')) { + return 'webm'; + } else if (window.MediaRecorder.isTypeSupported('audio/mp4')) { + return 'mp4'; + } + + window.console.warning(`Unknown file type for MediaRecorder API`); + return ''; } static getModalClass() {