Skip to content

Commit cbc4c76

Browse files
Cherry Pick RTT Stable into Release Branch (#5779)
* Change files * RTT to stable * Change files * update * Update * Update packages/react-composites CallWithChatComposite 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>
1 parent 8ed9833 commit cbc4c76

104 files changed

Lines changed: 235 additions & 31 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "prerelease",
3+
"area": "feature",
4+
"workstream": "Update",
5+
"comment": "Update Calling to the latest stable",
6+
"packageName": "@azure/communication-react",
7+
"email": "96077406+carocao-msft@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": "prerelease",
3+
"area": "feature",
4+
"workstream": "Real Time Text",
5+
"comment": "Stablize Real Time Text and remove Real Time Text from CTE",
6+
"packageName": "@azure/communication-react",
7+
"email": "96077406+carocao-msft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

common/config/babel/features.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ module.exports = {
6767
"teams-identity-support-beta",
6868
// feature for tracking the callParticipantsLocator
6969
"call-participants-locator",
70-
// Feature for RTT
71-
"rtt",
7270
// Feature for together mode
7371
"together-mode"
7472
],
7573
stable: [
7674
// Demo feature. Used in live-documentation of conditional compilation.
7775
// Do not use in production code.
78-
"stabilizedDemo"
76+
"stabilizedDemo",
77+
// Feature for RTT
78+
"rtt",
7979
]
8080
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export interface CaptionsInfo {
101101

102102
/* @conditional-compile-remove(rtt) */
103103
/**
104-
* @beta
104+
* @public
105105
*/
106106
export interface RealTimeTextInfo {
107107
/**
@@ -175,7 +175,7 @@ export interface CaptionsCallFeatureState {
175175

176176
/* @conditional-compile-remove(rtt) */
177177
/**
178-
* @beta
178+
* @public
179179
*/
180180
export interface RealTimeTextCallFeatureState {
181181
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ export abstract class ProxyCallCommon implements ProxyHandler<CallCommon> {
119119
const proxyFeature = new ProxySpotlightCallFeature(this._context);
120120
return new Proxy(spotlightFeature, proxyFeature);
121121
}
122+
if (args[0] === Features.RealTimeText && this._context.getState().userId.kind === 'microsoftTeamsUser') {
123+
return;
124+
}
122125
return target.feature(...args);
123126
}, 'Call.feature');
124127
}

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,6 @@ export class CallSubscriber {
143143
this._context,
144144
this._call.feature(Features.MediaAccess)
145145
);
146-
/* @conditional-compile-remove(rtt) */
147-
this._realTimeTextSubscriber = new RealTimeTextSubscriber(
148-
this._callIdRef,
149-
this._context,
150-
this._call.feature(Features.RealTimeText)
151-
);
152146

153147
this.subscribe();
154148
}
@@ -161,6 +155,10 @@ export class CallSubscriber {
161155
this._safeSubscribe(this.initTeamsMeetingConference);
162156
};
163157

158+
private _safeSubscribeInitRealTimeText = (): void => {
159+
this._safeSubscribe(this.initRealTimeText);
160+
};
161+
164162
/* @conditional-compile-remove(local-recording-notification) */
165163
private _safeSubscribeInitLocalRecordingNotificationSubscriber = (): void => {
166164
this._safeSubscribe(this.initLocalRecordingNotificationSubscriber);
@@ -183,6 +181,8 @@ export class CallSubscriber {
183181
this._call.on('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);
184182
this._call.on('mutedByOthers', this.mutedByOthersHandler);
185183

184+
this._safeSubscribeInitRealTimeText();
185+
186186
for (const localVideoStream of this._call.localVideoStreams) {
187187
this._internalContext.setLocalRenderInfo(
188188
this._callIdRef.callId,
@@ -250,7 +250,9 @@ export class CallSubscriber {
250250
this._pptLiveSubscriber.unsubscribe();
251251
this._CaptionsFeatureSubscriber?.unsubscribe();
252252
/* @conditional-compile-remove(rtt) */
253-
this._realTimeTextSubscriber?.unsubscribe();
253+
if (this._realTimeTextSubscriber) {
254+
this._realTimeTextSubscriber.unsubscribe();
255+
}
254256
this._raiseHandSubscriber?.unsubscribe();
255257

256258
this._capabilitiesSubscriber.unsubscribe();
@@ -320,6 +322,16 @@ export class CallSubscriber {
320322
}
321323
};
322324

325+
private initRealTimeText = (): void => {
326+
if (this._context.getState().userId.kind !== 'microsoftTeamsUser') {
327+
this._realTimeTextSubscriber = new RealTimeTextSubscriber(
328+
this._callIdRef,
329+
this._context,
330+
this._call.feature(Features.RealTimeText)
331+
);
332+
}
333+
};
334+
323335
/* @conditional-compile-remove(local-recording-notification) */
324336
private initLocalRecordingNotificationSubscriber = (): void => {
325337
// Subscribe to LocalRecordingFeature as it is only available in interop scenarios

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4645,7 +4645,7 @@ export type ReadReceiptsBySenderId = {
46454645
// @beta
46464646
export const RealTimeText: (props: RealTimeTextProps) => JSX.Element;
46474647

4648-
// @beta (undocumented)
4648+
// @public (undocumented)
46494649
export interface RealTimeTextCallFeatureState {
46504650
isRealTimeTextFeatureActive?: boolean;
46514651
realTimeTexts: {
@@ -4655,7 +4655,7 @@ export interface RealTimeTextCallFeatureState {
46554655
};
46564656
}
46574657

4658-
// @beta (undocumented)
4658+
// @public (undocumented)
46594659
export interface RealTimeTextInfo {
46604660
isMe?: boolean;
46614661
message: string;
@@ -4666,7 +4666,7 @@ export interface RealTimeTextInfo {
46664666
updatedTimestamp?: Date;
46674667
}
46684668

4669-
// @beta
4669+
// @public
46704670
export type RealTimeTextInformation = {
46714671
id: number;
46724672
displayName: string;
@@ -4688,7 +4688,7 @@ export interface RealTimeTextModalProps {
46884688
strings?: RealTimeTextModalStrings;
46894689
}
46904690

4691-
// @beta
4691+
// @public
46924692
export interface RealTimeTextModalStrings {
46934693
realTimeTextCancelButtonLabel?: string;
46944694
realTimeTextCloseModalButtonAriaLabel?: string;
@@ -4710,12 +4710,12 @@ export interface RealTimeTextProps {
47104710
userId?: string;
47114711
}
47124712

4713-
// @beta
4713+
// @public
47144714
export type RealTimeTextReceivedListener = (event: {
47154715
realTimeText: RealTimeTextInfo_2;
47164716
}) => void;
47174717

4718-
// @beta
4718+
// @public
47194719
export interface RealTimeTextStrings {
47204720
isTypingText?: string;
47214721
}
@@ -5146,7 +5146,7 @@ export interface StartRealTimeTextButtonProps extends ControlBarButtonProps {
51465146
strings?: StartRealTimeTextButtonStrings;
51475147
}
51485148

5149-
// @beta
5149+
// @public
51505150
export interface StartRealTimeTextButtonStrings {
51515151
label: string;
51525152
tooltipOffContent: string;

0 commit comments

Comments
 (0)