Error: Failed to start MediaRecorder: Failed to execute ‘getUserMedia’ on “MediaDevices”: getUserMedia is not supported.
Original: https://github.com/MKSx/Send-Audio-Plugin-BetterDiscord Error on line 1026.
UPD: getUserMedia() disabled in discord, alternative:https://github.com/l-Nuril-l/Voice-Messages-Plugin-BetterDiscord
UPD2: The alternative is dead
Code with problem:
navigator.mediaDevices.getUserMedia({audio: 'true'}).then(s => { plugin.media = new MediaRecorder(s); Logger.log("MediaRecorder started successfully"); })
Advertisement
Answer
Intro
Basically, better discord is essentially an application running in something like a chrome browser. You can validate this by hitting CTRL
+SHIFT
+I
.
The problem looks like a security issue in chrome related to accessing the microphone. I will also have a look in the following days, but the following solutions might work for you:
- Answer from getUserMedia() not supported in chrome
- Answer1 and Answer2 from Chrome: navigator.mediaDevices.getUserMedia is not a function AND
Update
I saw that you can potentially add flags to the discord app from the following link: https://www.reddit.com/r/discordapp/comments/91btrn/adding_electron_flags_to_discord_startup/
There a full list of potential command line switches @ https://peter.sh/experiments/chromium-command-line-switches/ .
You probably need to set the correct URL/domain after the parameter, e.g.
Discord.exe --unsafely-treat-insecure-origin-as-secure=