diff --git a/src/content/peerconnection/webaudio-input/js/webaudioextended.js b/src/content/peerconnection/webaudio-input/js/webaudioextended.js index c201f5301..8459beacb 100644 --- a/src/content/peerconnection/webaudio-input/js/webaudioextended.js +++ b/src/content/peerconnection/webaudio-input/js/webaudioextended.js @@ -13,7 +13,17 @@ function WebAudioExtended() { window.AudioContext = window.AudioContext || window.webkitAudioContext; /* global AudioContext */ - this.context = new AudioContext(); + const self = this; + // tricky solution for suspended state + // for more information => https://developer.chrome.com/blog/autoplay/#web-audio + navigator.mediaDevices.getUserMedia({ + audio: true, + video: false, + }).then(() => { + self.context = new AudioContext(); + }).catch((err) => { + alert(`ERROR : ${err.message}`); + }); this.soundBuffer = null; }