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/manage-video/manage-video-web.md
+68-26Lines changed: 68 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,8 @@ console.log(result.video);
165
165
166
166
To place a video call, you have to enumerate local cameras by using the `getCameras()` method in `deviceManager`.
167
167
168
-
After you select a camera, use it to construct a `LocalVideoStream` instance. Pass it within `videoOptions` as an item within the `localVideoStream` array to the `startCall` method.
168
+
After you select a camera, use it to construct a `LocalVideoStream` instance.
169
+
Pass it within `videoOptions` as an item within the `localVideoStream` array to the `CallAgent``startCall` method.
## Start and stop sending local video while on a call
183
184
184
-
To start a video while on a call, you have to enumerate cameras using the `getCameras` method on the `deviceManager` object. Then create a new instance of `LocalVideoStream` with the desired camera and then pass the `LocalVideoStream` object into the `startVideo` method of an existing call object:
185
+
186
+
### Start video
187
+
To start a video while on a call, you have to enumerate cameras using the `getCameras` method on the `deviceManager` object.
188
+
Then create a new instance of `LocalVideoStream` with the desired camera and then pass the `LocalVideoStream`
189
+
object into the `startVideo` method of an existing call object:
@@ -191,19 +196,25 @@ const localVideoStream = new LocalVideoStream(camera);
191
196
awaitcall.startVideo(localVideoStream);
192
197
```
193
198
194
-
After you successfully start sending video, a `LocalVideoStream` instance of type `Video` is added to the `localVideoStreams` collection on a call instance.
195
199
200
+
### Stop Video
201
+
202
+
After you successfully start sending video, a `LocalVideoStream` instance of type `Video` is added to the `localVideoStreams`
If the specified video device is being used by another process, or if it is not enabled in the system:
215
-
- While in a call, if your video is off and you start video using `call.startVideo()`, this method throws a `SourceUnavailableError` and `cameraStartFiled` user facing diagnostic is set to true.
226
+
- While in a call, if your video is off and you start video using `call.startVideo()`, this method throws a `SourceUnavailableError` and `cameraStartFailed` user facing diagnostic is set to true.
216
227
- A call to the `localVideoStream.switchSource()` method causes `cameraStartFailed` to be set to true.
217
228
Our Call Diagnostics guide provides additional information on how to diagnose call related issues.
218
229
219
-
To verify if the local video is on or off you can use isLocalVideoStarted API, which returns true or false:
230
+
To verify if the local video is on or off you can use the `Call` method `isLocalVideoStarted`, which returns true or false:
To start screen sharing while on a call, you can use asynchronous API startScreenSharing:
249
+
To start screen sharing while on a call, you can use the asynchronous method `startScreenSharing()` on a `Call` object:
250
+
251
+
### Start screen sharing
241
252
```js
242
253
// Start screen sharing
243
254
awaitcall.startScreenSharing();
244
255
```
245
256
257
+
### Find the screen sharing in the collection of LocalVideoStream
246
258
After you successfully start sending screen sharing, a `LocalVideoStream` instance of type `ScreenSharing`, is added to the `localVideoStreams` collection on the call instance.
Local screen share preview is in public preview and available as part of version 1.15.1-beta.1+.
291
+
277
292
### Local screen share preview
278
-
You can use `VideoStreamRenderer` to begin rendering streams from your local screen share so you can see what you are sending as a screen sharing stream.
293
+
294
+
You can use a `VideoStreamRenderer` to begin rendering streams from your local screen share so you can see
To render `RemoteVideoStream`, you have to subscribe to its `isAvailableChanged` event. If the `isAvailable` property changes to `true`, a remote participant is sending a stream. After that happens, create a new instance of `VideoStreamRenderer`, and then create a new `VideoStreamRendererView` instance by using the asynchronous `createView` method. You can then attach `view.target` to any UI element.
334
+
To render `RemoteVideoStream`, you have to subscribe to its `isAvailableChanged` event. If the `isAvailable` property changes to `true`,
335
+
a remote participant is sending a video stream.
336
+
After that happens, create a new instance of `VideoStreamRenderer`, and then create a new `VideoStreamRendererView`
337
+
instance by using the asynchronous `createView` method.
338
+
You can then attach `view.target` to any UI element.
314
339
315
-
Whenever availability of a remote stream changes, you can destroy the whole `VideoStreamRenderer` or a specific `VideoStreamRendererView`. If you do decided to keep them, then the view displays a blank video frame.
340
+
Whenever the availability of a remote stream changes, you can destroy the whole `VideoStreamRenderer` or
341
+
a specific `VideoStreamRendererView`. If you do decided to keep them, then the view displays a blank video frame.
316
342
317
343
```js
318
344
// Reference to the html's div where we would display a grid of all remote video stream from all participants.
319
345
let remoteVideosGallery =document.getElementById('remoteVideosGallery');
@@ -415,10 +441,17 @@ CSS for styling the loading spinner over the remote video stream.
415
441
416
442
### Remote video quality
417
443
418
-
The Azure Communication Services WebJS SDK, starting in version [1.15.1](https://github.com/Azure/Communication/blob/master/releasenotes/acs-javascript-calling-library-release-notes.md#1153-stable-2023-08-18), provides a feature called Optimal Video Count (OVC). This feature can be used to inform applications at run-time how many incoming videos from different participants can be optimally rendered at a given moment in a group call (2+ participants). This feature exposes a property `optimalVideoCount` that is dynamically changing during the call based on the network and hardware capabilities of a local endpoint. The value of `optimalVideoCount` details how many videos from different participants application should render at a given moment. Applications should handle these changes and update number of rendered videoes accordingly to the recommendation. There's a cooldown period (around 10 s), between updates that to avoid too frequent of changes.
444
+
The Azure Communication Services WebJS SDK, provides a feature called Optimal Video Count (OVC), starting in version [1.15.1](https://github.com/Azure/Communication/blob/master/releasenotes/acs-javascript-calling-library-release-notes.md#1153-stable-2023-08-18).
445
+
This feature can be used to inform applications at run-time about how many incoming videos from different participants can be optimally rendered at a given moment in a group call (2+ participants).
446
+
This feature exposes a property `optimalVideoCount` that is dynamically changing during the call based on the network and
447
+
hardware capabilities of a local endpoint. The value of `optimalVideoCount` details how many videos from different participant
448
+
application should render at a given moment. Applications should handle these changes and update number of rendered videos
449
+
accordingly to the recommendation. There's a debounce period (around 10 s) between each update.
Example usage: Application should subscribe to changes of OVC and handle it in group calls by either creating new renderer (`createView` method) or dispose views (`dispose`)
436
-
and update layout accordingly either by removing participants from the main call screen area (often called stage or roster ) or replacing their video elements with an avatar and a name of the user.
437
-
468
+
Example usage: Application should subscribe to changes of Optimal Video Count in group calls. A change in the optimal video count can be handled
469
+
by either creating new renderer (`createView` method) or dispose views (`dispose`) and update the application layout accordingly.
- Informs the application if remote video stream data is being received or not. Such scenarios are:
463
-
- I'm viewing the video of a remote participant who is on mobile browser. The remote participant brings the mobile browser app to the background. I now see the RemoteVideoStream.isReceiving flag goes to false and I see their video with black frames / frozen. When the remote participant brings the mobile browser back to the foreground, I now see the RemoteVideoStream.isReceiving flag to back to true, and I see their video playing normally.
464
-
- I'm viewing the video of a remote participant who is on whatever platforms. There are network issues from either side, their video start to have bad quality, probably because of network issues, so I see the RemoteVideoStream.isReceiving flag goes to false.
465
-
- I'm viewing the video of a Remote participant who is On macOS/iOS Safari, and from their address bar, they click on "Pause" / "Resume" camera. I see a black/frozen video since they paused their camera and I see the RemoteVideoStream.isReceiving flag goes to false. Once they resume playing the camera, then I see the RemoteVideoStream.isReceiving flag goes to true.
466
-
- I'm viewing the video of a remote participant who is on any platform and their network disconnects. The remote participant will stay in the call for about two minutes and I see their video frozen/black frame. The RemoteVideoStream.isReceiving flag goes to false. The remote participant can get network back and reconnect and their audio/video should start flowing normally and I see the RemoteVideoStream.isReceiving flag to true.
467
-
- I'm viewing the video of a remote participant who is on mobile browser. The remote participant terminates/kills the mobile browser. Since that remote participant was on mobile, this will actually leave the participant in the call for about two minutes. I will still see them on the call and their video will be frozen. The RemoteVideoStream.isReceiving flag goes to false. At some point, service will kick participant out of the call and I would just see that the participant disconnected from the call.
468
-
- I'm viewing the video of a remote participant who is on mobile browser and they lock the device. I see the RemoteVideoStream.isReceiving flag goes to false. Once the remote participant unlocks the device and navigates to the Azure Communication Services call, then I'll see the flag go back to true. Same behavior when remote participant is on desktop and the desktop locks/sleeps
494
+
- Informs the application if remote video stream data is being received or not. All scenarios listed assumes the remote partipant is
495
+
sharing its video
496
+
497
+
- The flag moves to `false` in the following scenarios:
498
+
- A remote participant who is on mobile browser brings the browser app to the background.
499
+
- A remote participant or the user receiving the video has network issue that affects video quality drastically.
500
+
- A remote participant who is On macOS/iOS Safari clicks on "Pause" from their address bar.
501
+
- A remote participant has a network disconnection.
502
+
- A remote particpant on mobile kills or terminate the browser.
503
+
- A remote particpant on mobile or desktop locks his device. This scenario applies also if the remote particpant is on a desktop computer and it goes to sleep.
504
+
505
+
- The flag moves to `true` in the following scenarios:
506
+
- A remote participant whos is on mobile browser and has his browser backgrounded brings it back to foreground.
507
+
- A remote participant who is On macOS/iOS Safari clicks on "Resume" from their address bar after having paused its video.
508
+
- A remote participant has a reconnects to the network after a temporary disconnection.
509
+
- A remote participant on mobile unlock his device and return to the call on his mobile browser.
510
+
469
511
- This feature improves the user experience for rendering remote video streams.
470
512
- You can display a loading spinner over the remote video stream when isReceiving flag changes to false. You don't have to do a loading spinner, you can do anything you desire, but a loading spinner is the most common usage for better user experience.
0 commit comments