Skip to content

Commit ec85da3

Browse files
carocao-msftdmceachernmsftpalatterJamesBurnsidegithub-actions[bot]
authored
Stateful client changes (#2826)
* [VerticalGalleries] vertical gallery component (#2764) * Create component * add component for control bar * Add some base styles, add bucketize * add CC label and nav button icons * update API docs for initial component * Change files * Duplicate change files for beta release * extract bucketize to utils file * update useEffect deps * fix lint * update styles comment * Make style private * fix cc comment * [VerticalGallery] Responsive vertical gallery wrapper (#2770) * Create component * add component for control bar * Add some base styles, add bucketize * add CC label and nav button icons * update API docs for initial component * Change files * Duplicate change files for beta release * extract bucketize to utils file * update useEffect deps * fix lint * update styles comment * create component * start calculateChildren helper * add child calc function * update children styles application VerticalGallery * Change files * Duplicate change files for beta release * fix comment * fix linting errors * create style sheet file for responsive container * simplifiy key and update comment * update to track min tile via constant * memoized styles * rename styles file to be right type * update first calculation to be without controls * fix lint * im bad at spelling * Make style private --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * Add more url parameters for chat sample (#2752) * Add more url parameters for chat sample --------- Signed-off-by: Patrick Latter <73612854+palatter@users.noreply.github.com> Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Co-authored-by: James Burnside <2684369+JamesBurnside@users.noreply.github.com> * 1.5.1-beta.1 pre-release branch (#2699) Update Changelogs * Fix: Permission Error in Chat after leaving a Teams Interop meeting (#2777) * Update `@Azure/communication-chat` to 1.3.0 (#2762) * Update beta version of @azure/communication-calling to 1.11.0-beta.1 (#2763) * Conditional compilation vscode extension settings and documentation (#2775) * Add setting file for extension * Add settings extensions.json --------- Co-authored-by: Nan Jiang <jinan@microsoft.com> * Added overflowGalleryLayout prop to VideoGallery (#2774) * Added overflowGalleryLayout prop to VideoGallery to control component for overflow participants * Refactor FloatingLocalVideo props * renamed VideoGalleryResponsiveHorizontalGallery -> OverflowGallery * Change files * Duplicate change files for beta release * remove ScrollableHorizontalGallery from DefaultLayout * lint fix * overflowGalleryLayout = 'HorizontalBottom' as default for VIdeoGallery * VerticalGallery container should maintain a min width in case no room is available for any video tiles * created props interface for FloatingLocalVideo component --------- Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * [Vertical Galleries] Vertical gallery CSS updates (#2781) * Added overflowGalleryLayout prop to VideoGallery to control component for overflow participants * Refactor FloatingLocalVideo props * renamed VideoGalleryResponsiveHorizontalGallery -> OverflowGallery * Change files * Duplicate change files for beta release * remove ScrollableHorizontalGallery from DefaultLayout * lint fix * overflowGalleryLayout = 'HorizontalBottom' as default for VIdeoGallery * update CSS for proper button placement. * update css for larger page counts * fix up styles bottom out control bar * Change files * Duplicate change files for beta release * memoize styles in verticalGallery * update style name * fix lint * update per comments --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Co-authored-by: mgamis-msft <79475487+mgamis-msft@users.noreply.github.com> * Vertical overflow gallery layout unit tests (#2783) * added VideoGallery unit tests for vertical overflow gallery * Change files * Duplicate change files for beta release * conditional compilation in VideoGallery.test.tsx for VerticalGallery * added test for video participant in grid and the rest bucketized in vertical gallery * [GitHub] Update code owners (#2737) * [Vertical Galleries] Update styles to allow tile vertical resizing (#2785) * Added overflowGalleryLayout prop to VideoGallery to control component for overflow participants * Refactor FloatingLocalVideo props * renamed VideoGalleryResponsiveHorizontalGallery -> OverflowGallery * Change files * Duplicate change files for beta release * remove ScrollableHorizontalGallery from DefaultLayout * lint fix * overflowGalleryLayout = 'HorizontalBottom' as default for VIdeoGallery * update CSS for proper button placement. * update css for larger page counts * fix up styles bottom out control bar * Change files * Duplicate change files for beta release * memoize styles in verticalGallery * update style name * fix lint * update per comments * update styles to allow tile vertical resizing * Change files * Duplicate change files for beta release * fix pagination label bug * fix pagination label issues --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Co-authored-by: mgamis-msft <79475487+mgamis-msft@users.noreply.github.com> * Disable the selectivity of a text in video gallery for long touch to function properly (#2790) * disable the selectivity of a text in video gallery for long touch to function properly * Change files * Duplicate change files for beta release * Storybook messages loading issue fix (#2784) * Caption component (#2794) * caption * Change files * Duplicate change files for beta release * build file * [bugfix][storybook] Update Calling Custom Data Model Example's userId identifier (#2799) * Update Custom Data Model Example userId identifier * Call composite switches between vertical and horizontal gallery depending on aspect ratio (#2786) * Added overflowGalleryLayout prop to VideoGallery to control component for overflow participants * Refactor FloatingLocalVideo props * renamed VideoGalleryResponsiveHorizontalGallery -> OverflowGallery * Change files * Duplicate change files for beta release * remove ScrollableHorizontalGallery from DefaultLayout * lint fix * overflowGalleryLayout = 'HorizontalBottom' as default for VIdeoGallery * update CSS for proper button placement. * update css for larger page counts * fix up styles bottom out control bar * Change files * Duplicate change files for beta release * memoize styles in verticalGallery * update style name * fix lint * update per comments * Observe width and height of MediaGallery to switch between horizontal and vertical overflow gallery * Change files * Duplicate change files for beta release * > changed to >= * Fix local video tile size logic * let -> const * fix floating local video tile size logic * viewport adjusted in horizontal gallery snapshot tests * Update packages/react-composites CallComposite browser test snapshots * viewport adjusted in horizontal gallery snapshot tests for Desktop only * Update packages/react-composites CallComposite browser test snapshots * update so optimize for mobile * Added playwright config project to test vertical gallery and horizontal gallery on Desktop * Change files * Duplicate change files for beta release * test.use to assign viewport to HorizontalGallery snapshot tests * remove unused variable * lint fix * use testMatch and testIgnore for HorizontalGallery.test.ts * Revert changes to HorizontalGallery.test.ts * shorten name project name * Update packages/react-composites CallComposite browser test snapshots * Changed HorizontalGallery button identifiers to be more generic * stable api update * Update packages/react-composites CallComposite browser test snapshots * hermetic IDS fixed * delete unused snapshot * delete unused stable flavor snapshots --------- Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * [VerticalGallery] A11y updates and styling vertical gallery through props (#2796) * update styles to be passed in properly * add aria strings to nav buttons * Change files * Duplicate change files for beta release * fix lint --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * [Chat][BugFix] Updated Local Participant Text Label Colour (#2795) * [Vertical Galleries] Vertical gallery resize tests (#2798) * Added overflowGalleryLayout prop to VideoGallery to control component for overflow participants * Refactor FloatingLocalVideo props * renamed VideoGalleryResponsiveHorizontalGallery -> OverflowGallery * Change files * Duplicate change files for beta release * remove ScrollableHorizontalGallery from DefaultLayout * lint fix * overflowGalleryLayout = 'HorizontalBottom' as default for VIdeoGallery * update CSS for proper button placement. * update css for larger page counts * fix up styles bottom out control bar * Change files * Duplicate change files for beta release * memoize styles in verticalGallery * update style name * fix lint * update per comments * Observe width and height of MediaGallery to switch between horizontal and vertical overflow gallery * Change files * Duplicate change files for beta release * > changed to >= * Fix local video tile size logic * let -> const * fix floating local video tile size logic * viewport adjusted in horizontal gallery snapshot tests * Update packages/react-composites CallComposite browser test snapshots * viewport adjusted in horizontal gallery snapshot tests for Desktop only * Update packages/react-composites CallComposite browser test snapshots * update so optimize for mobile * Added playwright config project to test vertical gallery and horizontal gallery on Desktop * Change files * Duplicate change files for beta release * test.use to assign viewport to HorizontalGallery snapshot tests * remove unused variable * lint fix * use testMatch and testIgnore for HorizontalGallery.test.ts * Revert changes to HorizontalGallery.test.ts * shorten name project name * Update packages/react-composites CallComposite browser test snapshots * Add data-ui-id's for verticalGallery nav buttons * Changed HorizontalGallery button identifiers to be more generic * create initial tests and first size check test * stable api update * await on window resize * finish tests for vertical resizing * Change files * Duplicate change files for beta release * fix conflicts * updating test ids --------- Co-authored-by: mgamis-msft <79475487+mgamis-msft@users.noreply.github.com> Co-authored-by: mgamis-msft <miguelgamis@microsoft.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * [StreamUtils updates] Move logging out of stream utils (#2753) * Create logging function for simplification * finish creating logging functions * mvoe logging to new file * remote renderer removed from state after dispose * Change files * Duplicate change files for beta release * fix lint * update logger * fix switch statements * fix lint * fix lint logging * fix lint * Update packages/calling-stateful-client/src/StreamUtilsLogging.ts Co-authored-by: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * Fix typing issue --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Co-authored-by: James Burnside <2684369+JamesBurnside@users.noreply.github.com> * [StreamUtils updates] one CreateView to rule them all (#2755) * Create logging function for simplification * finish creating logging functions * mvoe logging to new file * remote renderer removed from state after dispose * Change files * Duplicate change files for beta release * fix lint * create generic createViewVideo function * remove comments * remove console * fix bad comparison * Change files * Duplicate change files for beta release * update stream type detection * update test logic for determining stream type * update logger * update to use new logging functions * fix logging fall through * fix switch statements * fix lint * fix lint logging * fix lint * update to use const on stream and participant info * [StreamUtils updates] One disposeView to rule them all (#2758) * Create logging function for simplification * finish creating logging functions * mvoe logging to new file * remote renderer removed from state after dispose * Change files * Duplicate change files for beta release * fix lint * create generic createViewVideo function * remove comments * remove console * fix bad comparison * Change files * Duplicate change files for beta release * update stream type detection * create general disposeView for local and remote * Change files * Duplicate change files for beta release * update test logic for determining stream type * update logger * update to use new logging functions * update disposeViewVideo to use new logging * fix switch * fix logging fall through * fix switch statements * fix lint * fix lint logging * fix lint * update to use const on stream and participant info * update participant info and stream info to const * remove commented code * Add stateful handlers for background effects (#2793) * [UI Components & Story] Add clickable video effect items (#2789) * [Chat][Bugfix] Sendbox Triggers Duplicate Typing Event (#2745) * [Bugfix] Fix sending/delivered/failed message status is hidden for large group (#2707) * Fix message status is hidden for large group * Change files * Duplicate change files for beta release * Update embed html bundle snapshots * Change default showMessageStatus to true * Update embed html bundle snapshots --------- * Call composite overflow gallery snapshot tests (#2804) * Added snapshot tests for the VerticalGallery * fix rtl style of local video tile container * Change files * Duplicate change files for beta release * Remove test.only * delete misplaced file * Remove test.only * Update packages/react-composites CallComposite browser test snapshots * remove setViewPort call in test * Update packages/react-composites CallComposite browser test snapshots * conditionally run VerticalGallery.test.ts * delete stable VerticalGallery snapshots * do not run VerticalGallery snapshots for mobile portrait * Update packages/react-composites CallComposite browser test snapshots * HorizontalGallery.test.ts -> OverflowGallery.test.ts * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * Remove vertical gallery specific snapshots * Add rtl test * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * [Vertical Gallery] isShort styling (#2803) * wire isShort into OverflowGallery * update styles to be responsive to isShort * Change files * Duplicate change files for beta release * fix lint * remove console log * update tile size bounds * fix CC * fix test.only * update responsive height. * update client height in tests * Update packages/react-composites CallComposite browser test snapshots * Update @azure-communication-react-492eb6e4-0fa6-4fd0-9e47-28cef19d15ef.json Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * [Storybook bugfix] remove beta `formFactor` prop from storybook ChatComposite snippets (#2735) * remove beta formFactor from storybook snippet * Change files * Duplicate change files for beta release * [Component and Story] Add background picker component (#2792) * Responsive vertical gallery unit tests (#2800) * Added unit tests for ResponsiveVerticalGallery * Change files * Duplicate change files for beta release * fix helper function comment and expected value for one test * updated based on new prop isShort --------- Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * Correct MessageThread API definition (#2812) --------- Signed-off-by: Emlyn Bolton <3941071+emlynmac@users.noreply.github.com> Co-authored-by: Porter Nan <jiangnanhello@live.com> * Call with chat composite overflow gallery snapshot tests (#2806) * Added snapshot tests for the VerticalGallery * fix rtl style of local video tile container * Change files * Duplicate change files for beta release * Remove test.only * delete misplaced file * Remove test.only * Update packages/react-composites CallComposite browser test snapshots * remove setViewPort call in test * Update packages/react-composites CallComposite browser test snapshots * conditionally run VerticalGallery.test.ts * delete stable VerticalGallery snapshots * do not run VerticalGallery snapshots for mobile portrait * Update packages/react-composites CallComposite browser test snapshots * HorizontalGallery.test.ts -> OverflowGallery.test.ts * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * Remove vertical gallery specific snapshots * Add rtl test * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * Added overflow gallery tests for callWithChat composite * Change files * Duplicate change files for beta release * removed focused test * Update packages/react-composites CallWithChatComposite browser test snapshots * Update packages/react-composites CallWithChatComposite browser test snapshots * lint fix. differentiate rtl snapshot file names. * fix import * skip callWithChat overflow gallery tests for mobile platforms * eslint disable no return type * delete unneeded snapshots * Update packages/react-composites CallWithChatComposite browser test snapshots * Update packages/react-composites CallWithChatComposite browser test snapshots * Update packages/react-composites CallWithChatComposite browser test snapshots * wait for horizontal or vertical gallery to be present * removed test focus --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * [Vertical Gallery] Storybook updates (#2802) * update stories for first draft * add images to docs * Change files * Duplicate change files for beta release * fix image name * update paragraph per comment * update story to refer to overflow layout * [Bug fix] add error string for when remote your view is frozen for others (#2808) * add error string for when remote view is frozen * Change files * Duplicate change files for beta release * stop gaslighting me github * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * [BugFix] Split button Primary action for Camera and Mic buttons (#2773) * Update split buttons to have primary action * Change files * Duplicate change files for beta release * update strings * add localization * fix icons merge error * update mic logic for no speaker selection devices * update API files * lower case title name * update menus to have sub menus * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * [Bug Fixes] Sample app PSTN updates (#2807) * Update apps to provide more info about prop * fix cc * more cc * Change files * Duplicate change files for beta release * remove new place holders for formats * update wordage to be less verbose and not use ACS * Update Webpack dependency to 5.76.0 (#2815) * Update webpack to 5.76.0 * minor change * Change files * Duplicate change files for beta release * updated stable pnpm-lock.yaml --------- Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * Captions component (#2816) * caption component * caption component * scroll to bottom * Change files * Duplicate change files for beta release * scroll to bottom * Video gallery show local tile and horizontal/vertical gallery when screensharing with no participant (#2822) * video gallery show local tile when screensharing * Change files * Duplicate change files for beta release * Stateful client code check in * stateful * Stateful client code check in * 1.5.1-beta.1 pre-release branch (#2699) Update Changelogs * Update `@Azure/communication-chat` to 1.3.0 (#2762) * Update beta version of @azure/communication-calling to 1.11.0-beta.1 (#2763) * Add stateful handlers for background effects (#2793) * Update Webpack dependency to 5.76.0 (#2815) * Update webpack to 5.76.0 * minor change * Change files * Duplicate change files for beta release * updated stable pnpm-lock.yaml --------- Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * stateful * Stateful client code check in * 1.5.1-beta.1 pre-release branch (#2699) Update Changelogs * Update `@Azure/communication-chat` to 1.3.0 (#2762) * Update beta version of @azure/communication-calling to 1.11.0-beta.1 (#2763) * Add stateful handlers for background effects (#2793) * Update Webpack dependency to 5.76.0 (#2815) * Update webpack to 5.76.0 * minor change * Change files * Duplicate change files for beta release * updated stable pnpm-lock.yaml --------- Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * stateful * 1.5.1-beta.1 pre-release branch (#2699) Update Changelogs * Update `@Azure/communication-chat` to 1.3.0 (#2762) * Update beta version of @azure/communication-calling to 1.11.0-beta.1 (#2763) * Add stateful handlers for background effects (#2793) * Update Webpack dependency to 5.76.0 (#2815) * Update webpack to 5.76.0 * minor change * Change files * Duplicate change files for beta release * updated stable pnpm-lock.yaml --------- Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * merge * merge * merge * captions fix * tgz * call context --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Signed-off-by: Patrick Latter <73612854+palatter@users.noreply.github.com> Signed-off-by: Emlyn Bolton <3941071+emlynmac@users.noreply.github.com> Signed-off-by: carocao-msft <96077406+carocao-msft@users.noreply.github.com> Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Co-authored-by: Patrick Latter <73612854+palatter@users.noreply.github.com> Co-authored-by: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Porter Nan <jiangnanhello@live.com> Co-authored-by: Nan Jiang <jinan@microsoft.com> Co-authored-by: mgamis-msft <79475487+mgamis-msft@users.noreply.github.com> Co-authored-by: JoshuaLai <9044372+JoshuaLai@users.noreply.github.com> Co-authored-by: prabhjot-msft <97124699+prabhjot-msft@users.noreply.github.com> Co-authored-by: vhuseinova-msft <98852890+vhuseinova-msft@users.noreply.github.com> Co-authored-by: edwardlee-msft <edwardlee@microsoft.com> Co-authored-by: John <109105353+jpeng-ms@users.noreply.github.com> Co-authored-by: mgamis-msft <miguelgamis@microsoft.com> Co-authored-by: Leah Xia <107075081+Leah-Xia-Microsoft@users.noreply.github.com> Co-authored-by: Emlyn Bolton <3941071+emlynmac@users.noreply.github.com>
1 parent 56e2f51 commit ec85da3

13 files changed

Lines changed: 155 additions & 142 deletions

File tree

libs/skype-spool-sdk-1.0.0.tgz

464 KB
Binary file not shown.

packages/calling-stateful-client/review/beta/calling-stateful-client.api.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { CallEndReason } from '@azure/communication-calling';
1616
import { CallerInfo } from '@azure/communication-calling';
1717
import { CallKind } from '@azure/communication-calling';
1818
import { CallState as CallState_2 } from '@azure/communication-calling';
19+
import { CaptionsResultType } from '@azure/communication-calling';
1920
import { CommunicationIdentifier } from '@azure/communication-common';
2021
import { CommunicationIdentifierKind } from '@azure/communication-common';
2122
import { CommunicationUserIdentifier } from '@azure/communication-common';
@@ -33,11 +34,9 @@ import { LocalVideoStream } from '@azure/communication-calling';
3334
import { MediaStreamType } from '@azure/communication-calling';
3435
import { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';
3536
import { MicrosoftTeamsUserKind } from '@azure/communication-common';
36-
import { ParticipantInfo } from '@azure/communication-calling';
3737
import { ParticipantRole } from '@azure/communication-calling';
3838
import { PhoneNumberKind } from '@azure/communication-common';
3939
import { RemoteParticipantState as RemoteParticipantState_2 } from '@azure/communication-calling';
40-
import { ResultType } from '@azure/communication-calling';
4140
import { ScalingMode } from '@azure/communication-calling';
4241
import { TeamsCall as TeamsCall_2 } from '@azure/communication-calling';
4342
import { TeamsCallAgent as TeamsCallAgent_2 } from '@azure/communication-calling';
@@ -126,30 +125,24 @@ export interface CallState {
126125
}
127126

128127
// @beta (undocumented)
129-
export interface CaptionInfoState {
130-
originalText?: string;
131-
resultType: ResultType;
132-
speaker: ParticipantInfo;
133-
spokenLanguage: string;
134-
subtitleLanguage?: string;
135-
text: string;
136-
timestamp: Date;
128+
export interface CaptionsCallFeatureState {
129+
captions: CaptionsInfo[];
130+
currentCaptionLanguage: string;
131+
currentSpokenLanguage: string;
132+
isCaptionsFeatureActive: boolean;
133+
supportedCaptionLanguages: string[];
134+
supportedSpokenLangauges: string[];
137135
}
138136

139137
// @beta (undocumented)
140-
export interface CaptionsCallFeatureState {
141-
// (undocumented)
142-
availableSpokenLanguages: string[];
143-
// (undocumented)
144-
availableSubtitleLanguages?: string[];
145-
// (undocumented)
146-
captions: CaptionInfoState[];
147-
// (undocumented)
148-
isActive: boolean;
149-
// (undocumented)
150-
selectedSpokenLanguage?: string;
151-
// (undocumented)
152-
selectedSubtitleLanguage?: string;
138+
export interface CaptionsInfo {
139+
captionLanguage?: string;
140+
captionText: string;
141+
resultType: CaptionsResultType;
142+
speaker: CallerInfo;
143+
spokenLanguage: string;
144+
spokenText?: string;
145+
timestamp: Date;
153146
}
154147

155148
// @public

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

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ import {
1212
LatestMediaDiagnostics,
1313
LatestNetworkDiagnostics,
1414
MediaStreamType,
15-
ParticipantInfo,
1615
RemoteParticipantState as RemoteParticipantStatus,
17-
ResultType,
16+
CaptionsResultType,
1817
ScalingMode,
1918
VideoDeviceInfo
2019
} from '@azure/communication-calling';
@@ -52,48 +51,66 @@ export interface CallAgentState {
5251
/**
5352
* @beta
5453
*/
55-
export interface CaptionInfoState {
54+
export interface CaptionsInfo {
5655
/**
5756
* The state in which this caption data can be classified.
5857
*/
59-
resultType: ResultType;
58+
resultType: CaptionsResultType;
6059
/**
6160
* The information of the call participant who spoke the captioned text.
6261
*/
63-
speaker: ParticipantInfo;
62+
speaker: CallerInfo;
6463
/**
65-
* The language that the spoken words were interpretted as. Corresponds to the language specified in startCaptions / selectLanguage.
64+
* The language that the spoken words were interpretted as. Corresponds to the language specified in startCaptions / setSpokenLanguage.
6665
*/
6766
spokenLanguage: string;
6867
/**
6968
* The caption text.
7069
*/
71-
text: string;
70+
captionText: string;
7271
/**
7372
* Timestamp of when the captioned words were initially spoken.
7473
*/
7574
timestamp: Date;
7675
/**
77-
* The language that the captions are presented in. Corresponds to the subtitleLanguage specified in startCaptions / selectLanguage.
76+
* The language that the captions are presented in. Corresponds to the captionLanguage specified in startCaptions / setCaptionLanguage.
7877
*/
79-
subtitleLanguage?: string;
78+
captionLanguage?: string;
8079
/**
8180
* The original spoken caption text prior to translating to subtitle language
8281
*/
83-
originalText?: string;
82+
spokenText?: string;
8483
}
8584

8685
/**
8786
*
8887
* @beta
8988
*/
9089
export interface CaptionsCallFeatureState {
91-
captions: CaptionInfoState[];
92-
selectedSpokenLanguage?: string;
93-
selectedSubtitleLanguage?: string;
94-
availableSpokenLanguages: string[];
95-
availableSubtitleLanguages?: string[];
96-
isActive: boolean;
90+
/**
91+
* supported spoken languages
92+
*/
93+
supportedSpokenLangauges: string[];
94+
/**
95+
* array of received captions
96+
*/
97+
captions: CaptionsInfo[];
98+
/**
99+
* whether captions is on/off
100+
*/
101+
isCaptionsFeatureActive: boolean;
102+
/**
103+
* supported caption languages
104+
*/
105+
supportedCaptionLanguages: string[];
106+
/**
107+
* current spoken language
108+
*/
109+
currentSpokenLanguage: string;
110+
/**
111+
* current caption language
112+
*/
113+
currentCaptionLanguage: string;
97114
}
98115

99116
/**

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
import { CommunicationIdentifierKind } from '@azure/communication-common';
55
import {
6-
AcsCaptionsInfo,
76
AudioDeviceInfo,
87
DeviceAccess,
98
DominantSpeakersInfo,
10-
ResultType,
119
ScalingMode,
12-
TeamsCaptionsInfo,
13-
VideoDeviceInfo
10+
VideoDeviceInfo,
11+
TeamsCaptionsInfo
1412
} from '@azure/communication-calling';
1513
/* @conditional-compile-remove(unsupported-browser) */
1614
import { EnvironmentInfo } from '@azure/communication-calling';
@@ -37,7 +35,7 @@ import {
3735
CallErrors,
3836
CallErrorTarget,
3937
CallError,
40-
CaptionInfoState
38+
CaptionsInfo
4139
} from './CallClientState';
4240
import { callingStatefulLogger } from './Logger';
4341
import { CallIdHistory } from './CallIdHistory';
@@ -702,28 +700,30 @@ export class CallContext {
702700
return id;
703701
}
704702

705-
private processNewCaption(captions: CaptionInfoState[], captionInfo: CaptionInfoState): void {
703+
private processNewCaption(captions: CaptionsInfo[], newCaption: CaptionsInfo): void {
706704
// Check if the incoming caption is a replacement for the latest one
707705
const latestCaption = captions[captions.length - 1];
708706
if (
709707
latestCaption &&
710-
latestCaption.resultType !== ResultType.Final &&
711-
latestCaption.timestamp.getTime() === captionInfo.timestamp.getTime() &&
708+
latestCaption.resultType !== 'Final' &&
709+
latestCaption.timestamp.getTime() === newCaption.timestamp.getTime() &&
710+
latestCaption.speaker.identifier &&
711+
newCaption.speaker.identifier &&
712712
toFlatCommunicationIdentifier(latestCaption.speaker.identifier) ===
713-
toFlatCommunicationIdentifier(captionInfo.speaker.identifier)
713+
toFlatCommunicationIdentifier(newCaption.speaker.identifier)
714714
) {
715715
captions.pop();
716716
}
717717

718-
captions.push(captionInfo);
718+
captions.push(newCaption);
719719

720720
// If the array length exceeds 50, remove the oldest caption
721721
if (captions.length > 50) {
722722
captions.shift();
723723
}
724724
}
725725

726-
public addCaption(callId: string, caption: AcsCaptionsInfo | TeamsCaptionsInfo): void {
726+
public addCaption(callId: string, caption: TeamsCaptionsInfo): void {
727727
this.modifyState((draft: CallClientState) => {
728728
const call = draft.calls[this._callIdHistory.latestCallId(callId)];
729729
if (call) {
@@ -736,7 +736,7 @@ export class CallContext {
736736
this.modifyState((draft: CallClientState) => {
737737
const call = draft.calls[this._callIdHistory.latestCallId(callId)];
738738
if (call) {
739-
call.captionsFeature.isActive = isCaptionsActive;
739+
call.captionsFeature.isCaptionsFeatureActive = isCaptionsActive;
740740
}
741741
});
742742
}
@@ -745,25 +745,25 @@ export class CallContext {
745745
this.modifyState((draft: CallClientState) => {
746746
const call = draft.calls[this._callIdHistory.latestCallId(callId)];
747747
if (call) {
748-
call.captionsFeature.selectedSpokenLanguage = spokenLanguage;
748+
call.captionsFeature.currentSpokenLanguage = spokenLanguage;
749749
}
750750
});
751751
}
752752

753-
setSelectedSubtitleLanguage(callId: string, subtitleLanguage: string): void {
753+
setSelectedCaptionLanguage(callId: string, captionLanguage: string): void {
754754
this.modifyState((draft: CallClientState) => {
755755
const call = draft.calls[this._callIdHistory.latestCallId(callId)];
756756
if (call) {
757-
call.captionsFeature.selectedSubtitleLanguage = subtitleLanguage;
757+
call.captionsFeature.currentCaptionLanguage = captionLanguage;
758758
}
759759
});
760760
}
761761

762-
setAvailableSubtitleLanguages(callId: string, subtitleLanguages: string[]): void {
762+
setAvailableCaptionLanguages(callId: string, captionLanguages: string[]): void {
763763
this.modifyState((draft: CallClientState) => {
764764
const call = draft.calls[this._callIdHistory.latestCallId(callId)];
765765
if (call) {
766-
call.captionsFeature.availableSubtitleLanguages = subtitleLanguages;
766+
call.captionsFeature.supportedCaptionLanguages = captionLanguages;
767767
}
768768
});
769769
}
@@ -772,7 +772,7 @@ export class CallContext {
772772
this.modifyState((draft: CallClientState) => {
773773
const call = draft.calls[this._callIdHistory.latestCallId(callId)];
774774
if (call) {
775-
call.captionsFeature.availableSpokenLanguages = spokenLanguages;
775+
call.captionsFeature.supportedSpokenLangauges = spokenLanguages;
776776
}
777777
});
778778
}

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

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { CallContext } from './CallContext';
55
import { CallCommon } from './BetaToStableTypes';
6-
import { AcsCaptionsCallFeature, Features, TeamsCaptionsCallFeature } from '@azure/communication-calling';
6+
import { Features, TeamsCaptionsCallFeature } from '@azure/communication-calling';
77

88
/**
99
* @private
@@ -74,47 +74,41 @@ export abstract class ProxyCallCommon implements ProxyHandler<CallCommon> {
7474
case 'feature': {
7575
// these are mini version of Proxy object - if it grows too big, a real Proxy object should be used.
7676
return this._context.withErrorTeedToState((...args: Parameters<CallCommon['feature']>) => {
77-
if (args[0] === Features.AcsCaptions) {
78-
const captionsFeature = target.feature(Features.AcsCaptions);
79-
return {
80-
...captionsFeature,
81-
startCaptions: async (...args: Parameters<AcsCaptionsCallFeature['startCaptions']>) => {
82-
const ret = await captionsFeature.startCaptions(...args);
83-
this._context.setIsCaptionActive(target.id, true);
84-
return ret;
85-
},
86-
selectSpokenLanguage: async (...args: Parameters<TeamsCaptionsCallFeature['selectSpokenLanguage']>) => {
87-
const ret = await captionsFeature.selectSpokenLanguage(...args);
88-
this._context.setSelectedSpokenLanguage(target.id, args[0]);
89-
return ret;
90-
}
91-
};
92-
} else if (args[0] === Features.TeamsCaptions) {
77+
if (args[0] === Features.TeamsCaptions) {
9378
const captionsFeature = target.feature(Features.TeamsCaptions);
9479
return {
9580
...captionsFeature,
9681
startCaptions: async (...args: Parameters<TeamsCaptionsCallFeature['startCaptions']>) => {
97-
const ret = await captionsFeature.startCaptions(...args);
82+
let ret;
83+
if (args) {
84+
ret = await captionsFeature.startCaptions(...args);
85+
} else {
86+
ret = await captionsFeature.startCaptions();
87+
}
88+
9889
this._context.setIsCaptionActive(target.id, true);
9990
return ret;
10091
},
101-
selectSpokenLanguage: async (...args: Parameters<TeamsCaptionsCallFeature['selectSpokenLanguage']>) => {
102-
const ret = await captionsFeature.selectSpokenLanguage(...args);
92+
stopCaptions: async () => {
93+
const ret = await captionsFeature.stopCaptions();
94+
this._context.setIsCaptionActive(target.id, false);
95+
return ret;
96+
},
97+
setSpokenLanguage: async (...args: Parameters<TeamsCaptionsCallFeature['setSpokenLanguage']>) => {
98+
const ret = await captionsFeature.setSpokenLanguage(...args);
10399
this._context.setSelectedSpokenLanguage(target.id, args[0]);
104100
return ret;
105101
},
106-
selectSubtitleLanguage: async (
107-
...args: Parameters<TeamsCaptionsCallFeature['selectSubtitleLanguage']>
108-
) => {
109-
const ret = await captionsFeature.selectSubtitleLanguage(...args);
110-
this._context.setSelectedSubtitleLanguage(target.id, args[0]);
102+
setCaptionLanguage: async (...args: Parameters<TeamsCaptionsCallFeature['setCaptionLanguage']>) => {
103+
const ret = await captionsFeature.setCaptionLanguage(...args);
104+
this._context.setSelectedCaptionLanguage(target.id, args[0]);
111105
return ret;
112106
}
113107
};
114108
} else {
115109
return target.feature(...args);
116110
}
117-
}, 'Call.resume');
111+
}, 'Call.feature');
118112
}
119113
default:
120114
return Reflect.get(target, prop);

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class CallSubscriber {
3636
private _participantSubscribers: Map<string, ParticipantSubscriber>;
3737
private _recordingSubscriber: RecordingSubscriber;
3838
private _transcriptionSubscriber: TranscriptionSubscriber;
39-
private _captionsSubscriber: CaptionsSubscriber;
39+
private _captionsSubscriber?: CaptionsSubscriber;
4040
/* @conditional-compile-remove(video-background-effects) */
4141
private _localVideoStreamVideoEffectsSubscribers: Map<string, LocalVideoStreamVideoEffectsSubscriber>;
4242

@@ -62,13 +62,13 @@ export class CallSubscriber {
6262
this._context,
6363
this._call.feature(Features.Transcription)
6464
);
65-
this._captionsSubscriber = new CaptionsSubscriber(
66-
this._callIdRef,
67-
this._context,
68-
_isTeamsMeetingCall(this._call)
69-
? this._call.feature(Features.TeamsCaptions)
70-
: this._call.feature(Features.AcsCaptions)
71-
);
65+
if (_isTeamsMeetingCall(this._call)) {
66+
this._captionsSubscriber = new CaptionsSubscriber(
67+
this._callIdRef,
68+
this._context,
69+
this._call.feature(Features.TeamsCaptions)
70+
);
71+
}
7272
/* @conditional-compile-remove(video-background-effects) */
7373
this._localVideoStreamVideoEffectsSubscribers = new Map();
7474

@@ -145,7 +145,7 @@ export class CallSubscriber {
145145
this._diagnosticsSubscriber.unsubscribe();
146146
this._recordingSubscriber.unsubscribe();
147147
this._transcriptionSubscriber.unsubscribe();
148-
this._captionsSubscriber.unsubscribe();
148+
this._captionsSubscriber?.unsubscribe();
149149
};
150150

151151
private addParticipantListener(participant: RemoteParticipant): void {

0 commit comments

Comments
 (0)