Constrain screensharing in getDisplayMedia
parent
023aac3c21
commit
fd58940916
|
|
@ -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];
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue