Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "Hard mute",
"comment": "Fix acs room audio video enabled notifications. when acs user just joined room, should not show the audio video enabled notifications",
"packageName": "@azure/communication-react",
"email": "fuyan@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "Hard mute",
"comment": "Fix acs room audio video enabled notifications. when acs user just joined room, should not show the audio video enabled notifications",
"packageName": "@azure/communication-react",
"email": "fuyan@microsoft.com",
"dependentChangeType": "patch"
}
17 changes: 15 additions & 2 deletions packages/calling-stateful-client/src/CapabilitiesSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export class CapabilitiesSubscriber {
private _callIdRef: CallIdRef;
private _context: CallContext;
private _capabilitiesFeature: CapabilitiesFeature;
/* @conditional-compile-remove(media-access) */
private _capabilitiesInitialized: boolean = false;

constructor(callIdRef: CallIdRef, context: CallContext, capabilities: CapabilitiesFeature) {
this._callIdRef = callIdRef;
Expand All @@ -38,12 +40,19 @@ export class CapabilitiesSubscriber {
}
/* @conditional-compile-remove(media-access) */
this.setUnmuteMicAndTurnVideoOnNotification(data);

/* @conditional-compile-remove(media-access) */
this._capabilitiesInitialized = true;
};

/* @conditional-compile-remove(media-access) */
private setUnmuteMicAndTurnVideoOnNotification = (data: CapabilitiesChangeInfo): void => {
if (data.oldValue.turnVideoOn?.isPresent !== data.newValue.turnVideoOn?.isPresent) {
if (data.oldValue.turnVideoOn?.isPresent === false && data.newValue.turnVideoOn?.isPresent) {
if (
data.oldValue.turnVideoOn?.isPresent === false &&
data.newValue.turnVideoOn?.isPresent &&
this._capabilitiesInitialized
) {
const capabilityTurnVideoOnAbsent = this._context.getState().latestNotifications.capabilityTurnVideoOnAbsent;
if (capabilityTurnVideoOnAbsent) {
this._context.deleteLatestNotification(this._callIdRef.callId, 'capabilityTurnVideoOnAbsent');
Expand Down Expand Up @@ -72,7 +81,11 @@ export class CapabilitiesSubscriber {
}
}
if (data.oldValue.unmuteMic?.isPresent !== data.newValue.unmuteMic?.isPresent) {
if (data.oldValue.unmuteMic?.isPresent === false && data.newValue.unmuteMic?.isPresent) {
if (
data.oldValue.unmuteMic?.isPresent === false &&
data.newValue.unmuteMic?.isPresent &&
this._capabilitiesInitialized
) {
const capabilityUnmuteMicAbsent = this._context.getState().latestNotifications.capabilityUnmuteMicAbsent;
if (capabilityUnmuteMicAbsent) {
this._context.deleteLatestNotification(this._callIdRef.callId, 'capabilityUnmuteMicAbsent');
Expand Down