Fix mute/unmute mic.
parent
819bd64948
commit
2aa6166f6b
|
|
@ -78,11 +78,16 @@ const Sidebar = (props) =>
|
||||||
|
|
||||||
let micTip;
|
let micTip;
|
||||||
|
|
||||||
if (!me.canSendMic || !micProducer)
|
if (!me.canSendMic)
|
||||||
{
|
{
|
||||||
micState = 'unsupported';
|
micState = 'unsupported';
|
||||||
micTip = 'Audio unsupported';
|
micTip = 'Audio unsupported';
|
||||||
}
|
}
|
||||||
|
else if (!micProducer)
|
||||||
|
{
|
||||||
|
micState = 'off';
|
||||||
|
micTip = 'Activate audio';
|
||||||
|
}
|
||||||
else if (!micProducer.locallyPaused && !micProducer.remotelyPaused)
|
else if (!micProducer.locallyPaused && !micProducer.remotelyPaused)
|
||||||
{
|
{
|
||||||
micState = 'on';
|
micState = 'on';
|
||||||
|
|
@ -90,7 +95,7 @@ const Sidebar = (props) =>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
micState = 'off';
|
micState = 'muted';
|
||||||
micTip = 'Unmute audio';
|
micTip = 'Unmute audio';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -152,9 +157,12 @@ const Sidebar = (props) =>
|
||||||
size={smallScreen ? 'large' : 'medium'}
|
size={smallScreen ? 'large' : 'medium'}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
{
|
{
|
||||||
micState === 'on' ?
|
if (micState === 'off')
|
||||||
roomClient.disableMic() :
|
|
||||||
roomClient.enableMic();
|
roomClient.enableMic();
|
||||||
|
else if (micState === 'on')
|
||||||
|
roomClient.muteMic();
|
||||||
|
else
|
||||||
|
roomClient.unmuteMic();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{ micState === 'on' ?
|
{ micState === 'on' ?
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue