|
@@ -33,7 +33,7 @@ MediaConnection.prototype.addStream = function(remoteStream) {
|
|
|
|
|
|
this.remoteStream = remoteStream;
|
|
this.remoteStream = remoteStream;
|
|
this.emit('stream', remoteStream); // Should we call this `open`?
|
|
this.emit('stream', remoteStream); // Should we call this `open`?
|
|
- this.open = true;
|
|
|
|
|
|
+
|
|
};
|
|
};
|
|
|
|
|
|
MediaConnection.prototype.handleMessage = function(message) {
|
|
MediaConnection.prototype.handleMessage = function(message) {
|
|
@@ -43,6 +43,7 @@ MediaConnection.prototype.handleMessage = function(message) {
|
|
case 'ANSWER':
|
|
case 'ANSWER':
|
|
// Forward to negotiator
|
|
// Forward to negotiator
|
|
Negotiator.handleSDP(message.type, this, payload.sdp);
|
|
Negotiator.handleSDP(message.type, this, payload.sdp);
|
|
|
|
+ this.open = true;
|
|
break;
|
|
break;
|
|
case 'CANDIDATE':
|
|
case 'CANDIDATE':
|
|
Negotiator.handleCandidate(this, payload.candidate);
|
|
Negotiator.handleCandidate(this, payload.candidate);
|
|
@@ -55,7 +56,7 @@ MediaConnection.prototype.handleMessage = function(message) {
|
|
|
|
|
|
MediaConnection.prototype.answer = function(stream) {
|
|
MediaConnection.prototype.answer = function(stream) {
|
|
if (this.localStream) {
|
|
if (this.localStream) {
|
|
- // Throw some error.
|
|
|
|
|
|
+ util.warn('Local stream already exists on this MediaConnection. Are you answering a call twice?');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -66,6 +67,7 @@ MediaConnection.prototype.answer = function(stream) {
|
|
this,
|
|
this,
|
|
this.options._payload
|
|
this.options._payload
|
|
)
|
|
)
|
|
|
|
+ this.open = true;
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
/**
|