Skip to content

Commit b1189a9

Browse files
Cherry-pick #5328 to 1.20.0 (#5332)
* Make environmentInfo stable - fixes safari speaker issue in stable (#5328) * update changelog * update changelog
1 parent 24de0ef commit b1189a9

28 files changed

Lines changed: 119 additions & 110 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "",
5+
"comment": "Expose environmentInfo in callClient state and callAdapter state",
6+
"packageName": "@azure/communication-react",
7+
"email": "2684369+JamesBurnside@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "improvement",
4+
"workstream": "",
5+
"comment": "On safari, do not show speaker dropdown",
6+
"packageName": "@azure/communication-react",
7+
"email": "2684369+JamesBurnside@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "",
5+
"comment": "Expose environmentInfo in callClient state and callAdapter state",
6+
"packageName": "@azure/communication-react",
7+
"email": "2684369+JamesBurnside@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "improvement",
4+
"workstream": "",
5+
"comment": "On safari, do not show speaker dropdown",
6+
"packageName": "@azure/communication-react",
7+
"email": "2684369+JamesBurnside@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

packages/calling-component-bindings/src/baseSelectors.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
3-
import { CallState, DominantSpeakersInfo } from '@azure/communication-calling';
3+
import { CallState, DominantSpeakersInfo, EnvironmentInfo } from '@azure/communication-calling';
44
/* @conditional-compile-remove(breakout-rooms) */
55
import { BreakoutRoom } from '@azure/communication-calling';
66
import { ParticipantCapabilities } from '@azure/communication-calling';
7-
/* @conditional-compile-remove(unsupported-browser) */
8-
import { EnvironmentInfo } from '@azure/communication-calling';
97
import { ParticipantRole } from '@azure/communication-calling';
108
import { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';
119
import {
@@ -195,12 +193,8 @@ export const getCallState = (state: CallClientState, props: CallingBaseSelectorP
195193
/**
196194
* @private
197195
*/
198-
export const getEnvironmentInfo = (
199-
state: CallClientState
200-
): undefined | /* @conditional-compile-remove(unsupported-browser) */ EnvironmentInfo => {
201-
/* @conditional-compile-remove(unsupported-browser) */
196+
export const getEnvironmentInfo = (state: CallClientState): undefined | EnvironmentInfo => {
202197
return state.environmentInfo;
203-
return undefined;
204198
};
205199

206200
/** @private */

packages/calling-component-bindings/src/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ export type { GetSelector as GetCallingSelector, EmptySelector } from './hooks/u
5858
export { useSelector as useCallingSelector } from './hooks/useSelector';
5959
export { useHandlers as useCallingHandlers } from './hooks/useHandlers';
6060

61-
export { _isInCall, _isPreviewOn, _isInLobbyOrConnecting, _updateUserDisplayNames } from './utils/callUtils';
62-
/* @conditional-compile-remove(unsupported-browser) */
63-
export { _getEnvironmentInfo } from './utils/callUtils';
61+
export {
62+
_isInCall,
63+
_isPreviewOn,
64+
_isInLobbyOrConnecting,
65+
_updateUserDisplayNames,
66+
_getEnvironmentInfo
67+
} from './utils/callUtils';
6468

6569
export { _videoGalleryRemoteParticipantsMemo, _dominantSpeakersWithFlatId } from './utils/videoGalleryUtils';
6670
export type { _VideoGalleryRemoteParticipantsMemoFn } from './utils/videoGalleryUtils';

packages/calling-component-bindings/src/utils/callUtils.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
// Licensed under the MIT License.
33

44
import { DeviceManagerState, RemoteParticipantState, StatefulCallClient } from '@internal/calling-stateful-client';
5-
import { CallState as CallStatus, LocalVideoStream, ParticipantRole } from '@azure/communication-calling';
6-
/* @conditional-compile-remove(unsupported-browser) */
7-
import { Features, EnvironmentInfo } from '@azure/communication-calling';
5+
import {
6+
CallState as CallStatus,
7+
EnvironmentInfo,
8+
Features,
9+
LocalVideoStream,
10+
ParticipantRole
11+
} from '@azure/communication-calling';
812
import {
913
CommunicationIdentifier,
1014
CommunicationUserIdentifier,
@@ -104,7 +108,6 @@ const memoizedUpdateDisplayName = memoizeFnAll((participantId: string, participa
104108
}
105109
});
106110

107-
/* @conditional-compile-remove(unsupported-browser) */
108111
/**
109112
* Check whether the call is in a supported browser
110113
*

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import { CaptionsKind } from '@azure/communication-calling';
3939
import { VideoEffectName } from '@azure/communication-calling';
4040
/* @conditional-compile-remove(teams-identity-support) */
4141
import { CallKind } from '@azure/communication-calling';
42-
/* @conditional-compile-remove(unsupported-browser) */
4342
import { EnvironmentInfo } from '@azure/communication-calling';
4443
import { CommunicationIdentifierKind } from '@azure/communication-common';
4544
import { ReactionMessage } from '@azure/communication-calling';
@@ -962,7 +961,6 @@ export interface CallClientState {
962961
* be used as the caller id in the PSTN call.
963962
*/
964963
alternateCallerId?: string;
965-
/* @conditional-compile-remove(unsupported-browser) */
966964
/**
967965
* state to track the environment that the stateful client was made in is supported
968966
*/
@@ -1052,7 +1050,7 @@ export type CallErrorTarget =
10521050
| 'CallClient.createTeamsCallAgent'
10531051
| 'CallClient.feature'
10541052
| 'CallClient.getDeviceManager'
1055-
| /* @conditional-compile-remove(calling-beta-sdk) */ 'CallClient.getEnvironmentInfo'
1053+
| 'CallClient.getEnvironmentInfo'
10561054
| 'DeviceManager.askDevicePermission'
10571055
| 'DeviceManager.getCameras'
10581056
| 'DeviceManager.getMicrophones'

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { CapabilitiesChangeInfo, ParticipantCapabilities } from '@azure/communic
2121
import { TeamsCaptionsInfo } from '@azure/communication-calling';
2222

2323
import { CaptionsKind, CaptionsInfo as AcsCaptionsInfo } from '@azure/communication-calling';
24-
/* @conditional-compile-remove(unsupported-browser) */
2524
import { EnvironmentInfo } from '@azure/communication-calling';
2625
/* @conditional-compile-remove(together-mode) */
2726
import { TogetherModeVideoStream } from '@azure/communication-calling';
@@ -110,7 +109,7 @@ export class CallContext {
110109
},
111110
callAgent: undefined,
112111
userId: userId,
113-
/* @conditional-compile-remove(unsupported-browser) */ environmentInfo: undefined,
112+
environmentInfo: undefined,
114113
latestErrors: {} as CallErrors,
115114
/* @conditional-compile-remove(breakout-rooms) */ latestNotifications: {} as CallNotifications
116115
};
@@ -257,7 +256,6 @@ export class CallContext {
257256
});
258257
}
259258

260-
/* @conditional-compile-remove(unsupported-browser) */
261259
public setEnvironmentInfo(envInfo: EnvironmentInfo): void {
262260
this.modifyState((draft: CallClientState) => {
263261
draft.environmentInfo = envInfo;

packages/calling-stateful-client/src/StatefulCallClient.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ describe('errors should be reported correctly from StatefulCallClient when', ()
576576
await expect(client.createCallAgent(stubCommunicationTokenCredential())).rejects.toThrow(
577577
new CallError('CallClient.createCallAgent', new Error('injected error'))
578578
);
579-
expect(listener.onChangeCalledCount).toBe(1);
579+
expect(listener.onChangeCalledCount).toBe(2);
580580
expect(client.getState().latestErrors['CallClient.createCallAgent']).toBeDefined();
581581
});
582582

@@ -592,7 +592,7 @@ describe('errors should be reported correctly from StatefulCallClient when', ()
592592
await expect(client.getDeviceManager()).rejects.toThrow(
593593
new CallError('CallClient.getDeviceManager', new Error('injected error'))
594594
);
595-
expect(listener.onChangeCalledCount).toBe(1);
595+
expect(listener.onChangeCalledCount).toBe(2);
596596
expect(client.getState().latestErrors['CallClient.getDeviceManager']).toBeDefined();
597597
});
598598
});

0 commit comments

Comments
 (0)