Simplifies code.
This commit is contained in:
parent
c5ce510da5
commit
ea93bc6f41
|
@ -662,7 +662,12 @@ ColibriFocus.prototype.initiate = function (peer, isInitiator) {
|
|||
var participant = this.peers.indexOf(peer);
|
||||
console.log('tell', peer, participant);
|
||||
var sdp;
|
||||
if (this.peerconnection !== null && this.peerconnection.signalingState == 'stable') {
|
||||
|
||||
if (!(this.peerconnection !== null && this.peerconnection.signalingState == 'stable')) {
|
||||
console.error('can not initiate a new session without a stable peerconnection');
|
||||
return;
|
||||
}
|
||||
|
||||
sdp = new SDP(this.peerconnection.remoteDescription.sdp);
|
||||
var localSDP = new SDP(this.peerconnection.localDescription.sdp);
|
||||
// throw away stuff we don't want
|
||||
|
@ -703,10 +708,6 @@ ColibriFocus.prototype.initiate = function (peer, isInitiator) {
|
|||
}
|
||||
}
|
||||
sdp.raw = sdp.session + sdp.media.join('');
|
||||
} else {
|
||||
console.error('can not initiate a new session without a stable peerconnection');
|
||||
return;
|
||||
}
|
||||
|
||||
// add stuff we got from the bridge
|
||||
for (var j = 0; j < sdp.media.length; j++) {
|
||||
|
|
Loading…
Reference in New Issue