Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discord voice messaging plugin: getUserMedia() is not supported

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

Code with problem:

navigator.mediaDevices.getUserMedia({audio: 'true'}).then(s => {
                plugin.media = new MediaRecorder(s);
                Logger.log("MediaRecorder started successfully");
            })
like image 836
Nuril Avatar asked Mar 19 '21 19:03

Nuril


1 Answers

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=
like image 156
Menelaos Avatar answered Nov 10 '22 06:11

Menelaos