fix(start-silent) Disable AOT mic and unmute notif when start silent

This commit is contained in:
Horatiu Muresan 2022-04-18 16:19:19 +03:00 committed by Horatiu Muresan
parent 045bd44407
commit 8f641b7bb1
5 changed files with 21 additions and 5 deletions

View File

@ -725,6 +725,9 @@ function initCommands() {
case 'is-sharing-screen':
callback(Boolean(APP.conference.isSharingScreen));
break;
case 'is-start-silent':
callback(Boolean(APP.store.getState()['features/base/config'].startSilent));
break;
case 'get-content-sharing-participants': {
const tracks = getState()['features/base/tracks'];
const sharingParticipantIds = tracks.filter(tr => tr.videoType === 'desktop').map(t => t.participantId);

View File

@ -978,6 +978,17 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
});
}
/**
* Returns wether meeting is started silent.
*
* @returns {Promise} - Resolves with start silent status.
*/
isStartSilent() {
return this._transport.sendRequest({
name: 'is-start-silent'
});
}
/**
* Returns the avatar URL of a participant.
*

View File

@ -68,11 +68,12 @@ export default class AudioMuteButton extends Component<Props, State> {
Promise.all([
api.isAudioAvailable(),
api.isAudioMuted()
api.isAudioMuted(),
api.isStartSilent()
])
.then(([ audioAvailable, audioMuted ]) =>
.then(([ audioAvailable, audioMuted, startSilent ]) =>
this.setState({
audioAvailable,
audioAvailable: audioAvailable && !startSilent,
audioMuted
}))
.catch(console.error);

View File

@ -157,7 +157,7 @@ class AudioMuteButton extends AbstractAudioMuteButton<Props, *> {
*/
function _mapStateToProps(state): Object {
const _audioMuted = isLocalTrackMuted(state['features/base/tracks'], MEDIA_TYPE.AUDIO);
const _disabled = state['features/base/config'].startSilent || isAudioMuteButtonDisabled(state);
const _disabled = isAudioMuteButtonDisabled(state);
const enabledFlag = getFeatureFlag(state, AUDIO_MUTE_BUTTON_ENABLED, true);
return {

View File

@ -8,6 +8,7 @@
*/
export function isAudioMuteButtonDisabled(state: Object) {
const { available, muted, unmuteBlocked } = state['features/base/media'].audio;
const { startSilent } = state['features/base/config'];
return !available || (muted && unmuteBlocked);
return !available || startSilent || (muted && unmuteBlocked);
}