Skip to content

Commit a789fb4

Browse files
Cherry Pick Video Gallery bug fix into release branch (#5780)
* Change files * RTT to stable * Change files * update * Update * Move width/height calculation on call page * Change files * update * changelog * Update packages/react-composites CallWithChatComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots --------- Signed-off-by: carocao-msft <96077406+carocao-msft@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent cbc4c76 commit a789fb4

9 files changed

Lines changed: 50 additions & 12 deletions

File tree

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": "Fix bug where mobile video gallery shows landscape view when RTT banner is enlarged",
5+
"comment": "Fix bug where mobile video gallery shows landscape view when RTT banner is enlarged",
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": "patch",
3+
"area": "fix",
4+
"workstream": "Fix bug where mobile video gallery shows landscape view when RTT banner is enlarged",
5+
"comment": "Fix bug where mobile video gallery shows landscape view when RTT banner is enlarged",
6+
"packageName": "@azure/communication-react",
7+
"email": "96077406+carocao-msft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

packages/communication-react/CHANGELOG.stable.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
Mon, 07 Apr 2025 16:07:48 GMT
1010
[Compare changes](https://github.com/azure/communication-ui-library/compare/1.26.0-beta.1...1.26.0)
1111

12+
### Features
13+
14+
#### Real Time Text
15+
We are excited to announce that the Azure Communication Services Web UI Library now supports RTT (Real Time Text). In an RTT enabled audio or video call, end-users augment the call with text. RTT text communications are transmitted immediately as they are typed, character-by-character, without the user hitting “send.” Users can enable RTT in a call, type to send real time text, or receive real time text from other users. Developers can use this functionality today through our composites (e.g CallComposite, CallWithChatComposite) as well as through components (e.g VideoGallery). This feature is a required by the EU as a core accessibility feature, with implementation needed by June 2025.
16+
17+
* Receive and send Real Time Text messages
18+
* Seamless integration of real-time text with captions, allowing you to view both simultaneously
19+
* In our composites, Real Time Text turns on automatically for everyone when a message is first received/sent
20+
1221
### Improvements
1322
- Add API to disable the notifications in the CallComposite ([PR #5751](https://github.com/azure/communication-ui-library/pull/5751) by dmceachern@microsoft.com)
1423
- Update calling effects package to version 1.1.4 ([PR #5774](https://github.com/Azure/communication-ui-library/pull/5774) by dmceachern@microsoft.com)

packages/react-composites/src/composites/CallComposite/components/MediaGallery.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import React, { CSSProperties, useCallback, useMemo } from 'react';
5-
import { useRef } from 'react';
4+
import React, { CSSProperties, useCallback, useMemo, useRef } from 'react';
65
import {
76
VideoGallery,
87
VideoStreamOptions,
@@ -71,6 +70,7 @@ export interface MediaGalleryProps {
7170
height: 'full' | 'default';
7271
};
7372
localScreenShareView?: LocalScreenShareView;
73+
compositeContainerAspectRatio?: number;
7474
}
7575

7676
/**
@@ -84,7 +84,8 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
8484
setPromptProps,
8585
hideSpotlightButtons,
8686
videoTilesOptions,
87-
captionsOptions
87+
captionsOptions,
88+
compositeContainerAspectRatio
8889
} = props;
8990

9091
const videoGalleryProps = usePropsFor(VideoGallery);
@@ -95,12 +96,11 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
9596
const userRole = useSelector(getRole);
9697
const capabilities = useSelector(getCapabilites);
9798
const isRoomsCall = useSelector(getIsRoomsCall);
99+
const reactionResources = useSelector(getReactionResources);
98100

99101
const containerRef = useRef<HTMLDivElement>(null);
100102
const containerWidth = _useContainerWidth(containerRef);
101103
const containerHeight = _useContainerHeight(containerRef);
102-
const containerAspectRatio = containerWidth && containerHeight ? containerWidth / containerHeight : 0;
103-
const reactionResources = useSelector(getReactionResources);
104104

105105
const layoutBasedOnTilePosition: VideoGalleryLayout = getVideoGalleryLayoutBasedOnLocalOptions(
106106
(props.localVideoTileOptions as LocalVideoTileOptions)?.position
@@ -209,7 +209,7 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
209209
localVideoTileSize={
210210
props.localVideoTileOptions === false || userRole === 'Consumer' || (isRoomsCall && userRole === 'Unknown')
211211
? 'hidden'
212-
: props.isMobile && containerAspectRatio < 1
212+
: props.isMobile && compositeContainerAspectRatio && compositeContainerAspectRatio < 1
213213
? '9:16'
214214
: '16:9'
215215
}
@@ -242,7 +242,6 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
242242
overflowGalleryPosition,
243243
userRole,
244244
isRoomsCall,
245-
containerAspectRatio,
246245
pinnedParticipants,
247246
onPinParticipant,
248247
onUnpinParticipant,
@@ -254,7 +253,8 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
254253
onStopRemoteSpotlightWithPrompt,
255254
layoutBasedOnTilePosition,
256255
capabilities?.muteOthers,
257-
props.localScreenShareView
256+
props.localScreenShareView,
257+
compositeContainerAspectRatio
258258
]);
259259

260260
return (

packages/react-composites/src/composites/CallComposite/pages/CallPage.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@
44
import { DiagnosticQuality } from '@azure/communication-calling';
55
import { useId } from '@fluentui/react-hooks';
66
import { _isInCall } from '@internal/calling-component-bindings';
7-
import { ActiveErrorMessage, ErrorBar, ParticipantMenuItemsCallback } from '@internal/react-components';
7+
import {
8+
_useContainerHeight,
9+
_useContainerWidth,
10+
ActiveErrorMessage,
11+
ErrorBar,
12+
ParticipantMenuItemsCallback
13+
} from '@internal/react-components';
814
import { CustomAvatarOptions, VideoTile } from '@internal/react-components';
915

1016
import { ActiveNotification } from '@internal/react-components';
1117
import { VideoGalleryLayout } from '@internal/react-components';
12-
import React, { useMemo } from 'react';
18+
import React, { useMemo, useRef } from 'react';
1319
import { useCallback } from 'react';
1420
import { useState } from 'react';
1521
import { AvatarPersonaDataCallback } from '../../common/AvatarPersona';
@@ -108,6 +114,10 @@ export const CallPage = (props: CallPageProps): JSX.Element => {
108114
const [dtmfDialerPresent, setDtmfDialerPresent] = useState<boolean>(renderDtmfDialerFromStart);
109115
const isPstnCall = callees?.some((callee) => isPhoneNumberIdentifier(callee));
110116
const isCTECall = useSelector((state) => state.userId.kind === 'microsoftTeamsUser');
117+
const containerRef = useRef<HTMLDivElement>(null);
118+
const containerWidth = _useContainerWidth(containerRef);
119+
const containerHeight = _useContainerHeight(containerRef);
120+
const containerAspectRatio = containerWidth && containerHeight ? containerWidth / containerHeight : 0;
111121

112122
const strings = useLocale().strings.call;
113123

@@ -196,13 +206,14 @@ export const CallPage = (props: CallPageProps): JSX.Element => {
196206
videoTilesOptions={options?.videoTilesOptions}
197207
captionsOptions={options?.captionsBanner}
198208
localScreenShareView={options?.galleryOptions?.localScreenShareView}
209+
compositeContainerAspectRatio={containerAspectRatio}
199210
/>
200211
);
201212
}
202213
};
203214

204215
return (
205-
<>
216+
<div ref={containerRef} style={{ height: '100%', width: '100%' }}>
206217
<CallArrangement
207218
id={drawerMenuHostId}
208219
complianceBannerProps={{ ...complianceBannerProps, strings }}
@@ -256,7 +267,7 @@ export const CallPage = (props: CallPageProps): JSX.Element => {
256267
isRTTSupportedCall={!isPstnCall && !isCTECall}
257268
/>
258269
{<Prompt isOpen={isPromptOpen} onDismiss={() => setIsPromptOpen(false)} {...promptProps} />}
259-
</>
270+
</div>
260271
);
261272
};
262273

Loading
Loading
Loading

0 commit comments

Comments
 (0)