Fix media device handling.
This commit is contained in:
+21
-7
@@ -652,9 +652,15 @@ export default class RoomClient
|
|||||||
{
|
{
|
||||||
logger.debug('muteMic()');
|
logger.debug('muteMic()');
|
||||||
|
|
||||||
|
this._micProducer.pause();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this._micProducer.pause();
|
await this.sendRequest(
|
||||||
|
'pauseProducer', { producerId: this._micProducer.id });
|
||||||
|
|
||||||
|
store.dispatch(
|
||||||
|
stateActions.setProducerPaused(this._micProducer.id));
|
||||||
}
|
}
|
||||||
catch (error)
|
catch (error)
|
||||||
{
|
{
|
||||||
@@ -672,14 +678,21 @@ export default class RoomClient
|
|||||||
{
|
{
|
||||||
logger.debug('unmuteMic()');
|
logger.debug('unmuteMic()');
|
||||||
|
|
||||||
|
if (!this._micProducer)
|
||||||
|
{
|
||||||
|
this.enableMic();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._micProducer.resume();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (this._micProducer)
|
await this.sendRequest(
|
||||||
this._micProducer.resume();
|
'resumeProducer', { producerId: this._micProducer.id });
|
||||||
else if (this._room.canSend('audio'))
|
|
||||||
await this.enableMic();
|
store.dispatch(
|
||||||
else
|
stateActions.setProducerResumed(this._micProducer.id));
|
||||||
throw new Error('cannot send audio');
|
|
||||||
}
|
}
|
||||||
catch (error)
|
catch (error)
|
||||||
{
|
{
|
||||||
@@ -692,6 +705,7 @@ export default class RoomClient
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Updated consumers based on spotlights
|
// Updated consumers based on spotlights
|
||||||
async updateSpotlights(spotlights)
|
async updateSpotlights(spotlights)
|
||||||
|
|||||||
Reference in New Issue
Block a user