Using webRTC I can capture screen
var myMediaStreamConstraints = {
video: {
width: { min: 640, ideal: 1920 },
height: { min: 400, ideal: 1080 },
aspectRatio: { ideal: 1.7777777778 }
},
audio: {
sampleSize: 16,
channelCount: 2
}
}
var promise = navigator.mediaDevices.getDisplayMedia(myMediaStreamConstraints);
This promise that resolves to a MediaStream containing a video track whose contents come from a user-selected screen area, as well as an optional audio track.
I want to capture only some rectangular part of my screen and I do not want to crop using HTML and CSS thing. I am expecting there would be some way by creating right MediaStreamConstraints.
How can I get cropped MediaStream to capture only rectangular part of screen?