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
2019-12-27 12:53:30 -08:00
parent a0bac666db
commit e27fe504a9

View File

@@ -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;