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:
1 parent
a0bac666db
commit
e27fe504a9
1 file changed
+5
@@ -435,6 +435,11 @@ Guacamole.RawAudioRecorder = function RawAudioRecorder(stream, mimetype) {
|
|||||||
source = context.createMediaStreamSource(stream);
|
source = context.createMediaStreamSource(stream);
|
||||||
source.connect(processor);
|
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
|
// Save stream for later cleanup
|
||||||
mediaStream = stream;
|
mediaStream = stream;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user