Compare commits

...

2 Commits

Author SHA1 Message Date
Horatiu Muresan 96e72c8339 fix 2022-04-26 13:43:10 +03:00
Horatiu Muresan eccf973972 fix(always-on-top) Fix audio mute button disabled status 2022-04-26 12:53:19 +03:00
4 changed files with 20 additions and 4 deletions

View File

@ -88,6 +88,7 @@ import { isScreenshotCaptureEnabled } from '../../react/features/screenshot-capt
import { playSharedVideo, stopSharedVideo } from '../../react/features/shared-video/actions.any';
import { extractYoutubeIdOrURL } from '../../react/features/shared-video/functions';
import { toggleRequestingSubtitles, setRequestingSubtitles } from '../../react/features/subtitles/actions';
import { isAudioMuteButtonDisabled } from '../../react/features/toolbox/functions';
import { toggleTileView, setTileView } from '../../react/features/video-layout';
import { muteAllParticipants } from '../../react/features/video-menu/actions';
import { setVideoQuality } from '../../react/features/video-quality';
@ -700,6 +701,9 @@ function initCommands() {
case 'is-audio-muted':
callback(APP.conference.isLocalAudioMuted());
break;
case 'is-audio-disabled':
callback(isAudioMuteButtonDisabled(APP.store.getState()));
break;
case 'is-moderation-on': {
const { mediaType } = request;
const type = mediaType || MEDIA_TYPE.AUDIO;

View File

@ -927,6 +927,18 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
});
}
/**
* Returns the audio disabled status.
*
* @returns {Promise} - Resolves with the audio disabled status and rejects on
* failure.
*/
isAudioDisabled() {
return this._transport.sendRequest({
name: 'is-audio-disabled'
});
}
/**
* Returns the moderation on status on the given mediaType.
*

View File

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

View File

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