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
Video Constraints API enables developers to set video constraints.
21
-
There are some scenarios we don't have to send higher resolution video.
22
-
For example, you may only want to provide low resolution video stream in a screen-sharing application.
23
-
Also, when video quality isn't a top priority, you may want to limit the video bandwidth usage in the application.
20
+
The Video Constraints API is a powerful tool that enables developers to control the video quality from within their video calls. With this API, developers can set constraints on the video resolution to ensure that the video call is optimized for the user's device and network conditions. The ACS video engine is optimized to allow the video quality to change dynamically based on devices ability and network quality. But there might be certain scenarios where you would want to have tighter control of the video quality that end users will experience. For example, there might be cases when pushing the highest video quality isn't a top priority or you may want to limit the video bandwidth usage in the application. To support this, you can use the Video Constraints API to have tighter control video quality.
24
21
25
-
Currently we only support the max video resolution constraint on the sender side in the beginning of a call.
26
-
Other constraints, such as max fps or max bandwidth isn't supported at this moment.
27
-
We don't support changing constraints dynamically in a call as well.
28
-
However, we'll be enabling these capabilities in the future.
22
+
Another benefit of the Video Constraints API is that it enables developers to optimize the video call for different devices. For example, if a user is using an older device with limited processing power, developers can set constraints on the video resolution to ensure that the video call runs smoothly on that device
23
+
24
+
Currently ACS supports setting the maximum video resolution that a client will send. The maximum resolution is set at the start of the call and is static throughout the entirity of the call. The sender max video resolution constraint is supported on Desktop browsers (Chrome, Edge) and when using iOS Safari mobile browser.
29
25
30
26
> [!NOTE]
31
-
> Video Constraints is currently supported only for our JavaScript / Web SDK, and is available starting on the version [1.11.0-beta.1](https://www.npmjs.com/package/@azure/communication-calling/v/1.11.0-beta.1) of the Calling SDK.
27
+
> Video Constraints is currently supported only for our JavaScript / Web SDK, and is available starting in version [1.11.0-beta.1](https://www.npmjs.com/package/@azure/communication-calling/v/1.11.0-beta.1) of the Calling SDK.
32
28
33
-
## Using Video Constraints
29
+
> [!NOTE]
30
+
> Future versions of the Video Contraint API will allow enhanced ability by giving control to set the maximum FPS and bitrate, as well as the ability to enforce the video constraint at different points of a call (and not just at the start of a video call).
34
31
35
-
The video constraints setting is implemented on `Call` interface.
36
-
To use the Video Constraints, we can specify the constraints in CallOptions when we make a call, accept a call, or join a call.
37
-
To make the constraints work, you also have to specify `localVideoStreams` in `videoOptions`. The constraint doesn't work if you join a call with audio only option and turn on the camera later.
32
+
## Using Video Constraints
33
+
The video constraints setting is implemented on the `Call` interface. To use the Video Constraints, you can specify the constraints from within CallOptions when you make a call, accept a call, or join a call. You will also have to specify `localVideoStreams` in `videoOptions`. Do note that constraints doesn't work if you join a call with audio only option and turn on the camera later.
38
34
39
35
```javascript
40
36
constcallOptions= {
@@ -80,8 +76,7 @@ export declare type MediaConstraintRange = {
80
76
81
77
### Sender Max Video Resolution Constraint
82
78
83
-
With sender max video resolution constraint, you can limit the max video resolution of the sending stream.
84
-
The value you have to provide for this constraint is `height`.
79
+
With sender max video resolution constraint, you can limit the max video resolution of the sending stream. The value you have to provide for this constraint is `height`.
85
80
86
81
```javascript
87
82
{
@@ -95,15 +90,13 @@ The value you have to provide for this constraint is `height`.
95
90
}
96
91
}
97
92
```
98
-
In SDK, we choose the nearest resolution that falls within the constraint, so sent height doesn't exceed the constraint value.
99
-
There's an exception - when provided constraint value is too small, SDK chooses the smallest available resolution. In this case, the height of chosen resolution can be larger than the constraint value.
93
+
When setting the maximum resolution video constraints, the SDK will choose the nearest resolution that falls within the constraint set (to prevent the resolution height doesn't exceed the maximum constraint value allowed). Also, when the resolution constraint value is too small, the SDK will choose the smallest available resolution. In this case, the height of chosen resolution can be larger than the constraint value.
100
94
101
95
> [!NOTE]
102
96
> The resolution constraint is a `max` constraint, which means the possible resolutions can be the specified resolution or smaller.
103
97
> There is no gurantee that the sent video resolution will remain at the specified resolution.
104
-
> This sender max video resolution constraint is supported on Desktop browsers and iOS Safari.
105
98
106
-
The `height` in `VideoSendConstraints` has a different meaning when the mobile device is in portrait mode. In portrait mode, this value indicates the shorter side of the device. For example, specifying `constraints.send.height.max` value with 240 on a 1080(W) x 1920(H) device in portrait mode, the constraint height is on 1080(W) side. When the same device is in landscape mode (1920(W) x 1080(H)), the constraint is on 1080(H) side.
99
+
The `height` in `VideoSendConstraints` has a different meaning when a mobile device is in portrait mode. In portrait mode, this value indicates the shorter side of the device. For example, specifying `constraints.send.height.max` value with 240 on a 1080(W) x 1920(H) device in portrait mode, the constraint height is on the 1080(W) side. When the same device is in landscape mode (1920(W) x 1080(H)), the constraint is on the 1080(H) side.
107
100
108
101
If you use MediaStats API to track the sent video resolution, you may find out that the sent resolution can change during the call. It can go up and down, but should be equal or smaller than the constraint value you provide. This resolution change is an expected behavior. The browser also has some degradation rule to adjust sent resolution based on cpu or network conditions.
0 commit comments