Constrain screensharing in getDisplayMedia
This commit is contained in:
@@ -2484,9 +2484,9 @@ export default class RoomClient
|
|||||||
logger.debug('enableScreenSharing() | calling getUserMedia()');
|
logger.debug('enableScreenSharing() | calling getUserMedia()');
|
||||||
|
|
||||||
const stream = await this._screenSharing.start({
|
const stream = await this._screenSharing.start({
|
||||||
width : 1280,
|
width : 1920,
|
||||||
height : 720,
|
height : 1080,
|
||||||
frameRate : 3
|
frameRate : 5
|
||||||
});
|
});
|
||||||
|
|
||||||
track = stream.getVideoTracks()[0];
|
track = stream.getVideoTracks()[0];
|
||||||
|
|||||||
+15
-2
@@ -101,12 +101,25 @@ class DisplayMediaScreenShare
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_toConstraints()
|
_toConstraints(options)
|
||||||
{
|
{
|
||||||
const constraints = {
|
const constraints = {
|
||||||
video : true
|
video : {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (isFinite(options.width))
|
||||||
|
{
|
||||||
|
constraints.video.width = options.width;
|
||||||
|
}
|
||||||
|
if (isFinite(options.height))
|
||||||
|
{
|
||||||
|
constraints.video.height = options.height;
|
||||||
|
}
|
||||||
|
if (isFinite(options.frameRate))
|
||||||
|
{
|
||||||
|
constraints.video.frameRate = options.frameRate;
|
||||||
|
}
|
||||||
|
|
||||||
return constraints;
|
return constraints;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user