Skip to content

Harden desktop capture constraints to prevent malformed getUserMedia errors#11

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-recording-getusermedia-error
Draft

Harden desktop capture constraints to prevent malformed getUserMedia errors#11
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-recording-getusermedia-error

Conversation

Copilot AI commented May 13, 2026

Copy link
Copy Markdown
Contributor

The recorder fails to start when getUserMedia receives mixed constraint styles (legacy mandatory + standard constraints), triggering a malformed constraint error. This ensures desktop capture constraints are expressed in a single, compatible form.

  • Desktop capture constraints
    • Use mandatory-only Chrome desktop constraints for preview and recording
    • Align max frame rate with the shared constant to avoid divergence
video: {
  mandatory: {
    chromeMediaSource: 'desktop',
    chromeMediaSourceId: selectedSource.id,
    maxWidth: clampedWidth,
    maxHeight: clampedHeight,
    maxFrameRate: TARGET_FRAME_RATE
  }
}

Copilot AI and others added 3 commits May 13, 2026 05:30
Agent-Logs-Url: https://github.com/iamtatenda/Focra/sessions/0d29a27e-0f39-4f35-b0fb-7d0009bfba3d

Co-authored-by: iamtatenda <120183671+iamtatenda@users.noreply.github.com>
Agent-Logs-Url: https://github.com/iamtatenda/Focra/sessions/0d29a27e-0f39-4f35-b0fb-7d0009bfba3d

Co-authored-by: iamtatenda <120183671+iamtatenda@users.noreply.github.com>
Agent-Logs-Url: https://github.com/iamtatenda/Focra/sessions/0d29a27e-0f39-4f35-b0fb-7d0009bfba3d

Co-authored-by: iamtatenda <120183671+iamtatenda@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses recorder start failures caused by passing mixed getUserMedia constraint styles (legacy mandatory + standard constraints). It hardens desktop-capture constraints by expressing them in a single, Chromium-compatible “mandatory-only” form for both preview and recording flows.

Changes:

  • Updated preview getUserMedia video constraints to use mandatory.maxWidth/maxHeight/maxFrameRate only.
  • Updated recording videoConstraints to the same mandatory-only shape to avoid malformed constraint errors.
  • Standardized max frame rate to the shared TARGET_FRAME_RATE constant to prevent divergence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants