question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Demo: constraints ERROR

See original GitHub issue

Since last chrome update demo page is not working. On select Audio input there is message:

Could not get audio media device: TypeError: Failed to execute ‘getUserMedia’ on ‘MediaDevices’: Malformed constraint: Cannot use both optional/mandatory and specific or advanced constraints.

Some changes make working in chrome:

if (navigator.webkitGetUserMedia !== undefined) {
    constraint = {
        video: false,
        audio: {
            optional: [
                {sourceId:deviceId},
                {googAutoGainControl: false},
                {googAutoGainControl2: false},
                {echoCancellation: false},
                {googEchoCancellation: false},
                {googEchoCancellation2: false},
                {googDAEchoCancellation: false},
                {googNoiseSuppression: false},
                {googNoiseSuppression2: false},
                {googHighpassFilter: false},
                {googTypingNoiseDetection: false},
                {googAudioMirroring: false}
            ]
        }
    }
}
else if (navigator.mozGetUserMedia !== undefined) {
    constraint = {
        video: false,
        audio: {
            deviceId: deviceId ? { exact: deviceId } : void 0,
            echoCancellation: false,
            mozAutoGainControl: false
            //mozNoiseSuppression: false
        }
    }

}
else {
    constraint = {
        video: false,
        audio: {
            deviceId: deviceId ? {exact: deviceId} : void 0,
            echoCancellation: false
        }
    }
}

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

4reactions
theredspooncommented, Apr 4, 2017

Interestingly, one of the older demo pages does not encounter this problem:

https://boo-higuma.ssl-lolipop.jp/gh-pages/web-audio-recorder-js/

0reactions
hmoffattcommented, May 13, 2021

The old link uses the old deprecated getUserMedia API. Don’t use it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Demo: constraints ERROR - - Bountysource
Demo : constraints ERROR ... Since last chrome update demo page is not working. On select Audio input there is message: Could not...
Read more >
ios - Constraints error <Will attempt to recover by breaking constraint ...
I am added the autolayout constraints to this cell...but it gives me lots of breaking constraints error....Then I decided to go step by...
Read more >
How fix "Field(s) `date_stop` failed against a constraint - Odoo
Problem is when I try to install account module with demo data (I created database with ... Field(s) `date_stop` failed against a constraint:...
Read more >
SSIS 2016 Session Precedence Constraints, Error Trapping - Hands ...
Reviews Precedence Constraints and briefly Trapping Errors. ... SSIS 2016 Session Precedence Constraints, Error Trapping - Hands On Easy Demo!
Read more >
Capabilities, constraints, and settings - Web APIs | MDN
If an error occurs applying either set of constraints, handleError() is used to output a message into the log. document.getElementById(" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found