Merge pull request #20006 from prlanzarin/u27/fix/audio-answerer-gum-failure

[2.7] fix(audio): acquire streams before negotiation when peer is answerer
This commit is contained in:
Anton Georgiev 2024-04-12 15:14:17 -04:00 committed by GitHub
commit e511535adc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,11 +97,20 @@ class AudioBroker extends BaseBroker {
this.webRtcPeer.peerConnection.onconnectionstatechange = this.handleConnectionStateChange.bind(this); this.webRtcPeer.peerConnection.onconnectionstatechange = this.handleConnectionStateChange.bind(this);
if (this.offering) { if (this.offering) {
// We are the offerer
this.webRtcPeer.generateOffer() this.webRtcPeer.generateOffer()
.then(this.sendStartReq.bind(this)) .then(this.sendStartReq.bind(this))
.catch(this._handleOfferGenerationFailure.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(); 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(); resolve();