提交 a0f2c5c2 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

PeerConnection: avoid double renegotiation after joining a room.

上级 54b2dbfd
......@@ -37,6 +37,9 @@ class RTCPeerConnectionCommon extends EventEmitter
// Busy flag.
this._busy = false;
// Whether the initial offer has been created.
this._initialOfferCreated = false;
// Whether first SDP O/A has been done.
this._initialNegotiationDone = false;
......@@ -71,8 +74,9 @@ class RTCPeerConnectionCommon extends EventEmitter
{
this._logger.debug('peer "newrtpsender" event');
// Set flag.
this._negotiationNeeded = true;
// Set negotiation flag (unless the initial offer was not yet created).
if (this._initialOfferCreated)
this._negotiationNeeded = true;
// Try to renegotiate if the initial SDP O/A was already done.
if (this._initialNegotiationDone)
......@@ -213,6 +217,9 @@ class RTCPeerConnectionCommon extends EventEmitter
// Create an offer.
let localDescription = this._createLocalDescription('offer');
// Update flag.
this._initialOfferCreated = true;
// Resolve with it.
return Promise.resolve(localDescription);
})
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论