From aa04692e9b31ec0711b4226ba2c4dc620ea2edb0 Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Mon, 22 Apr 2024 15:42:12 -0500 Subject: [PATCH] feat(visitors): enableMediaOnPromote option for mobile. --- react/features/base/conference/actions.ts | 58 +++++++++++------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/react/features/base/conference/actions.ts b/react/features/base/conference/actions.ts index 553e1194f2..aa82a08f22 100644 --- a/react/features/base/conference/actions.ts +++ b/react/features/base/conference/actions.ts @@ -1064,41 +1064,41 @@ export function redirect(vnode: string, focusJid: string, username: string) { // conference without tracks. dispatch(gumPending([ MEDIA_TYPE.AUDIO, MEDIA_TYPE.VIDEO ], IGUMPendingState.NONE)); - // FIXME: Workaround for the web version. To be removed once we get rid of conference.js - if (typeof APP !== 'undefined') { - if (!vnode) { - const state = getState(); - const { enableMediaOnPromote = {} } = state['features/base/config'].visitors ?? {}; - const { audio = false, video = false } = enableMediaOnPromote; + if (!vnode) { + const state = getState(); + const { enableMediaOnPromote = {} } = state['features/base/config'].visitors ?? {}; + const { audio = false, video = false } = enableMediaOnPromote; - if (audio) { - const { available, muted, unmuteBlocked } = state['features/base/media'].audio; - const { startSilent } = state['features/base/config']; + if (audio) { + const { available, muted, unmuteBlocked } = state['features/base/media'].audio; + const { startSilent } = state['features/base/config']; - // do not unmute the user if he was muted before (on the prejoin, the config - // or URL param, etc.) - if (!unmuteBlocked && !muted && !startSilent && available) { - dispatch(setAudioMuted(false, true)); + // do not unmute the user if he was muted before (on the prejoin, the config + // or URL param, etc.) + if (!unmuteBlocked && !muted && !startSilent && available) { + dispatch(setAudioMuted(false, true)); - // // FIXME: The old conference logic still relies on this event being emitted. - typeof APP === 'undefined' || APP.conference.muteAudio(false); - } - } - - if (video) { - const { muted, unmuteBlocked } = state['features/base/media'].video; - - // do not unmute the user if he was muted before (on the prejoin, the config, URL param or - // audo only, etc) - if (!unmuteBlocked && !muted && hasAvailableDevices(state, 'videoInput')) { - dispatch(setVideoMuted(false, VIDEO_MUTISM_AUTHORITY.USER, true)); - - // // FIXME: The old conference logic still relies on this event being emitted. - typeof APP === 'undefined' || APP.conference.muteVideo(false, false); - } + // // FIXME: The old conference logic still relies on this event being emitted. + typeof APP === 'undefined' || APP.conference.muteAudio(false); } } + if (video) { + const { muted, unmuteBlocked } = state['features/base/media'].video; + + // do not unmute the user if he was muted before (on the prejoin, the config, URL param or + // audo only, etc) + if (!unmuteBlocked && !muted && hasAvailableDevices(state, 'videoInput')) { + dispatch(setVideoMuted(false, VIDEO_MUTISM_AUTHORITY.USER, true)); + + // // FIXME: The old conference logic still relies on this event being emitted. + typeof APP === 'undefined' || APP.conference.muteVideo(false, false); + } + } + } + + // FIXME: Workaround for the web version. To be removed once we get rid of conference.js + if (typeof APP !== 'undefined') { APP.conference.startConference([]); } });