fix(local-rec) Handle no mic permission (#12862)

This commit is contained in:
Robert Pintilii 2023-02-03 11:34:07 +02:00 committed by GitHub
parent 749c26b74c
commit 12318db4c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -916,6 +916,7 @@
"localRecordingVideoWarning": "To record your video you must have it on when starting the recording",
"localRecordingWarning": "Make sure you select the current tab in order to use the right video and audio. The recording is currently limited to 1GB, which is around 100 minutes.",
"loggedIn": "Logged in as {{userName}}",
"noMicPermission": "Microphone track could not be created. Please grant permission to use the microphone.",
"noStreams": "No audio or video stream detected.",
"off": "Recording stopped",
"offBy": "{{name}} stopped the recording",

View File

@ -231,6 +231,11 @@ const LocalRecordingManager: ILocalRecordingManager = {
});
}
// handle no mic permission
if (!getLocalTrack(getTrackState(getState()), MEDIA_TYPE.AUDIO)?.jitsiTrack?.track) {
throw new Error('NoMicTrack');
}
const currentTitle = document.title;
document.title = i18next.t('localRecording.selectTabTitle');

View File

@ -163,6 +163,8 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
} else if (err.message === 'NoLocalStreams') {
descriptionKey = 'recording.noStreams';
} else if (err.message === 'NoMicTrack') {
descriptionKey = 'recording.noMicPermission';
}
const props = {
descriptionKey,