Skip to content

Commit c0620f3

Browse files
authored
Update closed-captions-teams-interop-web.md
Add updateCaptionsLanguage
1 parent 757bad7 commit c0620f3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

articles/communication-services/how-tos/calling-sdk/includes/closed-captions/closed-captions-teams-interop-web.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,29 @@ const language = spokenLanguages[0];
8383
teamsCaptionsApi.setSpokenLanguage(language);
8484
```
8585

86+
## Get supported caption languages
87+
88+
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.
89+
90+
Access the `supportedCaptionLanguages` property on the `Features.TeamsCaptions` API.
91+
92+
``` typescript
93+
const captionLanguages = teamsCaptionsApi.supportedCaptionLanguages;
94+
```
95+
96+
## Update caption language
97+
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.
98+
99+
Pass a value in from the supported caption languages array to ensure that the requested language is supported.
100+
101+
``` typescript
102+
// ISO 639-1 formatted language code
103+
const language = 'en-us';
104+
105+
// Altneratively, pass a value fromt he supported spoken languages array
106+
const language = captionLanguages[0]; teamsCaptionsApi.setCaptionLanguage(language);
107+
```
108+
86109
## Stop captions
87110

88111
``` typescript

0 commit comments

Comments
 (0)