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/events/events-web.md
+36-33Lines changed: 36 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,25 @@
1
1
---
2
-
author: probableprime
2
+
author: sloanster
3
3
ms.service: azure-communication-services
4
4
ms.topic: include
5
-
ms.date: 09/08/2021
6
-
ms.author: rifox
5
+
ms.date: 05/09/2024
6
+
ms.author: micahvivion
7
7
---
8
-
##Events on the Azure Communication Calling SDK
8
+
# Events on the Azure Communication Calling SDK
9
9
10
10
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.
11
11
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
+
12
14
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).
13
15
14
16
Each object in the JavaScript calling SDK has `properties` and `collections`. Their values change throughout the lifetime of the object.
15
17
Use the `on()` method to subscribe to objects' events, and use the `off()` method to unsubscribe from objects' events.
16
18
17
-
###Properties
19
+
## Properties
18
20
You can subscribe to the `'<property>Changed'` event to listen to value changes on the property.
19
21
20
-
####Example of subscription on a property
22
+
### Example of subscription on a property
21
23
In this example, we subscribe to changes in the value of the `isLocalVideoStarted` property.
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.
32
34
33
35
- The `'<collection>Updated'` event's payload, has an `added` array that contains values that were added to the collection.
34
36
- The `'<collection>Updated'` event's payload also has a `removed` array that contains values that were removed from the collection.
35
37
36
-
####Example subscription on a collection
38
+
### Example subscription on a collection
37
39
38
40
In this example, we subscribe to changes in values of the Call object `LocalVideoStream`.
39
41
@@ -49,9 +51,10 @@ In this example, we subscribe to changes in values of the Call object `LocalVide
49
51
```
50
52
51
53
<!---------- CallAgent object ---------->
52
-
### Events on the `CallAgent` object
54
+
## Events on the `CallAgent` object
55
+
56
+
### Event Name: `incomingCall`
53
57
54
-
#### Event Name: `incomingCall`
55
58
The `incomingCall` event fires when a call is coming.
56
59
57
60
**How should your application react to the event?**
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.
79
82
80
83
**How should your application react to the event?**
81
84
Your application should update its UI based on the number of active calls for the CallAgent instance.
82
85
83
-
#### Event Name: `connectionStateChanged`
86
+
### Event Name: `connectionStateChanged`
84
87
85
88
The `connectionStateChanged` event fired when the state of the `CallAgent` is updated.
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.
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.
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.
264
267
@@ -267,7 +270,7 @@ The `remoteAudioStreamsUpdated` event is fired when the list of remote audio str
267
270
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.
268
271
269
272
270
-
#### Event: `totalParticipantCountChanged`
273
+
### Event: `totalParticipantCountChanged`
271
274
272
275
The `totalParticipantCountChanged` fires when the number of totalParticipant changed in a call.
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.
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.
0 commit comments