Skip to content

Commit 45d53a5

Browse files
authored
Merge pull request #191616 from cwhil2492/patch-38
Update manage-video-web.md
2 parents a38cf5a + de879e1 commit 45d53a5

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

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

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ You can use `deviceManager` and `VideoStreamRenderer` to begin rendering streams
5858
```js
5959
const cameras = await deviceManager.getCameras();
6060
const camera = cameras[0];
61-
const localCameraStream = new LocalVideoStream(camera);
62-
const videoStreamRenderer = new VideoStreamRenderer(localCameraStream);
61+
const localVideoStream = new LocalVideoStream(camera);
62+
const videoStreamRenderer = new VideoStreamRenderer(localVideoStream);
6363
const view = await videoStreamRenderer.createView();
6464
htmlElement.appendChild(view.target);
6565
```
@@ -84,9 +84,30 @@ console.log(result.video);
8484
- When the DeviceManager is created, at first it does not know about any devices if permissions have not been granted yet and so initially it's device lists are empty. If we then call the DeviceManager.askPermission() API, the user is prompted for device access and if the user clicks on 'allow' to grant the access, then the device manager will learn about the devices on the system, update it's device lists and emit the 'audioDevicesUpdated' and 'videoDevicesUpdated' events. Lets say we then refresh the page and create device manager, the device manager will be able to learn about devices because user has already previously granted access, and so it will initially it will have it's device lists filled and it will not emit 'audioDevicesUpdated' nor 'videoDevicesUpdated' events.
8585
- Speaker enumeration/selection is not supported on Android Chrome, iOS Safari, nor macOS Safari.
8686

87-
## Start and stop sending local video
87+
## Place a call with video camera
88+
89+
> [!IMPORTANT]
90+
> Currently only one outgoing local video stream is supported.
91+
92+
To place a video call, you have to enumerate local cameras by using the `getCameras()` method in `deviceManager`.
93+
94+
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.
95+
96+
```js
97+
const deviceManager = await callClient.getDeviceManager();
98+
const cameras = await deviceManager.getCameras();
99+
const camera = cameras[0]
100+
const localVideoStream = new LocalVideoStream(camera);
101+
const placeCallOptions = {videoOptions: {localVideoStreams:[localVideoStream]}};
102+
const userCallee = { communicationUserId: '<ACS_USER_ID>' }
103+
const call = callAgent.startCall([userCallee], placeCallOptions);
104+
```
105+
- You can also join a call with video with `CallAgent.join()` API, and accept and call with video with `Call.Accept()` API.
106+
- When your call connects, it automatically starts sending a video stream from the selected camera to the other participant.
107+
108+
## Start and stop sending local video while on a call
88109

89-
To start a video, 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:
110+
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:
90111

91112
```js
92113
const deviceManager = await callClient.getDeviceManager();
@@ -102,16 +123,14 @@ After you successfully start sending video, a `LocalVideoStream` instance is add
102123
call.localVideoStreams[0] === localVideoStream;
103124
```
104125

105-
To stop local video, pass the `localVideoStream` instance that's available in the `localVideoStreams` collection:
126+
To stop local video while on a call, pass the `localVideoStream` instance that's available in the `localVideoStreams` collection:
106127

107128
```js
108129
await call.stopVideo(localVideoStream);
109130
// or
110131
await call.stopVideo(call.localVideoStreams[0]);
111132
```
112133

113-
There are 4 methods in which you can pass a `localVideoStream` instance to start video in a call, `callAgent.startCall()`, `callAgent.join()`, `call.accept()`, and `call.startVideo()`. To use `call.stopVideo()`, you must pass that same `localVideoStream` instance that you passed to the original method used to start video.
114-
115134
You can switch to a different camera device while a video is sending by invoking `switchSource` on a `localVideoStream` instance:
116135

117136
```js
@@ -125,27 +144,6 @@ If the specified video device is being used by another process, or if it is disa
125144
- A call to the `localVideoStream.switchSource()` method will cause `cameraStartFailed` to be set to true.
126145
Our Call Diagnostics guide provides additional information on how to diagnose call related issues.
127146

128-
## Place a 1:1 call with video camera
129-
130-
> [!IMPORTANT]
131-
> Currently only one outgoing local video stream is supported.
132-
133-
To place a video call, you have to enumerate local cameras by using the `getCameras()` method in `deviceManager`.
134-
135-
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.
136-
137-
```js
138-
const deviceManager = await callClient.getDeviceManager();
139-
const cameras = await deviceManager.getCameras();
140-
const camera = cameras[0]
141-
localVideoStream = new LocalVideoStream(camera);
142-
const placeCallOptions = {videoOptions: {localVideoStreams:[localVideoStream]}};
143-
const userCallee = { communicationUserId: '<ACS_USER_ID>' }
144-
const call = callAgent.startCall([userCallee], placeCallOptions);
145-
```
146-
147-
- When your call connects, it automatically starts sending a video stream from the selected camera to the other participant. This also applies to the `Call.Accept()` video options and `CallAgent.join()` video options.
148-
149147
## Render remote participant video streams
150148

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

0 commit comments

Comments
 (0)