Skip to content

Commit 7148287

Browse files
Merge pull request #276110 from DaybreakQuip/capabilities
ACS Calling Native Capabilities Doc update
2 parents b45e271 + a9750d2 commit 7148287

File tree

4 files changed

+205
-1
lines changed

4 files changed

+205
-1
lines changed

articles/communication-services/how-tos/calling-sdk/capabilities.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ ms.subservice: calling
99
ms.topic: how-to
1010
ms.date: 03/24/2023
1111
ms.custom: template-how-to
12+
zone_pivot_groups: acs-plat-web-ios-android-windows
1213
---
1314
# 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+
Do I have permission to turn on video, do I have permission to turn on mic, 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.
1516

1617
## Prerequisites
1718
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
@@ -20,7 +21,22 @@ Do I have permission to turn video on, do I have permission to turn mic on, do I
2021
- Optional: Complete the quick start to [add voice calling to your application](../../quickstarts/voice-video-calling/getting-started-with-calling.md)
2122

2223
## Supported Platform - Web
24+
25+
::: zone pivot="platform-web"
2326
[!INCLUDE [Capabilities JavaScript](./includes/capabilities/capabilities-web.md)]
27+
::: zone-end
28+
29+
::: zone pivot="platform-android"
30+
[!INCLUDE [Capabilities Android](./includes/capabilities/capabilities-android.md)]
31+
::: zone-end
32+
33+
::: zone pivot="platform-windows"
34+
[!INCLUDE [Capabilities Windows](./includes/capabilities/capabilities-windows.md)]
35+
::: zone-end
36+
37+
::: zone pivot="platform-ios"
38+
[!INCLUDE [Capabilities iOS](./includes/capabilities/capabilities-ios.md)]
39+
::: zone-end
2440

2541
## Supported Calltype
2642
The feature is currently supported only for Azure Communication Services Rooms call type and teams meeting call type
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
author: DaybreakQuip
3+
ms.service: azure-communication-services
4+
ms.topic: include
5+
ms.date: 05/21/2024
6+
ms.author: zehangzheng
7+
---
8+
[!INCLUDE [Install SDK](../install-sdk/install-sdk-android.md)]
9+
[!INCLUDE [Public Preview Disclaimer](../../../../includes/public-preview-include-document.md)]
10+
11+
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.
12+
13+
The feature allows you to register for an event listener, to listen to capability changes.
14+
15+
In order to use the Capabilities call feature for Windows, the first step is to obtain the Capabilities feature API object:
16+
17+
## Obtaining capabilities feature
18+
```java
19+
private CapabilitiesCallFeature capabilitiesCallFeature;
20+
capabilitiesCallFeature = call.feature(Features.CAPABILITIES);
21+
```
22+
23+
## Get the capabilities of the local participant
24+
Capabilities object has the capabilities of the local participants and is of type `ParticipantCapability`. Properties of Capabilities include:
25+
26+
- *isAllowed* indicates if a capability can be used.
27+
- *reason* indicates capability resolution reason.
28+
29+
```java
30+
List<ParticipantCapability> capabilities = capabilitiesCallFeature.getCapabilities();
31+
```
32+
33+
## Subscribe to `capabilitiesChanged` event
34+
```java
35+
36+
capabilitiesCallFeature.addOnCapabilitiesChangedListener(this::OnCapabilitiesChanged);
37+
38+
private void OnCapabilitiesChanged(CapabilitiesChangedEvent args)
39+
{
40+
String event = String.format("Capabilities Event: %s", args.getReason().toString());
41+
Log.i("CapabilitiesInfo", event);
42+
for (ParticipantCapability capability : args.getChangedCapabilities())
43+
{
44+
Log.i("CapabilitiesInfo", capability.getType().toString() + " is " capability.getReason().toString());
45+
}
46+
}
47+
```
48+
49+
## Capabilities Exposed
50+
- *TurnVideoOn*: Ability to turn video on
51+
- *UnmuteMicrophone*: Ability to unmute microphone
52+
- *ShareScreen*: Ability to share screen
53+
- *RemoveParticipant*: Ability to remove a participant
54+
- *HangUpForEveryone*: Ability to hang up for everyone
55+
- *AddCommunicationUser*: Ability to add a communication user
56+
- *AddTeamsUser*: Ability to add Teams User
57+
- *AddPhoneNumber*: Ability to add phone number
58+
- *ManageLobby*: Ability to manage lobby
59+
- *SpotlightParticipant*: Ability to spotlight Participant
60+
- *RemoveParticipantSpotlight*: Ability to remove Participant spotlight
61+
- *BlurBackground*: Ability to blur background
62+
- *CustomBackground*: Ability to apply a custom background
63+
- *StartLiveCaptions*: Ability to start live captions
64+
- *RaiseHand*: Ability to raise hand
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
author: DaybreakQuip
3+
ms.service: azure-communication-services
4+
ms.topic: include
5+
ms.date: 05/21/2024
6+
ms.author: zehangzheng
7+
---
8+
[!INCLUDE [Install SDK](../install-sdk/install-sdk-ios.md)]
9+
[!INCLUDE [Public Preview Disclaimer](../../../../includes/public-preview-include-document.md)]
10+
11+
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.
12+
13+
The feature allows you to register for an event listener, to listen to capability changes.
14+
15+
In order to use the Capabilities call feature for Windows, the first step is to obtain the Capabilities feature API object:
16+
17+
## Obtaining capabilities feature
18+
```swift
19+
let capabilitiesCallFeature =call.feature(Features.capabilities)
20+
```
21+
22+
## Get the capabilities of the local participant
23+
Capabilities object has the capabilities of the local participants and is of type `ParticipantCapability`. Properties of Capabilities include:
24+
25+
- *isAllowed* indicates if a capability can be used.
26+
- *reason* indicates capability resolution reason.
27+
28+
```swift
29+
var capabilities = capabilitiesCallFeature.capabilities
30+
```
31+
32+
## Subscribe to `capabilitiesChanged` event
33+
```swift
34+
35+
capabilitiesCallFeature.delegate = CapabilitiesCallDelegate()
36+
37+
public class CapabilitiesCallDelegate : CapabilitiesCallFeatureDelegate
38+
{
39+
public func capabilitiesCallFeature(_ capabilitiesCallFeature: CapabilitiesCallFeature, didChangeCapabilities args: CapabilitiesChangedEventArgs) {
40+
let changedReason = args.reason
41+
let changedCapabilities = args.changedCapabilities
42+
}
43+
}
44+
```
45+
46+
## Capabilities Exposed
47+
- *TurnVideoOn*: Ability to turn video on
48+
- *UnmuteMicrophone*: Ability to unmute microphone
49+
- *ShareScreen*: Ability to share screen
50+
- *RemoveParticipant*: Ability to remove a participant
51+
- *HangUpForEveryone*: Ability to hang up for everyone
52+
- *AddCommunicationUser*: Ability to add a communication user
53+
- *AddTeamsUser*: Ability to add Teams User
54+
- *AddPhoneNumber*: Ability to add phone number
55+
- *ManageLobby*: Ability to manage lobby
56+
- *SpotlightParticipant*: Ability to spotlight Participant
57+
- *RemoveParticipantSpotlight*: Ability to remove Participant spotlight
58+
- *BlurBackground*: Ability to blur background
59+
- *CustomBackground*: Ability to apply a custom background
60+
- *StartLiveCaptions*: Ability to start live captions
61+
- *RaiseHand*: Ability to raise hand
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
author: DaybreakQuip
3+
ms.service: azure-communication-services
4+
ms.topic: include
5+
ms.date: 05/21/2024
6+
ms.author: zehangzheng
7+
---
8+
[!INCLUDE [Install SDK](../install-sdk/install-sdk-windows.md)]
9+
[!INCLUDE [Public Preview Disclaimer](../../../../includes/public-preview-include-document.md)]
10+
11+
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.
12+
13+
The feature allows you to register for an event listener, to listen to capability changes.
14+
15+
In order to use the Capabilities call feature for Windows, the first step is to obtain the Capabilities feature API object:
16+
17+
## Obtaining capabilities feature
18+
```C#
19+
private CapabilitiesCallFeature capabilitiesCallFeature;
20+
capabilitiesCallFeature = call.Features.Capabilities;
21+
```
22+
23+
## Get the capabilities of the local participant
24+
Capabilities object has the capabilities of the local participants and is of type `ParticipantCapability`. Properties of Capabilities include:
25+
26+
- *isAllowed* indicates if a capability can be used.
27+
- *reason* indicates capability resolution reason.
28+
29+
```C#
30+
var capabilities = capabilitiesCallFeature.Capabilities;
31+
```
32+
33+
## Subscribe to `capabilitiesChanged` event
34+
```C#
35+
capabilitiesCallFeature.CapabilitiesChanged += Call__OnCapabilitiesChangedAsync;
36+
37+
private async void Call__OnCapabilitiesChangedAsync(object sender, CapabilitiesChangedEventArgs args)
38+
{
39+
Trace.WriteLine(args.Reason.ToString());
40+
foreach (var capability in args.ChangedCapabilities)
41+
{
42+
//Prints out capability kind and resolution reason in console
43+
Trace.WriteLine(capability.Kind.ToString() + " is " + capability.Reason.ToString());
44+
}
45+
}
46+
```
47+
48+
## Capabilities Exposed
49+
- *TurnVideoOn*: Ability to turn video on
50+
- *UnmuteMicrophone*: Ability to unmute microphone
51+
- *ShareScreen*: Ability to share screen
52+
- *RemoveParticipant*: Ability to remove a participant
53+
- *HangUpForEveryone*: Ability to hang up for everyone
54+
- *AddCommunicationUser*: Ability to add a communication user
55+
- *AddTeamsUser*: Ability to add Teams User
56+
- *AddPhoneNumber*: Ability to add phone number
57+
- *ManageLobby*: Ability to manage lobby
58+
- *SpotlightParticipant*: Ability to spotlight Participant
59+
- *RemoveParticipantSpotlight*: Ability to remove Participant spotlight
60+
- *BlurBackground*: Ability to blur background
61+
- *CustomBackground*: Ability to apply a custom background
62+
- *StartLiveCaptions*: Ability to start live captions
63+
- *RaiseHand*: Ability to raise hand

0 commit comments

Comments
 (0)