Group calling: disable local camera when call disconnects

This commit is contained in:
Evan Hahn 2020-11-23 11:31:58 -06:00 committed by Josh Perez
parent 34574583b6
commit 7b6ad345ae

View file

@ -390,14 +390,16 @@ export class CallingClass {
if ( if (
localDeviceState.connectionState === ConnectionState.NotConnected localDeviceState.connectionState === ConnectionState.NotConnected
) { ) {
if (localDeviceState.videoMuted) { // NOTE: This assumes that only one call is active at a time. For example, if
this.disableLocalCamera(); // there are two calls using the camera, this will disable both of them.
} // That's fine for now, but this will break if that assumption changes.
this.disableLocalCamera();
delete this.callsByConversation[conversationId]; delete this.callsByConversation[conversationId];
} else { } else {
this.callsByConversation[conversationId] = groupCall; this.callsByConversation[conversationId] = groupCall;
// NOTE: This assumes only one active call at a time. See comment above.
if (localDeviceState.videoMuted) { if (localDeviceState.videoMuted) {
this.disableLocalCamera(); this.disableLocalCamera();
} else { } else {