2022-09-14 12:48:09 +00:00
|
|
|
import { IState } from '../app/types';
|
2021-11-30 20:08:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates if the audio mute button is disabled or not.
|
|
|
|
*
|
2022-09-14 12:48:09 +00:00
|
|
|
* @param {IState} state - The state from the Redux store.
|
2021-11-30 20:08:25 +00:00
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
2022-09-14 12:48:09 +00:00
|
|
|
export function isAudioMuteButtonDisabled(state: IState) {
|
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
|
|
|
}
|