Skip to content

Commit 5c5af52

Browse files
[Calling sounds] Stabilize Calling sounds feature (#3969)
* stabilize sounds * Change files * Duplicate change files for beta release * build beta API * fix breaking change * build API files * update stable API --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>
1 parent 6640946 commit 5c5af52

10 files changed

Lines changed: 75 additions & 20 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "minor",
3+
"area": "feature",
4+
"workstream": "Calling sounds",
5+
"comment": "Stabilize the Calling sounds feature",
6+
"packageName": "@azure/communication-react",
7+
"email": "94866715+dmceachernmsft@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": "minor",
3+
"area": "feature",
4+
"workstream": "Calling sounds",
5+
"comment": "Stabilize the Calling sounds feature",
6+
"packageName": "@azure/communication-react",
7+
"email": "94866715+dmceachernmsft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

common/config/babel/features.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ module.exports = {
101101
"gallery-layout-composite",
102102
// feature for hiding attendee name in the teams meeting
103103
"hide-attendee-name",
104-
// Feature for sounds during different calling events
105-
"calling-sounds",
104+
// custom branding for the composites
105+
"custom-branding",
106106
// Feature for end of call survey
107107
'end-of-call-survey',
108108
// Feature for the DTMF dialer for Teams voice apps
@@ -140,5 +140,7 @@ module.exports = {
140140
"control-bar-button-injection",
141141
// rooms
142142
"rooms",
143+
// feature for calling sounds
144+
"calling-sounds",
143145
]
144146
}

packages/communication-react/review/beta/communication-react.api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ export interface CallCompositeStrings {
636636
blurBackgroundEffectButtonLabel?: string;
637637
blurBackgroundTooltip?: string;
638638
callRejectedMoreDetails?: string;
639-
callRejectedTitle: string;
639+
callRejectedTitle?: string;
640640
callTimeoutDetails?: string;
641641
callTimeoutTitle?: string;
642642
cameraLabel: string;
@@ -857,7 +857,7 @@ export type CallingHandlersOptions = {
857857
// @public
858858
export type CallingReturnProps<Component extends (props: any) => JSX.Element> = GetCallingSelector<Component> extends (state: CallClientState, props: any) => any ? ReturnType<GetCallingSelector<Component>> & Common<CallingHandlers, Parameters<Component>[0]> : never;
859859

860-
// @beta
860+
// @public
861861
export type CallingSounds = {
862862
callEnded?: SoundEffect;
863863
callRinging?: SoundEffect;
@@ -3786,7 +3786,7 @@ export interface SitePermissionsStyles extends BaseCustomStyles {
37863786
troubleshootingLink?: ILinkStyles;
37873787
}
37883788

3789-
// @beta
3789+
// @public
37903790
export type SoundEffect = {
37913791
url: string;
37923792
};

packages/communication-react/review/stable/communication-react.api.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ export type CallAdapterClientState = {
252252
userId: CommunicationIdentifierKind;
253253
displayName?: string;
254254
call?: CallState;
255+
targetCallees?: CommunicationIdentifier[];
255256
devices: DeviceManagerState;
256257
endedCall?: CallState;
257258
isTeamsCall: boolean;
@@ -261,6 +262,7 @@ export type CallAdapterClientState = {
261262
videoBackgroundImages?: VideoBackgroundImage[];
262263
onResolveVideoEffectDependency?: () => Promise<VideoBackgroundEffectsDependency>;
263264
selectedVideoBackgroundEffect?: VideoBackgroundEffect;
265+
sounds?: CallingSounds;
264266
};
265267

266268
// @public
@@ -426,6 +428,7 @@ export type CallCompositeIcons = {
426428
NoticePageJoinCallFailedDueToNoNetwork?: JSX.Element;
427429
NoticePageLeftCall?: JSX.Element;
428430
NoticePageRemovedFromCall?: JSX.Element;
431+
NoticePageCallRejected?: JSX.Element;
429432
NoticePageNotInvitedToRoom?: JSX.Element;
430433
NoticePageRoomNotFound?: JSX.Element;
431434
NoticePageRoomNotValid?: JSX.Element;
@@ -477,6 +480,8 @@ export interface CallCompositeProps extends BaseCompositeProps<CallCompositeIcon
477480
export interface CallCompositeStrings {
478481
blurBackgroundEffectButtonLabel?: string;
479482
blurBackgroundTooltip?: string;
483+
callRejectedMoreDetails?: string;
484+
callRejectedTitle?: string;
480485
callTimeoutDetails?: string;
481486
callTimeoutTitle?: string;
482487
cameraLabel: string;
@@ -649,6 +654,13 @@ export type CallingHandlersOptions = {
649654
// @public
650655
export type CallingReturnProps<Component extends (props: any) => JSX.Element> = GetCallingSelector<Component> extends (state: CallClientState, props: any) => any ? ReturnType<GetCallingSelector<Component>> & Common<CallingHandlers, Parameters<Component>[0]> : never;
651656

657+
// @public
658+
export type CallingSounds = {
659+
callEnded?: SoundEffect;
660+
callRinging?: SoundEffect;
661+
callBusy?: SoundEffect;
662+
};
663+
652664
// @public
653665
export interface CallingTheme {
654666
// (undocumented)
@@ -1467,6 +1479,7 @@ export type CommonCallAdapterOptions = {
14671479
videoBackgroundImages?: VideoBackgroundImage[];
14681480
onResolveDependency?: () => Promise<VideoBackgroundEffectsDependency>;
14691481
};
1482+
callingSounds?: CallingSounds;
14701483
};
14711484

14721485
// @public
@@ -2022,6 +2035,7 @@ export const DEFAULT_COMPOSITE_ICONS: {
20222035
NoticePageJoinCallFailedDueToNoNetwork?: JSX.Element | undefined;
20232036
NoticePageLeftCall?: JSX.Element | undefined;
20242037
NoticePageRemovedFromCall?: JSX.Element | undefined;
2038+
NoticePageCallRejected?: JSX.Element | undefined;
20252039
NoticePageNotInvitedToRoom?: JSX.Element | undefined;
20262040
NoticePageRoomNotFound?: JSX.Element | undefined;
20272041
NoticePageRoomNotValid?: JSX.Element | undefined;
@@ -3034,6 +3048,11 @@ export interface SendBoxStylesProps extends BaseCustomStyles {
30343048
textFieldContainer?: IStyle;
30353049
}
30363050

3051+
// @public
3052+
export type SoundEffect = {
3053+
url: string;
3054+
};
3055+
30373056
// @public
30383057
export interface SpokenLanguageStrings {
30393058
// (undocumented)

packages/react-composites/review/beta/react-composites.api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ export interface CallCompositeStrings {
454454
blurBackgroundEffectButtonLabel?: string;
455455
blurBackgroundTooltip?: string;
456456
callRejectedMoreDetails?: string;
457-
callRejectedTitle: string;
457+
callRejectedTitle?: string;
458458
callTimeoutDetails?: string;
459459
callTimeoutTitle?: string;
460460
cameraLabel: string;
@@ -635,7 +635,7 @@ export type CallIdChangedListener = (event: {
635635
callId: string;
636636
}) => void;
637637

638-
// @beta
638+
// @public
639639
export type CallingSounds = {
640640
callEnded?: SoundEffect;
641641
callRinging?: SoundEffect;
@@ -1848,7 +1848,7 @@ export interface RemoteVideoTileMenuOptions {
18481848
isHidden?: boolean;
18491849
}
18501850

1851-
// @beta
1851+
// @public
18521852
export type SoundEffect = {
18531853
url: string;
18541854
};

packages/react-composites/review/stable/react-composites.api.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import type { ChatMessage } from '@azure/communication-chat';
2020
import { ChatParticipant } from '@azure/communication-chat';
2121
import { ChatThreadClient } from '@azure/communication-chat';
2222
import { ChatThreadClientState } from '@internal/chat-stateful-client';
23+
import { CommunicationIdentifier } from '@azure/communication-common';
2324
import { CommunicationIdentifierKind } from '@azure/communication-common';
2425
import { CommunicationParticipant } from '@internal/react-components';
2526
import { CommunicationTokenCredential } from '@azure/communication-common';
@@ -201,6 +202,7 @@ export type CallAdapterClientState = {
201202
userId: CommunicationIdentifierKind;
202203
displayName?: string;
203204
call?: CallState;
205+
targetCallees?: CommunicationIdentifier[];
204206
devices: DeviceManagerState;
205207
endedCall?: CallState;
206208
isTeamsCall: boolean;
@@ -210,6 +212,7 @@ export type CallAdapterClientState = {
210212
videoBackgroundImages?: VideoBackgroundImage[];
211213
onResolveVideoEffectDependency?: () => Promise<VideoBackgroundEffectsDependency>;
212214
selectedVideoBackgroundEffect?: VideoBackgroundEffect;
215+
sounds?: CallingSounds;
213216
};
214217

215218
// @public
@@ -328,6 +331,7 @@ export type CallCompositeIcons = {
328331
NoticePageJoinCallFailedDueToNoNetwork?: JSX.Element;
329332
NoticePageLeftCall?: JSX.Element;
330333
NoticePageRemovedFromCall?: JSX.Element;
334+
NoticePageCallRejected?: JSX.Element;
331335
NoticePageNotInvitedToRoom?: JSX.Element;
332336
NoticePageRoomNotFound?: JSX.Element;
333337
NoticePageRoomNotValid?: JSX.Element;
@@ -379,6 +383,8 @@ export interface CallCompositeProps extends BaseCompositeProps<CallCompositeIcon
379383
export interface CallCompositeStrings {
380384
blurBackgroundEffectButtonLabel?: string;
381385
blurBackgroundTooltip?: string;
386+
callRejectedMoreDetails?: string;
387+
callRejectedTitle?: string;
382388
callTimeoutDetails?: string;
383389
callTimeoutTitle?: string;
384390
cameraLabel: string;
@@ -511,6 +517,13 @@ export type CallIdChangedListener = (event: {
511517
callId: string;
512518
}) => void;
513519

520+
// @public
521+
export type CallingSounds = {
522+
callEnded?: SoundEffect;
523+
callRinging?: SoundEffect;
524+
callBusy?: SoundEffect;
525+
};
526+
514527
// @public
515528
export interface CallWithChatAdapter extends CallWithChatAdapterManagement, AdapterState<CallWithChatAdapterState>, Disposable_2, CallWithChatAdapterSubscriptions {
516529
}
@@ -964,6 +977,7 @@ export type CommonCallAdapterOptions = {
964977
videoBackgroundImages?: VideoBackgroundImage[];
965978
onResolveDependency?: () => Promise<VideoBackgroundEffectsDependency>;
966979
};
980+
callingSounds?: CallingSounds;
967981
};
968982

969983
// @public
@@ -1191,6 +1205,7 @@ export const DEFAULT_COMPOSITE_ICONS: {
11911205
NoticePageJoinCallFailedDueToNoNetwork?: JSX.Element | undefined;
11921206
NoticePageLeftCall?: JSX.Element | undefined;
11931207
NoticePageRemovedFromCall?: JSX.Element | undefined;
1208+
NoticePageCallRejected?: JSX.Element | undefined;
11941209
NoticePageNotInvitedToRoom?: JSX.Element | undefined;
11951210
NoticePageRoomNotFound?: JSX.Element | undefined;
11961211
NoticePageRoomNotValid?: JSX.Element | undefined;
@@ -1506,6 +1521,11 @@ export interface RemoteVideoTileMenuOptions {
15061521
isHidden?: boolean;
15071522
}
15081523

1524+
// @public
1525+
export type SoundEffect = {
1526+
url: string;
1527+
};
1528+
15091529
// @public
15101530
export type TeamsAdapterOptions = CommonCallAdapterOptions;
15111531

packages/react-composites/src/composites/CallComposite/Strings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ export interface CallCompositeStrings {
749749
/**
750750
* String for title when the call is rejected by the callee
751751
*/
752-
callRejectedTitle: string;
752+
callRejectedTitle?: string;
753753
/* @conditional-compile-remove(calling-sounds) */
754754
/**
755755
* String for more details when the call is rejected by the callee

packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Adapter is created as expected', () => {
1919
const mockCallClient = new MockCallClient() as unknown as StatefulCallClient;
2020

2121
const mockCallAgent = new MockCallAgent();
22-
const locator = { participantIds: ['some user id'] };
22+
const locator = { groupId: 'some group id' };
2323

2424
const adapter = await createAzureCommunicationCallAdapterFromClient(mockCallClient, mockCallAgent, locator);
2525
expect(adapter).toBeDefined();
@@ -30,7 +30,7 @@ describe('Adapter is created as expected', () => {
3030
const mockCallClient = new MockCallClient() as unknown as StatefulCallClient;
3131

3232
const mockCallAgent = new MockCallAgent();
33-
const locator = { participantIds: ['some user id'] };
33+
const locator = { groupId: 'some group id' };
3434
const options: CommonCallAdapterOptions = {
3535
callingSounds: {
3636
callEnded: { url: 'test/url/ended' },
@@ -59,7 +59,7 @@ describe('Adapter is created as expected', () => {
5959
const mockCallClient = new MockCallClient() as unknown as StatefulCallClient;
6060

6161
const mockCallAgent = new MockCallAgent();
62-
const locator = { participantIds: ['some user id'] };
62+
const locator = { groupId: 'some group id' };
6363
const options: CommonCallAdapterOptions = {
6464
callingSounds: {
6565
callEnded: { url: 'test/url/ended' }

packages/react-composites/src/composites/CallComposite/adapter/CallAdapter.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@ import { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react
3131
import type { CommunicationIdentifierKind } from '@azure/communication-common';
3232
/* @conditional-compile-remove(PSTN-calls) */
3333
import { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';
34-
34+
import { CommunicationIdentifier } from '@azure/communication-common';
3535
/* @conditional-compile-remove(PSTN-calls) */
36-
import type {
37-
CommunicationIdentifier,
38-
CommunicationUserIdentifier,
39-
PhoneNumberIdentifier
40-
} from '@azure/communication-common';
36+
import type { CommunicationUserIdentifier, PhoneNumberIdentifier } from '@azure/communication-common';
4137
import type { AdapterState, Disposable, AdapterError, AdapterErrors } from '../../common/adapters';
4238
/* @conditional-compile-remove(video-background-effects) */
4339
import { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings';
@@ -285,7 +281,7 @@ export interface VideoBackgroundImage {
285281
}
286282

287283
/**
288-
* @beta
284+
* @public
289285
* Type for representing a custom sound to use for a calling event
290286
*/
291287
export type SoundEffect = {
@@ -296,7 +292,7 @@ export type SoundEffect = {
296292
};
297293

298294
/**
299-
* @beta
295+
* @public
300296
* Type for representing a set of sounds to use for different calling events
301297
*/
302298
export type CallingSounds = {

0 commit comments

Comments
 (0)