Constrain screensharing in getDisplayMedia
parent
023aac3c21
commit
fd58940916
|
|
@ -2484,9 +2484,9 @@ export default class RoomClient
|
|||
logger.debug('enableScreenSharing() | calling getUserMedia()');
|
||||
|
||||
const stream = await this._screenSharing.start({
|
||||
width : 1280,
|
||||
height : 720,
|
||||
frameRate : 3
|
||||
width : 1920,
|
||||
height : 1080,
|
||||
frameRate : 5
|
||||
});
|
||||
|
||||
track = stream.getVideoTracks()[0];
|
||||
|
|
|
|||
|
|
@ -101,12 +101,25 @@ class DisplayMediaScreenShare
|
|||
return true;
|
||||
}
|
||||
|
||||
_toConstraints()
|
||||
_toConstraints(options)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue