diff --git a/bigbluebutton-html5/imports/ui/services/bbb-webrtc-sfu/audio-broker.js b/bigbluebutton-html5/imports/ui/services/bbb-webrtc-sfu/audio-broker.js index 3d59f35c42..fcfb576e95 100644 --- a/bigbluebutton-html5/imports/ui/services/bbb-webrtc-sfu/audio-broker.js +++ b/bigbluebutton-html5/imports/ui/services/bbb-webrtc-sfu/audio-broker.js @@ -97,11 +97,20 @@ class AudioBroker extends BaseBroker { this.webRtcPeer.peerConnection.onconnectionstatechange = this.handleConnectionStateChange.bind(this); if (this.offering) { + // We are the offerer this.webRtcPeer.generateOffer() .then(this.sendStartReq.bind(this)) .catch(this._handleOfferGenerationFailure.bind(this)); - } else { + } else if (peerRole === 'recvonly') { + // We are the answerer and we are only listening, so we don't need + // to acquire local media this.sendStartReq(); + } else { + // We are the answerer and we are sending audio, so we need to acquire + // local media before sending the start request + this.webRtcPeer.mediaStreamFactory() + .then(() => { this.sendStartReq(); }) + .catch(this._handleOfferGenerationFailure.bind(this)); } resolve();