You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/communication-services/how-tos/calling-sdk/includes/closed-captions/closed-captions-teams-interop-web.md
- Azure account with an active subscription, for details see [Create an account for free.](https://azure.microsoft.com/free/)
15
15
- Azure Communication Services resource. See [Create an Azure Communication Services resource](../../../quickstarts/create-communication-resource.md?tabs=windows&pivots=platform-azp). Save the connection string for this resource.
16
16
- An app with voice and video calling, refer to our [Voice](../../quickstarts/voice-video-calling/getting-started-with-calling.md) and [Video](../../quickstarts/voice-video-calling/get-started-with-video-calling.md) calling quickstarts.
17
-
-[Access tokesn](../../quickstarts/manage-teams-identity.md) for Microsoft 365 users.
18
-
-[Access tokesn](../../quickstarts/identity/access-tokens.md) for External identity users.
19
-
- For Translated captions you will need to have a [Teams premium] license.
17
+
-[Access tokens](../../quickstarts/manage-teams-identity.md) for Microsoft 365 users.
18
+
-[Access tokens](../../quickstarts/identity/access-tokens.md) for External identity users.
19
+
- For Translated captions you will need to have a [Teams premium](/MicrosoftTeams/teams-add-on-licensing/licensing-enhance-teams#meetings) license.
20
20
21
21
>[!NOTE]
22
-
>Please note that you will need to have a voice calling app using ACS calling SDKs to access the closed captions feature that is described in the quickstart below.
23
-
24
-
## Join a Teams meeting
25
-
22
+
>Please note that you will need to have a voice calling app using ACS calling SDKs to access the closed captions feature that is described in this guide.
26
23
27
24
## Models
28
25
| Name | Description |
@@ -32,83 +29,124 @@ ms.author: kpunjabi
32
29
| TeamsCaptionHandler | Callback definition for handling CaptionsReceivedEventType event |
33
30
| TeamsCaptionsInfo | Data structure received for each CaptionsReceivedEventType event |
34
31
35
-
## Get captions feature for External Identity users
32
+
## Get closed captions feature
33
+
34
+
### External Identity users
35
+
36
+
If you're building an application that allows ACS users to join a Teams meeting.
36
37
37
38
```typescript
38
39
let teamsCaptions:SDK.TeamsCaptionsCallFeature=call.feature(SDK.Features.TeamsCaptions);
39
40
```
40
41
41
-
## Get captions feature for Microsoft 365 users on ACS SDK
42
+
### Microsoft 365 users on ACS SDK
43
+
44
+
If you're building an app for Microsoft 365 Users using ACS SDK.
42
45
43
46
```typescript
44
47
let teamsCaptions:SDK.TeamsCaptionsCallFeature=teamsCall.feature(SDK.Features.TeamsCaptions);
45
48
```
46
49
47
-
## Set captions handler and start captions
50
+
## Subscribe to listeners
48
51
49
-
Set the `captionsReceived` event handler via the `on` API
52
+
### Add a listener to receive captions active/inactive status
50
53
51
-
```typescript
52
-
const teamsCaptionsHandler = (data:TeamsCaptionsInfo) => { /* USER CODE HERE - E.G. RENDER TO DOM */ };
Access the `supportedSpokenLanguages` property on the `Features.TeamsCaptions` API. Earlier, the API was set to TeamsCaptionsApi. The property will return an array of langauges in bcp-47 format.
72
+
Once you've got all your listeners setup you can now start captions.
Pass a value in from the supported spoken languages array to ensure that the requested language is supported. By default, if contoso provides no language or an unsupported language, the spoken language defaults to 'en-us'.
82
+
## Stop captions
76
83
77
84
```typescript
78
-
// bcp 47 formatted language code
79
-
const language ='en-us';
85
+
try {
86
+
teamsCaptionsApi.stopCaptions();
87
+
} catch (e) {
88
+
/* USER ERROR HANDLING CODE HERE */
89
+
}
90
+
```
80
91
81
-
// Altneratively, pass a value fromt he supported spoken languages array
If your organization has Teams premium license you can allow your users to leverage translated captions provided by Teams captions. The property returns an array of two-letter langauge codes in `ISO 639-1` standard.
100
+
### Get a list of supported spoken languages
89
101
90
-
Access the `supportedCaptionLanguages` property on the `Features.TeamsCaptions` API.
102
+
Get a list of supported spoken languages that your users can select from when enabling closed captions.
103
+
The property will return an array of langauges in bcp 47 format.
If your organization has Teams premium license you can allow your users to leverage translated captions provided by Teams captions. Contoso can generate a list of supported caption languages by calling `teamsCaptions.supportedCaptionLanguages` that returns an array of two-letter langauge codes in `ISO 639-1` standard.
109
+
### Set spoken language
98
110
99
-
Pass a value in from the supported caption languages array to ensure that the requested language is supported.
111
+
Pass a value in from the supported spoken languages array to ensure that the requested language is supported. By default, if contoso provides no language or an unsupported language, the spoken language defaults to 'en-us'.
100
112
101
113
```typescript
102
-
//ISO 639-1 formatted language code
114
+
//bcp 47 formatted language code
103
115
const language ='en-us';
104
116
105
-
// Altneratively, pass a value fromt he supported spoken languages array
106
-
const language =captionLanguages[0]; teamsCaptionsApi.setCaptionLanguage(language);
117
+
// Altneratively, pass a value from the supported spoken languages array
118
+
const language =spokenLanguages[0];
119
+
120
+
try {
121
+
teamsCaptions.setSpokenLanguage(language);
122
+
} catch (e) {
123
+
/* USER ERROR HANDLING CODE HERE */
124
+
}
107
125
```
108
126
109
-
## Stop captions
127
+
## Caption language support
128
+
129
+
### Get a list of supported caption languages
130
+
131
+
If your organization has an active Teams premium license you can allow your users to leverage translated captions provided by Teams captions. As for users with a Microsoft 365 identity, if the meeting organizer does not have an active Teams premium license, captions language check will be done against the Microsoft 365 users account.
132
+
133
+
The property returns an array of two-letter langauge codes in `ISO 639-1` standard.
0 commit comments