Skip to content

Commit 85f84d3

Browse files
authored
Merge pull request #99018 from csandjon/patch-3
Update manage-video-web.md
2 parents 4e291b4 + 6043641 commit 85f84d3

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

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

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,55 @@ If the specified video device is being used by another process, or if it is disa
144144
- A call to the `localVideoStream.switchSource()` method will cause `cameraStartFailed` to be set to true.
145145
Our Call Diagnostics guide provides additional information on how to diagnose call related issues.
146146

147+
To check or verify if the local video is on or off, you can use isLocalVideoStarted API which returns true or false:
148+
```js
149+
// Check if local video is on or off
150+
call.isLocalVideoStarted;
151+
```
152+
153+
To listen for changes to the local video, you can subscribe and unsubscribe to the isLocalVideoStartedChanged event
154+
```js
155+
// Subscribe to local video event
156+
call.on('isLocalVideoStartedChanged', () => {
157+
// Callback();
158+
});
159+
// Unsubscribe from local video event
160+
call.off('isLocalVideoStartedChanged', () => {
161+
// Callback();
162+
});
163+
```
164+
165+
166+
167+
## Start and stop screen sharing while on a call
168+
To start and stop screen sharing while on a call, you can use asynchronous APIs startScreenSharing and stopScreenSharing respectively:
169+
170+
```js
171+
// Start screen sharing
172+
await call.startScreenSharing();
173+
174+
// Stop screen sharing
175+
await call.stopScreenSharing();
176+
```
177+
178+
To check or verify if screen sharing is on or off, you can use isScreenSharingOn API which returns true or false:
179+
```js
180+
// Check if screen sharing is on or off
181+
call.isScreenSharingOn;
182+
```
183+
184+
To listen for changes to the screen share, you can subscribe and unsubscribe to the isScreenSharingOnChanged event
185+
```js
186+
// Subscribe to screen share event
187+
call.on('isScreenSharingOnChanged', () => {
188+
// Callback();
189+
});
190+
// Unsubscribe from screen share event
191+
call.off('isScreenSharingOnChanged', () => {
192+
// Callback();
193+
});
194+
```
195+
147196
## Render remote participant video streams
148197

149198
To list the video streams and screen sharing streams of remote participants, inspect the `videoStreams` collections:

0 commit comments

Comments
 (0)