GUACAMOLE-905: Automatically resume AudioContext when recording starts.

The AudioContext is paused by default in Google Chrome as a defense
against autoplay. It can be explicitly resumed with resume() as long as
there has been enough interaction with the page.
This commit is contained in:
Michael Jumper committed 2020-01-12 17:19:18 -08:00
1 parent a0bac666db
commit e27fe504a9
1 file changed
+5
@@ -435,6 +435,11 @@ Guacamole.RawAudioRecorder = function RawAudioRecorder(stream, mimetype) {
source = context.createMediaStreamSource(stream);
source.connect(processor);
// Attempt to explicitly resume AudioContext, as it may be paused
// by default
if (context.state === 'suspended')
context.resume();
// Save stream for later cleanup
mediaStream = stream;