Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix: Fixes start A/V muted after going to welcome page. Fixes #11393. (#13726)

Дамян Минковb31041f0cefb
diff --git a/react/features/base/media/middleware.any.ts b/react/features/base/media/middleware.any.ts
index 30dd18def2..ada07fd2ad 100644
--- a/react/features/base/media/middleware.any.ts
+++ b/react/features/base/media/middleware.any.ts
@@ -220,21 +220,22 @@ function _setRoom({ dispatch, getState }: IStore, next: Function, action: AnyAct
const state = getState();
const { room } = action;
const roomIsValid = isRoomValid(room);
- const audioMuted = roomIsValid ? getStartWithAudioMuted(state) : _AUDIO_INITIAL_MEDIA_STATE.muted;
- const videoMuted = roomIsValid ? getStartWithVideoMuted(state) : _VIDEO_INITIAL_MEDIA_STATE.muted;
-
- sendAnalytics(
- createStartMutedConfigurationEvent('local', audioMuted, Boolean(videoMuted)));
- logger.log(
- `Start muted: ${audioMuted ? 'audio, ' : ''}${
- videoMuted ? 'video' : ''}`);
-
- // Unconditionally express the desires/expectations/intents of the app and
- // the user i.e. the state of base/media. Eventually, practice/reality i.e.
- // the state of base/tracks will or will not agree with the desires.
- dispatch(setAudioMuted(audioMuted));
- dispatch(setCameraFacingMode(CAMERA_FACING_MODE.USER));
- dispatch(setVideoMuted(videoMuted));
+
+ // when going to welcomepage on web(room is not valid) we want to skip resetting the values of startWithA/V
+ if (roomIsValid || navigator.product === 'ReactNative') {
+ const audioMuted = roomIsValid ? getStartWithAudioMuted(state) : _AUDIO_INITIAL_MEDIA_STATE.muted;
+ const videoMuted = roomIsValid ? getStartWithVideoMuted(state) : _VIDEO_INITIAL_MEDIA_STATE.muted;
+
+ sendAnalytics(createStartMutedConfigurationEvent('local', audioMuted, Boolean(videoMuted)));
+ logger.log(`Start muted: ${audioMuted ? 'audio, ' : ''}${videoMuted ? 'video' : ''}`);
+
+ // Unconditionally express the desires/expectations/intents of the app and
+ // the user i.e. the state of base/media. Eventually, practice/reality i.e.
+ // the state of base/tracks will or will not agree with the desires.
+ dispatch(setAudioMuted(audioMuted));
+ dispatch(setCameraFacingMode(CAMERA_FACING_MODE.USER));
+ dispatch(setVideoMuted(videoMuted));
+ }
// startAudioOnly
//