Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit d57b388

Browse files
xiewenlong1202jianjunz
authored andcommitted
use 'number' instead of 'exact' value only when share screen
1 parent 4a8464f commit d57b388

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/sdk/base/mediastream-factory.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,21 @@ export class MediaStreamFactory {
202202
if (constraints.video.resolution &&
203203
constraints.video.resolution.width &&
204204
constraints.video.resolution.height) {
205-
mediaConstraints.video.width =
206-
constraints.video.resolution.width;
207-
mediaConstraints.video.height =
208-
constraints.video.resolution.height;
205+
if (constraints.video.source ===
206+
MediaFormatModule.VideoSourceInfo.SCREENCAST) {
207+
mediaConstraints.video.width =
208+
constraints.video.resolution.width;
209+
mediaConstraints.video.height =
210+
constraints.video.resolution.height;
211+
} else {
212+
mediaConstraints.video.width = Object.create({});
213+
mediaConstraints.video.width.exact =
214+
constraints.video.resolution.width;
215+
mediaConstraints.video.height = Object.create({});
216+
mediaConstraints.video.height.exact =
217+
constraints.video.resolution.height;
218+
219+
}
209220
}
210221
if (typeof constraints.video.deviceId === 'string') {
211222
mediaConstraints.video.deviceId = { exact: constraints.video.deviceId };

0 commit comments

Comments
 (0)