Skip to content

Commit 5c900a9

Browse files
committed
manage video
1 parent cc88ba7 commit 5c900a9

File tree

5 files changed

+178
-140
lines changed

5 files changed

+178
-140
lines changed

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

Lines changed: 64 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
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: 06/10/2025
6+
ms.author: micahvivion
77
---
88
[!INCLUDE [Install SDK](../install-sdk/install-sdk-android.md)]
99

1010
## Device management
11-
To begin using video with Calling, you will need to know how to manage devices. Devices allow you to control what transmits Audio and Video to the call.
1211

13-
`DeviceManager` lets you enumerate local devices that can be used in a call to transmit your audio/video streams. It also allows you to request permission from a user to access their microphone and camera using the native browser API.
12+
To use video with Calling, you need to manage devices. Using devices enables you to control what transmits Audio and Video to the call.
1413

15-
You can access `deviceManager` by calling `callClient.getDeviceManager()` method.
14+
The `DeviceManager` object enables you to enumerate local devices to use in a call to transmit your audio/video streams. It also enables you to request permission from a user to access their microphone and camera using the native browser API.
15+
16+
To access `deviceManager`, call the `callClient.getDeviceManager()` method.
1617

1718
```java
1819
Context appContext = this.getApplicationContext();
@@ -21,7 +22,7 @@ DeviceManager deviceManager = callClient.getDeviceManager(appContext).get();
2122

2223
### Enumerate local devices
2324

24-
To access local devices, you can use enumeration methods on the Device Manager. Enumeration is a synchronous action.
25+
To access local devices, use enumeration methods on the Device Manager. Enumeration is a synchronous action.
2526

2627
```java
2728
// Get a list of available video devices for use.
@@ -30,7 +31,7 @@ List<VideoDeviceInfo> localCameras = deviceManager.getCameras(); // [VideoDevice
3031

3132
### Local camera preview
3233

33-
You can use `DeviceManager` and `Renderer` to begin rendering streams from your local camera. This stream won't be sent to other participants; it's a local preview feed. This is an asynchronous action.
34+
You can use `DeviceManager` and `Renderer` to begin rendering streams from your local camera. This stream isn't sent to other participants. It's a local preview feed. Rendering a stream is an asynchronous action.
3435

3536
```java
3637
VideoDeviceInfo videoDevice = <get-video-device>; // See the `Enumerate local devices` topic above
@@ -53,16 +54,14 @@ layout.addView(uiView);
5354
```
5455

5556
## Place a 1:1 call with video camera
57+
5658
> [!WARNING]
57-
> Currently only one outgoing local video stream is supported
58-
To place a call with video you have to enumerate local cameras using the `deviceManager` `getCameras` API.
59-
Once you select a desired camera, use it to construct a `LocalVideoStream` instance and pass it into `videoOptions`
60-
as an item in the `localVideoStream` array to a `call` method.
61-
Once the call connects it will automatically start sending a video stream from the selected camera to other participant(s).
59+
> Currently only one outgoing local video stream is supported. To place a call with video, you must enumerate local cameras using the `deviceManager` `getCameras` API.
60+
> Once you select a camera, use it to construct a `LocalVideoStream` instance and pass it into `videoOptions` as an item in the `localVideoStream` array to a `call` method. Once the call connects, it automatically starts sending a video stream from the selected camera to other participants.
6261
6362
> [!NOTE]
64-
> Due to privacy concerns, video will not be shared to the call if it is not being previewed locally.
65-
See [Local camera preview](#local-camera-preview) for more details.
63+
> Due to privacy concerns, video isn't shared to the call if it isn't previewed locally.
64+
> For more information, see [Local camera preview](#local-camera-preview).
6665
6766
```java
6867
VideoDeviceInfo desiredCamera = <get-video-device>; // See the `Enumerate local devices` topic above
@@ -92,7 +91,7 @@ Call call = callAgent.startCall(context, participants, startCallOptions);
9291

9392
## Start and stop sending local video
9493

95-
To start a video, you have to enumerate cameras using the `getCameraList` API on `deviceManager` object. Then create a new instance of `LocalVideoStream` passing the desired camera, and pass it in the `startVideo` API as an argument:
94+
To start a video, you must enumerate cameras using the `getCameraList` operation on `deviceManager` object. Then create a new instance of `LocalVideoStream` passing the desired camera, and pass it in the `startVideo` API as an argument:
9695

9796
```java
9897
VideoDeviceInfo desiredCamera = <get-video-device>; // See the `Enumerate local devices` topic above
@@ -106,7 +105,7 @@ Future startVideoFuture = call.startVideo(appContext, currentLocalVideoStream);
106105
startVideoFuture.get();
107106
```
108107

109-
Once you successfully start sending video, a `LocalVideoStream` instance will be added to the `localVideoStreams` collection on the call instance.
108+
Once you successfully start sending video, a `LocalVideoStream` instance is added to the `localVideoStreams` collection on the call instance.
110109

111110
```java
112111
List<LocalVideoStream> videoStreams = call.getLocalVideoStreams();
@@ -142,7 +141,7 @@ To render a `RemoteVideoStream` from a remote participant, you have to subscribe
142141

143142
Within the event, the change of `isAvailable` property to true indicates that remote participant is currently sending a stream. Once that happens, create new instance of a `Renderer`, then create a new `RendererView` using asynchronous `createView` API and attach `view.target` anywhere in the UI of your application.
144143

145-
Whenever availability of a remote stream changes you can choose to destroy the whole Renderer, a specific `RendererView` or keep them, but this will result in displaying blank video frame.
144+
Whenever availability of a remote stream changes you can choose to destroy the whole `Renderer`, a specific `RendererView` or keep them, but results in displaying blank video frame.
146145

147146
```java
148147
VideoStreamRenderer remoteVideoRenderer = new VideoStreamRenderer(remoteParticipantStream, appContext);
@@ -163,59 +162,71 @@ void onRemoteParticipantVideoStreamsUpdated(RemoteParticipant participant, Remot
163162
```
164163

165164
### Remote video stream properties
166-
Remote video stream has couple of properties
167165

168-
* `Id` - ID of a remote video stream
169-
```java
170-
int id = remoteVideoStream.getId();
171-
```
166+
Remote video stream has the following properties:
172167

173-
* `MediaStreamType` - Can be 'Video' or 'ScreenSharing'
174-
```java
175-
MediaStreamType type = remoteVideoStream.getMediaStreamType();
176-
```
168+
- `Id` - ID of a remote video stream.
177169

178-
* `isAvailable` - Indicates if remote participant endpoint is actively sending stream
179-
```java
180-
boolean availability = remoteVideoStream.isAvailable();
181-
```
170+
```java
171+
int id = remoteVideoStream.getId();
172+
```
173+
174+
- `MediaStreamType` - Can be `Video` or `ScreenSharing`.
175+
176+
```java
177+
MediaStreamType type = remoteVideoStream.getMediaStreamType();
178+
```
179+
180+
- `isAvailable` - Indicates if remote participant endpoint is actively sending stream.
181+
182+
```java
183+
boolean availability = remoteVideoStream.isAvailable();
184+
```
182185

183186
### Renderer methods and properties
184-
Renderer object following APIs
185187

186-
* Create a `VideoStreamRendererView` instance that can be later attached in the application UI to render remote video stream.
187-
```java
188-
// Create a view for a video stream
189-
VideoStreamRendererView.createView()
190-
```
191-
* Dispose renderer and all `VideoStreamRendererView` associated with this renderer. To be called when you have removed all associated views from the UI.
192-
```java
193-
VideoStreamRenderer.dispose()
194-
```
188+
The `Renderer` object uses the following methods.
195189

196-
* `StreamSize` - size (width/height) of a remote video stream
197-
```java
198-
StreamSize renderStreamSize = VideoStreamRenderer.getSize();
199-
int width = renderStreamSize.getWidth();
200-
int height = renderStreamSize.getHeight();
201-
```
190+
- To render remote video stream, create a `VideoStreamRendererView` instance that can be later attached in the application UI.
191+
192+
```java
193+
// Create a view for a video stream
194+
VideoStreamRendererView.createView()
195+
```
196+
- Dispose renderer and all `VideoStreamRendererView` associated with this renderer. Call it after you remove all associated views from the UI.
197+
198+
```java
199+
VideoStreamRenderer.dispose()
200+
```
201+
202+
- To set the size (width/height) of a remote video stream, use `StreamSize`.
203+
204+
```java
205+
StreamSize renderStreamSize = VideoStreamRenderer.getSize();
206+
int width = renderStreamSize.getWidth();
207+
int height = renderStreamSize.getHeight();
208+
```
202209

203210
### RendererView methods and properties
204-
When creating a `VideoStreamRendererView` you can specify the `ScalingMode` and `mirrored` properties that will apply to this view:
205-
Scaling mode can be either of 'CROP' | 'FIT'
211+
212+
When creating a `VideoStreamRendererView`, you can specify the `ScalingMode` and `mirrored` properties that apply to this view.
213+
214+
Scaling mode can be either one of `CROP` or `FIT`.
206215

207216
```java
208217
VideoStreamRenderer remoteVideoRenderer = new VideoStreamRenderer(remoteVideoStream, appContext);
209218
VideoStreamRendererView rendererView = remoteVideoRenderer.createView(new CreateViewOptions(ScalingMode.Fit));
210219
```
211220

212221
The created RendererView can then be attached to the application UI using the following snippet:
222+
213223
```java
214224
layout.addView(rendererView);
215225
```
216226

217-
You can later update the scaling mode by invoking `updateScalingMode` API on the RendererView object with one of ScalingMode.CROP | ScalingMode.FIT as an argument.
218-
```java
219-
// Update the scale mode for this view.
220-
rendererView.updateScalingMode(ScalingMode.CROP)
227+
You can later update the scaling mode using the `updateScalingMode` operation on the `RendererView` object with an argument of either `ScalingMode.CROP` or `ScalingMode.FIT`.
228+
229+
```java
230+
// Update the scale mode for this view.
231+
rendererView.updateScalingMode(ScalingMode.CROP)
221232
```

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
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: 06/10/2025
6+
ms.author: micahvivion
77
---
88
[!INCLUDE [Install SDK](../install-sdk/install-sdk-ios.md)]
99

1010
## Manage devices
11-
To begin using video with Calling, you will need to know how to manage devices. Devices allow you to control what transmits Audio and Video to the call.
1211

13-
`DeviceManager` lets you enumerate local devices that can be used in a call to transmit audio or video streams. It also allows you to request permission from a user to access a microphone or camera. You can access `deviceManager` on the `callClient` object.
12+
To begin using video with Calling, you need to know how to manage devices. Devices enable you to control what transmits Audio and Video to the call.
13+
14+
`DeviceManager` lets you enumerate local devices that can be used in a call to transmit audio or video streams. It also enables you to request permission from a user to access a microphone or camera. You can access `deviceManager` on the `callClient` object.
1415

1516
```swift
1617
self.callClient!.getDeviceManager { (deviceManager, error) in
@@ -34,7 +35,7 @@ var localCameras = deviceManager.cameras // [VideoDeviceInfo, VideoDeviceInfo...
3435

3536
### Get a local camera preview
3637

37-
You can use `Renderer` to begin rendering a stream from your local camera. This stream won't be sent to other participants; it's a local preview feed. This is an asynchronous action.
38+
You can use `Renderer` to begin rendering a stream from your local camera. This stream isn't to other participants; it's a local preview feed. This is an asynchronous action.
3839

3940
```swift
4041
let camera: VideoDeviceInfo = self.deviceManager!.cameras.first!
@@ -45,7 +46,7 @@ self.view = try! localRenderer.createView()
4546

4647
### Get local camera preview properties
4748

48-
The renderer has set of properties and methods that allow you to control the rendering.
49+
The renderer includes a set of properties and methods that enable you to control the rendering.
4950

5051
```swift
5152
// Constructor can take in LocalVideoStream or RemoteVideoStream
@@ -69,6 +70,7 @@ localRenderer.dispose()
6970
```
7071

7172
## Place a 1:1 call with video
73+
7274
To get a device manager instance, see the section about [managing devices](#manage-devices).
7375

7476
```swift

0 commit comments

Comments
 (0)