Skip to content

Commit 2b3201a

Browse files
authored
together mode component (#5517)
* together mode component * Together mode styling update * Change files * Addressed comments * Updated Css * Addressed comments * Addressed comments
1 parent 02306f8 commit 2b3201a

10 files changed

+929
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"type": "prerelease",
3+
"area": "feature",
4+
"workstream": "together-mode",
5+
"comment": "together mode component",
6+
"packageName": "@azure/communication-react",
7+
"dependentChangeType": "patch"
8+
}

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

+16-1
Original file line numberDiff line numberDiff line change
@@ -5499,7 +5499,7 @@ export interface VideoBackgroundReplacementEffect extends BackgroundReplacementC
54995499
export const VideoGallery: (props: VideoGalleryProps) => JSX.Element;
55005500

55015501
// @public (undocumented)
5502-
export type VideoGalleryLayout = 'default' | 'floatingLocalVideo' | 'speaker' | /* @conditional-compile-remove(large-gallery) */ 'largeGallery' | 'focusedContent';
5502+
export type VideoGalleryLayout = 'default' | 'floatingLocalVideo' | 'speaker' | /* @conditional-compile-remove(large-gallery) */ 'largeGallery' | /* @conditional-compile-remove(together-mode) */ 'togetherMode' | 'focusedContent';
55035503

55045504
// @public
55055505
export interface VideoGalleryLocalParticipant extends VideoGalleryParticipant {
@@ -5525,6 +5525,8 @@ export type VideoGalleryParticipant = {
55255525
// @public
55265526
export interface VideoGalleryProps {
55275527
dominantSpeakers?: string[];
5528+
// (undocumented)
5529+
isTogetherModeActive?: boolean;
55285530
layout?: VideoGalleryLayout;
55295531
localParticipant: VideoGalleryLocalParticipant;
55305532
localVideoCameraCycleButtonProps?: LocalVideoCameraCycleButtonProps;
@@ -5534,12 +5536,16 @@ export interface VideoGalleryProps {
55345536
maxRemoteVideoStreams?: number;
55355537
onCreateLocalStreamView?: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;
55365538
onCreateRemoteStreamView?: (userId: string, options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;
5539+
// (undocumented)
5540+
onCreateTogetherModeStreamView?: (options?: VideoStreamOptions) => Promise<void | TogetherModeStreamViewResult>;
55375541
onDisposeLocalScreenShareStreamView?: () => Promise<void>;
55385542
onDisposeLocalStreamView?: () => void;
55395543
onDisposeRemoteScreenShareStreamView?: (userId: string) => Promise<void>;
55405544
// @deprecated (undocumented)
55415545
onDisposeRemoteStreamView?: (userId: string) => Promise<void>;
55425546
onDisposeRemoteVideoStreamView?: (userId: string) => Promise<void>;
5547+
// (undocumented)
5548+
onDisposeTogetherModeStreamView?: () => Promise<void>;
55435549
onForbidAudio?: (userIds: string[]) => Promise<void>;
55445550
onForbidVideo?: (userIds: string[]) => Promise<void>;
55455551
onMuteParticipant?: (userId: string) => Promise<void>;
@@ -5549,8 +5555,11 @@ export interface VideoGalleryProps {
55495555
onRenderAvatar?: OnRenderAvatarCallback;
55505556
onRenderLocalVideoTile?: (localParticipant: VideoGalleryLocalParticipant) => JSX.Element;
55515557
onRenderRemoteVideoTile?: (remoteParticipant: VideoGalleryRemoteParticipant) => JSX.Element;
5558+
// (undocumented)
5559+
onSetTogetherModeSceneSize?: (width: number, height: number) => void;
55525560
onStartLocalSpotlight?: () => Promise<void>;
55535561
onStartRemoteSpotlight?: (userIds: string[]) => Promise<void>;
5562+
onStartTogetherMode?: () => Promise<void>;
55545563
onStopLocalSpotlight?: () => Promise<void>;
55555564
onStopRemoteSpotlight?: (userIds: string[]) => Promise<void>;
55565565
onUnpinParticipant?: (userId: string) => void;
@@ -5563,8 +5572,14 @@ export interface VideoGalleryProps {
55635572
showCameraSwitcherInLocalPreview?: boolean;
55645573
showMuteIndicator?: boolean;
55655574
spotlightedParticipants?: string[];
5575+
// (undocumented)
5576+
startTogetherModeEnabled?: boolean;
55665577
strings?: Partial<VideoGalleryStrings>;
55675578
styles?: VideoGalleryStyles;
5579+
// (undocumented)
5580+
togetherModeSeatingCoordinates?: VideoGalleryTogetherModeParticipantPosition;
5581+
// (undocumented)
5582+
togetherModeStreams?: VideoGalleryTogetherModeStreams;
55685583
videoTilesOptions?: VideoTilesOptions;
55695584
}
55705585

packages/react-components/src/components/MeetingReactionOverlay.tsx

+35-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ import {
88
VideoGalleryLocalParticipant,
99
VideoGalleryRemoteParticipant
1010
} from '../types';
11+
/* @conditional-compile-remove(together-mode) */
12+
import { VideoGalleryTogetherModeParticipantPosition } from '../types';
1113
import React, { useLayoutEffect, useRef, useState } from 'react';
1214
import { ParticipantVideoTileOverlay } from './VideoGallery/ParticipantVideoTileOverlay';
1315
import { RemoteContentShareReactionOverlay } from './VideoGallery/RemoteContentShareReactionOverlay';
16+
/* @conditional-compile-remove(together-mode) */
17+
import { TogetherModeOverlay } from './TogetherModeOverlay';
18+
/* @conditional-compile-remove(together-mode) */
19+
import { togetherModeMeetingOverlayStyle } from './styles/TogetherMode.styles';
1420

1521
/**
1622
* Reaction overlay component props
@@ -40,6 +46,9 @@ export interface MeetingReactionOverlayProps {
4046
* Remote participant's reaction event.
4147
*/
4248
remoteParticipants?: VideoGalleryRemoteParticipant[];
49+
50+
/* @conditional-compile-remove(together-mode) */
51+
togetherModeSeatPositions?: VideoGalleryTogetherModeParticipantPosition;
4352
}
4453

4554
/**
@@ -68,7 +77,14 @@ const REACTION_EMOJI_RESIZE_SCALE_CONSTANT = 3;
6877
* @internal
6978
*/
7079
export const MeetingReactionOverlay = (props: MeetingReactionOverlayProps): JSX.Element => {
71-
const { overlayMode, reaction, reactionResources, localParticipant, remoteParticipants } = props;
80+
const {
81+
overlayMode,
82+
reaction,
83+
reactionResources,
84+
localParticipant,
85+
remoteParticipants,
86+
/* @conditional-compile-remove(together-mode) */ togetherModeSeatPositions
87+
} = props;
7288
const [emojiSizePx, setEmojiSizePx] = useState(0);
7389
const [divHeight, setDivHeight] = useState(0);
7490
const [divWidth, setDivWidth] = useState(0);
@@ -125,6 +141,24 @@ export const MeetingReactionOverlay = (props: MeetingReactionOverlayProps): JSX.
125141
/>
126142
</div>
127143
);
144+
} else if (props.overlayMode === 'together-mode') {
145+
/* @conditional-compile-remove(together-mode) */
146+
return (
147+
<div
148+
style={{
149+
...togetherModeMeetingOverlayStyle
150+
}}
151+
>
152+
<TogetherModeOverlay
153+
emojiSize={emojiSizePx}
154+
reactionResources={reactionResources}
155+
localParticipant={localParticipant ?? ({} as VideoGalleryLocalParticipant)}
156+
remoteParticipants={remoteParticipants ?? ([] as VideoGalleryRemoteParticipant[])}
157+
togetherModeSeatPositions={togetherModeSeatPositions ?? {}}
158+
/>
159+
</div>
160+
);
161+
return <></>;
128162
} else {
129163
return <></>;
130164
}

0 commit comments

Comments
 (0)