Skip to content

Commit d330e04

Browse files
authored
Merge pull request #178803 from fizampou/patch-5
Update dominant-speaker-web.md
2 parents f433166 + 9d0e990 commit d330e04

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

articles/communication-services/how-tos/calling-sdk/includes/dominant-speaker/dominant-speaker-web.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This is a ranked list, where the first element in the list represents the last a
1717
In order to obtain the dominant speakers in a call, you first need to obtain the call dominant speakers feature API object:
1818

1919
```js
20-
const callDominantSpeakersApi = call.api(Features.CallDominantSpeakers);
20+
const callDominantSpeakersApi = call.feature(Features.CallDominantSpeakers);
2121
```
2222

2323
Then, obtain the list of the dominant speakers by calling `dominantSpeakers`. This has a type of `DominantSpeakersInfo`, which has the following members:
@@ -74,7 +74,7 @@ function getRemoteParticipantForDominantSpeaker(dominantSpeakerIdentifier) {
7474
// Handler function for when the dominant speaker changes
7575
const dominantSpeakersChangedHandler = async () => {
7676
// Get the new dominant speaker's identifier
77-
const newDominantSpeakerIdentifier = currentCall.api(Features.DominantSpeakers).dominantSpeakers.speakersList[0];
77+
const newDominantSpeakerIdentifier = currentCall.feature(Features.DominantSpeakers).dominantSpeakers.speakersList[0];
7878

7979
if (newDominantSpeakerIdentifier) {
8080
// Get the remote participant object that matches newDominantSpeakerIdentifier
@@ -119,9 +119,9 @@ currentCall.on('stateChanged', () => {
119119
}
120120
});
121121

122-
const dominantSpeakerIdentifier = currentCall.api(Features.DominantSpeakers).dominantSpeakers.speakersList[0];
122+
const dominantSpeakerIdentifier = currentCall.feature(Features.DominantSpeakers).dominantSpeakers.speakersList[0];
123123
dominantRemoteParticipant = getRemoteParticipantForDominantSpeaker(dominantSpeakerIdentifier);
124-
currentCall.api(Features.DominantSpeakers).on('dominantSpeakersChanged', dominantSpeakersChangedHandler);
124+
currentCall.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', dominantSpeakersChangedHandler);
125125

126126
subscribeToRemoteVideoStream = async (stream: RemoteVideoStream, participant: RemoteParticipant) {
127127
let renderer: VideoStreamRenderer;
@@ -156,4 +156,4 @@ subscribeToRemoteVideoStream = async (stream: RemoteVideoStream, participant: Re
156156
await displayVideo();
157157
}
158158
}
159-
```
159+
```

0 commit comments

Comments
 (0)