Skip to content

Commit 8d8bd84

Browse files
Address PR feedback events-web.md
1 parent dc492d8 commit 8d8bd84

File tree

1 file changed

+36
-33
lines changed
  • articles/communication-services/how-tos/calling-sdk/includes/events

1 file changed

+36
-33
lines changed

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

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
---
2-
author: probableprime
2+
author: sloanster
33
ms.service: azure-communication-services
44
ms.topic: include
5-
ms.date: 09/08/2021
6-
ms.author: rifox
5+
ms.date: 05/09/2024
6+
ms.author: micahvivion
77
---
8-
## Events on the Azure Communication Calling SDK
8+
# Events on the Azure Communication Calling SDK
99

1010
This guide describes the various events or properties changes your app can subscribe to. Subscribing to those events allows your app to be informed about state change in the calling SDK and react accordingly.
1111

12+
Tracking events is crucial because it enables your application's state to stay synchronized with the ACSCalling framework's state, all without requiring you to implement a pull mechanism on the SDK objects.
13+
1214
This guide assumes you went through the QuickStart or that you implemented an application that is able to make and receive calls. If you didn't complete the getting starting guide, refer to our [Quickstart](../../../../quickstarts/voice-video-calling/getting-started-with-calling.md).
1315

1416
Each object in the JavaScript calling SDK has `properties` and `collections`. Their values change throughout the lifetime of the object.
1517
Use the `on()` method to subscribe to objects' events, and use the `off()` method to unsubscribe from objects' events.
1618

17-
### Properties
19+
## Properties
1820
You can subscribe to the `'<property>Changed'` event to listen to value changes on the property.
1921

20-
#### Example of subscription on a property
22+
### Example of subscription on a property
2123
In this example, we subscribe to changes in the value of the `isLocalVideoStarted` property.
2224

2325
```javascript
@@ -27,13 +29,13 @@ call.on('isLocalVideoStartedChanged', () => {
2729
});
2830
```
2931

30-
### Collections
32+
## Collections
3133
You can subscribe to the '\<collection>Updated' event to receive notifications about changes in an object collection. The '\<collection>Updated' event is triggered whenever elements are added to or removed from the collection you're monitoring.
3234

3335
- The `'<collection>Updated'` event's payload, has an `added` array that contains values that were added to the collection.
3436
- The `'<collection>Updated'` event's payload also has a `removed` array that contains values that were removed from the collection.
3537

36-
#### Example subscription on a collection
38+
### Example subscription on a collection
3739

3840
In this example, we subscribe to changes in values of the Call object `LocalVideoStream`.
3941

@@ -49,9 +51,10 @@ In this example, we subscribe to changes in values of the Call object `LocalVide
4951
```
5052

5153
<!---------- CallAgent object ---------->
52-
### Events on the `CallAgent` object
54+
## Events on the `CallAgent` object
55+
56+
### Event Name: `incomingCall`
5357

54-
#### Event Name: `incomingCall`
5558
The `incomingCall` event fires when a call is coming.
5659

5760
**How should your application react to the event?**
@@ -73,14 +76,14 @@ callClient.on('incomingCall', (async (incomimgCallEvent) => {
7376
});
7477
```
7578
76-
#### Event Name: `callsUpdated`
79+
### Event Name: `callsUpdated`
7780
7881
The `callsUpdated` updated event is fired when a call is removed or added to the call agent. This event happens when the user makes, receives, or terminate call.
7982
8083
**How should your application react to the event?**
8184
Your application should update its UI based on the number of active calls for the CallAgent instance.
8285
83-
#### Event Name: `connectionStateChanged`
86+
### Event Name: `connectionStateChanged`
8487
8588
The `connectionStateChanged` event fired when the state of the `CallAgent` is updated.
8689
@@ -105,9 +108,9 @@ callClient.on('connectionStateChanged', (async (connectionStateChangedEvent) =>
105108
```
106109
107110
<!---------- Call object ---------->
108-
### Events on the `Call` object
111+
## Events on the `Call` object
109112
110-
#### Event Name: `stateChanged`
113+
### Event Name: `stateChanged`
111114
112115
The `stateChanged` event is fired when the call state changes. For example, when a call goes from `connected` to `disconnected`.
113116
@@ -133,7 +136,7 @@ call.on('stateChanged', (async (connectionStateChangedEvent) => {
133136
});
134137
```
135138
136-
#### Event: `idChanged`
139+
### Event: `idChanged`
137140
138141
The `idChanged` event is fired when the ID of a call changes. The ID of a call changes when the call moves from `connecting` state to `connected`. Once the call is connected, the ID of the call remains identical.
139142
@@ -150,7 +153,7 @@ call.on('idChanged', (async (callIdChangedEvent) => {
150153
});
151154
```
152155
153-
#### Event: `isMutedChanged`
156+
### Event: `isMutedChanged`
154157
155158
The `isMutedChanged` event is fired when the call is muted or unmuted.
156159
@@ -166,7 +169,7 @@ call.on('isMutedChanged', (async (isMutedChangedEvent) => {
166169
});
167170
```
168171
169-
#### Event: `isScreenSharingOnChanged`
172+
### Event: `isScreenSharingOnChanged`
170173
171174
The `isScreenSharingOnChanged` event is fired when screen sharing for the local user is enabled or disabled.
172175
@@ -191,7 +194,7 @@ call.on('isScreenSharingOnChanged', () => {
191194
});
192195
```
193196
194-
#### Event: `isLocalVideoStartedChanged`
197+
### Event: `isLocalVideoStartedChanged`
195198
196199
The `isLocalVideoStartedChanged` event is fired when the user enabled our disabled its local video.
197200
@@ -207,7 +210,7 @@ call.on('isLocalVideoStartedChanged', () => {
207210
});
208211
```
209212
210-
#### Event: `remoteParticipantsUpdated`
213+
### Event: `remoteParticipantsUpdated`
211214
212215
Your application should subscribe to event for each added `RemoteParticipants` and unsubscribe of events for participant that are gone from the call.
213216
@@ -234,7 +237,7 @@ call.on('remoteParticipantsUpdated', (remoteParticipantsUpdatedEvent) => {
234237
});
235238
```
236239
237-
#### Event: `localVideoStreamsUpdated`
240+
### Event: `localVideoStreamsUpdated`
238241
239242
The `localVideoStreamsUpdated` event is fired when the list of local video stream changes. These changes happen when the user starts or remove a video stream.
240243
@@ -258,7 +261,7 @@ call.on('localVideoStreamsUpdated', (localVideoStreamUpdatedEvent) => {
258261
});
259262
```
260263
261-
#### Event: `remoteAudioStreamsUpdated`
264+
### Event: `remoteAudioStreamsUpdated`
262265
263266
The `remoteAudioStreamsUpdated` event is fired when the list of remote audio stream. These changes happen when remote participants add or remove audio streams to the call.
264267
@@ -267,7 +270,7 @@ The `remoteAudioStreamsUpdated` event is fired when the list of remote audio str
267270
If a stream was being processed and is now removed, the processing should be stopped. On the other hand, if a stream is added then the event reception is a good place to start the processing of the new audio stream.
268271
269272
270-
#### Event: `totalParticipantCountChanged`
273+
### Event: `totalParticipantCountChanged`
271274
272275
The `totalParticipantCountChanged` fires when the number of totalParticipant changed in a call.
273276
@@ -285,7 +288,7 @@ call.on('totalParticipantCountChanged', () => {
285288
286289
</details>
287290
288-
#### Event: `roleChanged`
291+
### Event: `roleChanged`
289292
290293
The `roleChanged` participant fires when the localParticipant roles changes in the call. An example would be when the local participant become presenter `ACSCallParticipantRolePresenter` in a call.
291294
@@ -317,9 +320,9 @@ call.on('mutedByOthers', () => {
317320
```
318321
319322
<!---- RemoteParticipant ---->
320-
### Events on the `RemoteParticipant` object
323+
## Events on the `RemoteParticipant` object
321324
322-
#### Event: `roleChanged`
325+
### Event: `roleChanged`
323326
324327
The `roleChanged` event fires when the `RemotePartipant` role changes in the call. An example would be when the RemoteParticipant become presenter `ACSCallParticipantRolePresenter` in a call.
325328
@@ -334,7 +337,7 @@ remoteParticipant.on('roleChanged', () => {
334337
});
335338
```
336339
337-
#### Event: `isMutedChanged`
340+
### Event: `isMutedChanged`
338341
339342
The `isMutedChanged` event fires when one of the `RemoteParticipant` mutes or unmute its microphone.
340343
@@ -350,7 +353,7 @@ remoteParticipant.on('isMutedChanged', () => {
350353
});
351354
```
352355
353-
#### Event: `displayNameChanged`
356+
### Event: `displayNameChanged`
354357
355358
The `displayNameChanged` when the name of the `RemoteParticipant` is updated.
356359
@@ -366,7 +369,7 @@ remoteParticipant.on('displayNameChanged', () => {
366369
});
367370
```
368371
369-
#### Event: `isSpeakingChanged`
372+
### Event: `isSpeakingChanged`
370373
371374
The `isSpeakingChanged` when the dominant speaker in a call changes.
372375
@@ -382,7 +385,7 @@ remoteParticipant.on('isSpeakingChanged', () => {
382385
});
383386
```
384387
385-
#### Event: `videoStreamsUpdated`
388+
### Event: `videoStreamsUpdated`
386389
387390
The `videoStreamsUpdated` when a remote participant adds or removes a VideoStream to/from the call.
388391
@@ -409,9 +412,9 @@ remoteParticipant.on('videoStreamsUpdated', (videoStreamsUpdatedEvent) => {
409412
410413
<!-- AudioEffectsFeature -->
411414
412-
### Event on the `AudioEffectsFeature` object
415+
## Event on the `AudioEffectsFeature` object
413416
414-
#### Event: `effectsStarted`
417+
### Event: `effectsStarted`
415418
416419
This event occurs when the audio effect selected is applied to the audio stream.
417420
@@ -427,7 +430,7 @@ audioEffectsFeature.on('effectsStarted', (effects) => {
427430
});
428431
```
429432
430-
#### Event: `effectsStopped`
433+
### Event: `effectsStopped`
431434
432435
This event occurs when the audio effect selected is applied to the audio stream.
433436
@@ -443,7 +446,7 @@ audioEffectsFeature.on('effectsStopped', (effects) => {
443446
});
444447
```
445448
446-
#### Event: `effectsError`
449+
### Event: `effectsError`
447450
448451
This event occurs when an error happens while an audio effect is started or applied.
449452

0 commit comments

Comments
 (0)