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(prejoin): Don't add video track to connection on start if video muted

Vlad Piersec3538761543c7
diff --git a/react/features/prejoin/actions.js b/react/features/prejoin/actions.js
index 34a9d0ef13..a43075905a 100644
--- a/react/features/prejoin/actions.js
+++ b/react/features/prejoin/actions.js
@@ -199,14 +199,13 @@ export function initPrejoin(tracks: Object[], errors: Object) {
}
/**
- * Joins the conference.
+ * Action used to start the conference.
*
* @returns {Function}
*/
export function joinConference() {
- return function(dispatch: Function) {
- dispatch(setPrejoinPageVisibility(false));
- dispatch(startConference());
+ return {
+ type: PREJOIN_START_CONFERENCE
};
}
@@ -418,14 +417,3 @@ export function setPrejoinPageVisibility(value: boolean) {
value
};
}
-
-/**
- * Action used to mark the start of the conference.
- *
- * @returns {Object}
- */
-function startConference() {
- return {
- type: PREJOIN_START_CONFERENCE
- };
-}
diff --git a/react/features/prejoin/middleware.js b/react/features/prejoin/middleware.js
index 2b983b15eb..de3363c40f 100644
--- a/react/features/prejoin/middleware.js
+++ b/react/features/prejoin/middleware.js
@@ -2,8 +2,10 @@
import { MiddlewareRegistry } from '../base/redux';
import { updateSettings } from '../base/settings';
+import { getLocalVideoTrack, replaceLocalTrack } from '../base/tracks';
import { PREJOIN_START_CONFERENCE } from './actionTypes';
+import { setPrejoinPageVisibility } from './actions';
declare var APP: Object;
@@ -19,13 +21,20 @@ MiddlewareRegistry.register(store => next => async action => {
const { getState, dispatch } = store;
const state = getState();
const { userSelectedSkipPrejoin } = state['features/prejoin'];
- const tracks = state['features/base/tracks'];
+ const localVideoTrack = getLocalVideoTrack(state['features/base/tracks']);
userSelectedSkipPrejoin && dispatch(updateSettings({
userSelectedSkipPrejoin
}));
- APP.conference.prejoinStart(tracks.map(t => t.jitsiTrack));
+ if (localVideoTrack?.muted) {
+ await dispatch(replaceLocalTrack(localVideoTrack.jitsiTrack, null));
+ }
+
+ const jitsiTracks = getState()['features/base/tracks'].map(t => t.jitsiTrack);
+
+ dispatch(setPrejoinPageVisibility(false));
+ APP.conference.prejoinStart(jitsiTracks);
break;
}