Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
MediaStreamConstraints for cropped MediaStream in webRTC while screen capturing

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!