Skip to content

Commit e350969

Browse files
Merge branch 'main' into vhuseinova/release-template-link-added
2 parents feec1ba + b15b2b0 commit e350969

File tree

2 files changed

+152
-0
lines changed

2 files changed

+152
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { Meta, Source } from '@storybook/addon-docs';
2+
import BreakoutRoomsEventSnippetText from '!!raw-loader!./snippets/BreakoutRoomsUpdatedEvent.snippet.tsx';
3+
4+
<Meta
5+
id="breakout rooms"
6+
title="Concepts/Breakout rooms"
7+
parameters={{ previewTabs: { canvas: { disable: true, hidden: true } } }}
8+
/>
9+
10+
# Breakout Rooms
11+
12+
## Overview
13+
14+
ACS and Team identity users are now ready to be moved into breakout rooms in Teams meetings when the meeting organizer
15+
assigns the ACS or Teams identity user a breakout room and opens that breakout room. ACS and Teams identity users,
16+
however, will not yet have the ability to choose their breakout room when they are granted by meeting organizer. ACS
17+
and Teams identity users can be move into breakout rooms but they will not yet have the ability to create and manage
18+
breakout rooms when they have organizer or co-organizer role.
19+
20+
Click [here](https://support.microsoft.com/en-us/office/use-breakout-rooms-in-microsoft-teams-meetings-7de1f48a-da07-466c-a5ab-4ebace28e461)
21+
to learn more about breakout rooms in Teams meetings and how to create and manage breakout rooms as a Teams user.
22+
23+
## Composites
24+
25+
ACS and Team identity users using the CallComposite and CallWithChatComposite will now be able move to breakout rooms
26+
in Teams meetings. When the meeting organizer assigns a breakout room to an ACS or Teams identity user and that
27+
breakout room is opened, the composite will automatically change the current call to the breakout room. When the
28+
breakout room is closed, the ACS or Teams identity user will automatically be moved back the the main meeting.
29+
30+
There are notifications that will be shown to guide the ACS or Teams identity user through the composite transitions
31+
between the main meeting and breakout room. The notifications are shown when:
32+
33+
- the user's assigned breakout room opens and the user will be automatically moved to the breakout room
34+
- the user's assigned breakout room opens and the user is prompted to join
35+
- the user joins a breakout room
36+
- the user's assigned breakout room is changed while already in a breakout room
37+
- the user is in a breakout room with a time limit and that breakout room is closing soon
38+
- the user is in a breakout room and that breakout room is closed
39+
40+
## Handling breakoutRoomsUpdated events
41+
42+
The [CallAdapter](?path=/docs/composites-adapters--docs#calladapter) and CallWithChatAdapter are able to receive
43+
`breakoutRoomsUpdated` events and allows you to handle these events by defining your own `BreakoutRoomsUpdateListener`
44+
callback. The following code snippet shows an example of a `BreakoutRoomsUpdateListener` that outputs the event to the
45+
browser console.
46+
47+
<Source code={BreakoutRoomsEventSnippetText} />
48+
49+
Note: The `breakoutRoomsUpdated` room event encompasses 4 types: `assignedBreakoutRooms`, `join`,
50+
`breakoutRoomsSettings`, and `breakoutRooms`
51+
52+
## FAQs
53+
54+
### Are breakout rooms supported in calls other than Teams meetings?
55+
56+
No. Breakout rooms is a feature that is currently only available in Teams meetings
57+
58+
### Can ACS or Teams identity users choose their own breakout room to join?
59+
60+
Can ACS or Teams identity users will not yet be able to choose their own breakout room like in Teams. The meeting
61+
organizer must assign the breakout room for the ACS or Teams identity user.
62+
63+
### Where can I learn about managing breakout rooms and their settings?
64+
65+
This [documentation](https://support.microsoft.com/en-us/office/use-breakout-rooms-in-microsoft-teams-meetings-7de1f48a-da07-466c-a5ab-4ebace28e461)
66+
will guide you on everything you need to know about creating and managing breakout rooms as a Teams user.
67+
68+
Note: ACS Web UI Library cannot yet be used to manage breakout rooms and their settings
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { AzureCommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';
2+
import {
3+
CallAdapter,
4+
CallComposite,
5+
CallCompositeOptions,
6+
CompositeLocale,
7+
useAzureCommunicationCallAdapter
8+
} from '@azure/communication-react';
9+
import { PartialTheme, Theme } from '@fluentui/react';
10+
import React, { useCallback, useMemo } from 'react';
11+
12+
export type ContainerProps = {
13+
userId: CommunicationUserIdentifier;
14+
token: string;
15+
formFactor?: 'desktop' | 'mobile';
16+
fluentTheme?: PartialTheme | Theme;
17+
locale?: CompositeLocale;
18+
options?: CallCompositeOptions;
19+
// Teams user ids need to be in format '28:orgid:<UUID>'. For example, '28:orgid:87d349ed-44d7-43e1-9a83-5f2406dee5bd'
20+
meetingLink: string;
21+
};
22+
23+
export const ContosoCallContainer = (props: ContainerProps): JSX.Element => {
24+
const credential = useMemo(() => {
25+
try {
26+
return new AzureCommunicationTokenCredential(props.token);
27+
} catch {
28+
console.error('Failed to construct token credential');
29+
return undefined;
30+
}
31+
}, [props.token]);
32+
33+
const callAdapterArgs = useMemo(
34+
() => ({
35+
userId: props.userId,
36+
credential,
37+
locator: props.meetingLink
38+
}),
39+
[props.userId, credential, props.meetingLink]
40+
);
41+
42+
const afterCallAdapterCreate = useCallback(async (adapter: CallAdapter): Promise<CallAdapter> => {
43+
adapter.on('breakoutRoomsUpdated', (event) => {
44+
if (event.type === 'assignedBreakoutRooms') {
45+
console.log('Assigned breakout rooms event: ', event);
46+
} else if (event.type === 'join') {
47+
console.log('Breakout rooms join event: ', event);
48+
} else if (event.type === 'breakoutRoomsSettings') {
49+
console.log('Breakout rooms settings event: ', event);
50+
}
51+
});
52+
return adapter;
53+
}, []);
54+
55+
const leaveCall = async (adapter: CallAdapter): Promise<void> => {
56+
await adapter.leaveCall().catch((e) => {
57+
console.error('Failed to leave call', e);
58+
});
59+
};
60+
61+
const adapter = useAzureCommunicationCallAdapter(callAdapterArgs, afterCallAdapterCreate, leaveCall);
62+
63+
if (!props.meetingLink) {
64+
return <>Teams meeting link not provided.</>;
65+
}
66+
67+
if (adapter) {
68+
return (
69+
<div style={{ height: '90vh', width: '90vw' }}>
70+
<CallComposite
71+
adapter={adapter}
72+
formFactor={props.formFactor}
73+
fluentTheme={props.fluentTheme}
74+
locale={props?.locale}
75+
options={props?.options}
76+
/>
77+
</div>
78+
);
79+
}
80+
if (credential === undefined) {
81+
return <>Failed to construct credential. Provided token is malformed.</>;
82+
}
83+
return <>Initializing...</>;
84+
};

0 commit comments

Comments
 (0)