AutorÃa | Ultima modificación | Ver Log |
{"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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny Record RTC - Video recorder configuration.\n *\n * @module tiny_recordrtc/video_recorder\n * @copyright 2022 Stevani Andolo <stevani@hotmail.com.au>\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.warn(`Unknown file type for MediaRecorder API`);\n return '';\n }\n\n static getModalClass() {\n return class extends Modal {\n static TYPE = `${component}/video_recorder`;\n static TEMPLATE = `${component}/video_recorder`;\n };\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","getFileNam
e","prefix","getFileExtension","window","MediaRecorder","isTypeSupported","console","warn","Modal","component"],"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,gDACR,oEAIA,cAAcC,kCACAC,kFACIA"}