@@ -204,6 +204,10 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
204
204
mediaOptions . video = false ;
205
205
}
206
206
207
+ const internalId = this . _createInternalId ( ) ;
208
+ // Waiting for previous SDP negotiation if needed
209
+ await this . _chainSdpPromise ( internalId ) ;
210
+
207
211
const offerOptions = { } ;
208
212
const transceivers = [ ] ;
209
213
if ( typeof this . _pc . addTransceiver === 'function' ) {
@@ -278,11 +282,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
278
282
offerOptions . offerToReceiveAudio = false ;
279
283
offerOptions . offerToReceiveVideo = false ;
280
284
}
281
-
282
- const internalId = this . _createInternalId ( ) ;
283
285
this . _publishTransceivers . set ( internalId , { transceivers} ) ;
284
- // Waiting for previous SDP negotiation if needed
285
- await this . _chainSdpPromise ( internalId ) ;
286
286
287
287
let localDesc ;
288
288
this . _pc . createOffer ( offerOptions ) . then ( ( desc ) => {
@@ -441,6 +441,10 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
441
441
mediaOptions . video = false ;
442
442
}
443
443
444
+ const internalId = this . _createInternalId ( ) ;
445
+ // Waiting for previous SDP negotiation if needed
446
+ await this . _chainSdpPromise ( internalId ) ;
447
+
444
448
const offerOptions = { } ;
445
449
const transceivers = [ ] ;
446
450
this . _createPeerConnection ( ) ;
@@ -471,14 +475,9 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
471
475
offerOptions . offerToReceiveAudio = ! ! options . audio ;
472
476
offerOptions . offerToReceiveVideo = ! ! options . video ;
473
477
}
474
-
475
- const internalId = this . _createInternalId ( ) ;
476
478
this . _subscribeTransceivers . set ( internalId , { transceivers} ) ;
477
479
this . _subscribedStreams . set ( internalId , stream ) ;
478
480
479
- // Waiting for previous SDP negotiation if needed
480
- await this . _chainSdpPromise ( internalId ) ;
481
-
482
481
let localDesc ;
483
482
this . _pc . createOffer ( offerOptions ) . then ( ( desc ) => {
484
483
localDesc = desc ;
0 commit comments