2021-11-30 20:08:25 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates if the audio mute button is disabled or not.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The state from the Redux store.
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
export function isAudioMuteButtonDisabled(state: Object) {
|
2021-12-07 21:48:12 +00:00
|
|
|
const { available, muted, unmuteBlocked } = state['features/base/media'].audio;
|
2022-04-18 13:19:19 +00:00
|
|
|
const { startSilent } = state['features/base/config'];
|
2021-11-30 20:08:25 +00:00
|
|
|
|
2022-04-26 12:32:18 +00:00
|
|
|
return Boolean(!available || startSilent || (muted && unmuteBlocked));
|
2021-11-30 20:08:25 +00:00
|
|
|
}
|