From 386660806674ee71148c120c76fe548a32333eed Mon Sep 17 00:00:00 2001 From: talkr-app Date: Tue, 19 Feb 2019 12:18:29 -0500 Subject: [PATCH] Fix chrome autoplay issue --- webapp/live.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webapp/live.html b/webapp/live.html index c7b5bc2..87da6d0 100644 --- a/webapp/live.html +++ b/webapp/live.html @@ -86,8 +86,11 @@

Status

// This starts recording. We first need to get the id of the grammar to use var startRecording = function() { - var id = document.getElementById('grammars').value; - if (recorder && recorder.start(id)) displayRecording(true); + // Resume audio context. Chrome can prevent it from starting without a click. + audioContext.resume().then(() => { + var id = document.getElementById('grammars').value; + if (recorder && recorder.start(id)) displayRecording(true); + }); }; // Stops recording