Skip to content

Commit 095422b

Browse files
authored
Merge pull request #232028 from elavarasidc/patch-1
Calling web - Capabilities feature -how to
2 parents 62ba063 + bd39f4d commit 095422b

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Get local user capabilities
3+
titleSuffix: An Azure Communication Services how-to guide
4+
description: Use Azure Communication Services SDKs to get capabilities of the local user in a call.
5+
author: elavarasid
6+
ms.author: elavarasid
7+
ms.service: azure-communication-services
8+
ms.subservice: calling
9+
ms.topic: how-to
10+
ms.date: 03/24/2023
11+
ms.custom: template-how-to
12+
---
13+
# Observe user's capabilities
14+
Do I have permission to turn video on, do I have permission to turn mic on, do I have permission to share screen? Those are some examples of participant capabilities that you can learn from the capabilities API. Learning the capabilities can help build a user interface that only shows the buttons related to the actions the local user has permissions to.
15+
16+
## Prerequisites
17+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
18+
- A deployed Communication Services resource. [Create a Communication Services resource](../../quickstarts/create-communication-resource.md).
19+
- A user access token to enable the calling client. For more information, see [Create and manage access tokens](../../quickstarts/identity/access-tokens.md).
20+
- Optional: Complete the quick start to [add voice calling to your application](../../quickstarts/voice-video-calling/getting-started-with-calling.md)
21+
22+
## Supported Platform - Web
23+
[!INCLUDE [Capabilities JavaScript](./includes/capabilities/capabilities-web.md)]
24+
25+
## Next steps
26+
- [Learn how to manage video](./manage-video.md)
27+
- [Learn how to manage calls](./manage-calls.md)
28+
- [Learn how to record calls](./record-calls.md)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
author: elavarasid
3+
ms.service: azure-communication-services
4+
ms.topic: include
5+
ms.date: 03/24/2023
6+
ms.author: elavarasid
7+
---
8+
[!INCLUDE [Install SDK](../install-sdk/install-sdk-web.md)]
9+
10+
Capabilities feature is an extended feature of the core `Call` API and allows you to obtain the capabilities of the local participant in the current call.
11+
12+
13+
The feature allows you to register for an event listener, to listen to capability changes.
14+
15+
**Register to capabilities feature:**
16+
>```js
17+
>const capabilitiesFeature = this.call.feature(Features.Capabilities);
18+
>```
19+
20+
**Get the capabilities of the local participant:**
21+
Capabilities object has the capabilities of the local participants and is of type `ParticipantCapabilities`. Properties of Capabilities include:
22+
23+
- `isPresent` represent if a capability is present.
24+
- `reason` capability resolution reason.
25+
26+
>```js
27+
>const capabilities = capabilitiesFeature.capabilities;
28+
>```
29+
30+
**Subscribe to `capabilitiesChanged` event:**
31+
>```js
32+
>capabilitiesFeature.on('capabilitiesChanged', () => {
33+
> const updatedCapabilities = capabilitiesFeature.capabilities;
34+
> // If screen share capability has changed then update the state to refresh UI and disable share screen button
35+
> if (this.state.canShareScreen != updatedCapabilities.shareScreen.isPresent) {
36+
> this.setState({ canShareScreen: updatedCapabilities.shareScreen.isPresent });
37+
> }
38+
>});
39+
>```
40+
41+
**Capabilities Exposed**
42+
> - *manageBreakOutRoom*: Ability to manage break out room
43+
> - *muteUnmuteMic*: Ability to Mute Unmute Mic
44+
> - *removeParticipant*: Ability to remove a participant
45+
> - *shareApplication*: Ability to share an application
46+
> - *shareBrowserTab*: Ability to share a browser tab

0 commit comments

Comments
 (0)