Skip to content

Commit 7cdaf40

Browse files
authored
Fix acs room audio video enabled notifications (#5563)
* Fix acs room capability issue. * Change files * test update * update * Update comment in change log JSON file * Update comment for ACS room notifications fix * test * Revert previous change
1 parent e77a53b commit 7cdaf40

3 files changed

+33
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Hard mute",
5+
"comment": "Fix acs room audio video enabled notifications. when acs user just joined room, should not show the audio video enabled notifications",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Hard mute",
5+
"comment": "Fix acs room audio video enabled notifications. when acs user just joined room, should not show the audio video enabled notifications",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}

packages/calling-stateful-client/src/CapabilitiesSubscriber.ts

+15-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export class CapabilitiesSubscriber {
1414
private _callIdRef: CallIdRef;
1515
private _context: CallContext;
1616
private _capabilitiesFeature: CapabilitiesFeature;
17+
/* @conditional-compile-remove(media-access) */
18+
private _capabilitiesInitialized: boolean = false;
1719

1820
constructor(callIdRef: CallIdRef, context: CallContext, capabilities: CapabilitiesFeature) {
1921
this._callIdRef = callIdRef;
@@ -38,12 +40,19 @@ export class CapabilitiesSubscriber {
3840
}
3941
/* @conditional-compile-remove(media-access) */
4042
this.setUnmuteMicAndTurnVideoOnNotification(data);
43+
44+
/* @conditional-compile-remove(media-access) */
45+
this._capabilitiesInitialized = true;
4146
};
4247

4348
/* @conditional-compile-remove(media-access) */
4449
private setUnmuteMicAndTurnVideoOnNotification = (data: CapabilitiesChangeInfo): void => {
4550
if (data.oldValue.turnVideoOn?.isPresent !== data.newValue.turnVideoOn?.isPresent) {
46-
if (data.oldValue.turnVideoOn?.isPresent === false && data.newValue.turnVideoOn?.isPresent) {
51+
if (
52+
data.oldValue.turnVideoOn?.isPresent === false &&
53+
data.newValue.turnVideoOn?.isPresent &&
54+
this._capabilitiesInitialized
55+
) {
4756
const capabilityTurnVideoOnAbsent = this._context.getState().latestNotifications.capabilityTurnVideoOnAbsent;
4857
if (capabilityTurnVideoOnAbsent) {
4958
this._context.deleteLatestNotification(this._callIdRef.callId, 'capabilityTurnVideoOnAbsent');
@@ -72,7 +81,11 @@ export class CapabilitiesSubscriber {
7281
}
7382
}
7483
if (data.oldValue.unmuteMic?.isPresent !== data.newValue.unmuteMic?.isPresent) {
75-
if (data.oldValue.unmuteMic?.isPresent === false && data.newValue.unmuteMic?.isPresent) {
84+
if (
85+
data.oldValue.unmuteMic?.isPresent === false &&
86+
data.newValue.unmuteMic?.isPresent &&
87+
this._capabilitiesInitialized
88+
) {
7689
const capabilityUnmuteMicAbsent = this._context.getState().latestNotifications.capabilityUnmuteMicAbsent;
7790
if (capabilityUnmuteMicAbsent) {
7891
this._context.deleteLatestNotification(this._callIdRef.callId, 'capabilityUnmuteMicAbsent');

0 commit comments

Comments
 (0)