ccp-eva / media-recorder

📹 DOM Independent, WebRTC JavaScript Utility Functions To View, Record, Playback A User’s Webcam
0 stars 0 forks source link

Explore MediaTrackConstraints and provide smart defaults #2

Open kalaschnik opened 3 years ago

kalaschnik commented 3 years ago
// MEDIA CONSTRAINT OBJECT
// NB https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints
const constraintObj = {
  audio: true,
  video: true,
  // video: {
  //   facingMode: "user",
  //   width: { min: 640, ideal: 1280, max: 1920 },
  //   height: { min: 480, ideal: 720, max: 1080 }
  // }

  // Other useful props:
  // width: 1280, height: 720  -- preference only
  // facingMode: {exact: "user"} // forcing to be user camera
  // facingMode: "environment"
};