@@ -215,13 +215,14 @@ export class CameraSource extends UploaderBlock {
215215 ...this . cfg . mediaRecorerOptions ,
216216 } ;
217217
218- if (
219- this . cfg . mediaRecorerOptions ?. mimeType &&
220- MediaRecorder . isTypeSupported ( this . cfg . mediaRecorerOptions . mimeType )
221- ) {
222- this . _options . mimeType = this . cfg . mediaRecorerOptions . mimeType ;
223- } else {
218+ const { mimeType } = this . cfg . mediaRecorerOptions || { } ;
219+
220+ if ( mimeType && MediaRecorder . isTypeSupported ( mimeType ) ) {
221+ this . _options . mimeType = mimeType ;
222+ } else if ( MediaRecorder . isTypeSupported ( DEFAULT_VIDEO_FORMAT ) ) {
224223 this . _options . mimeType = DEFAULT_VIDEO_FORMAT ;
224+ } else {
225+ this . _options . mimeType = 'video/mp4' ;
225226 }
226227
227228 if ( this . _stream ) {
@@ -404,7 +405,7 @@ export class CameraSource extends UploaderBlock {
404405 currentIcon : 'video-camera-full' ,
405406 mutableClassButton : 'uc-shot-btn uc-camera-action' ,
406407
407- audioSelectHidden : ! this . cfg . enableAudioRecording ,
408+ audioSelectHidden : ! this . cfg . enableAudioRecording || this . audioDevices . length <= 1 ,
408409 cameraSelectHidden : this . cameraDevices . length <= 1 ,
409410 } ) ;
410411 }
@@ -480,7 +481,7 @@ export class CameraSource extends UploaderBlock {
480481 currentTimelineIcon : 'play' ,
481482 currentIcon : 'video-camera-full' ,
482483
483- audioSelectHidden : ! this . cfg . enableAudioRecording ,
484+ audioSelectHidden : ! this . cfg . enableAudioRecording || this . audioDevices . length <= 1 ,
484485 audioToggleMicorphoneHidden : ! this . cfg . enableAudioRecording ,
485486 } ) ;
486487 }
0 commit comments