bugfix
This commit is contained in:
parent
797686e3d3
commit
1fd7b38e44
@ -200,9 +200,11 @@ bricks.RTCClient = class extends bricks.VBox {
|
|||||||
switch (d.type){
|
switch (d.type){
|
||||||
case 'onlineList':
|
case 'onlineList':
|
||||||
this.onlineList = d.onlineList;
|
this.onlineList = d.onlineList;
|
||||||
|
console.log('onlineList branch exe');
|
||||||
break;
|
break;
|
||||||
case 'callRequest':
|
case 'callRequest':
|
||||||
this.need_conform_call(d.from);
|
this.need_conform_call(d.from);
|
||||||
|
console.log('callRequest branch exe');
|
||||||
break;
|
break;
|
||||||
case 'offer':
|
case 'offer':
|
||||||
var offer = new RTCSessionDescription(d.offer);
|
var offer = new RTCSessionDescription(d.offer);
|
||||||
@ -213,26 +215,36 @@ bricks.RTCClient = class extends bricks.VBox {
|
|||||||
answer:answer,
|
answer:answer,
|
||||||
to:this.peer_info
|
to:this.peer_info
|
||||||
}));
|
}));
|
||||||
|
console.log('offer branch exe');
|
||||||
|
break;
|
||||||
case 'answer':
|
case 'answer':
|
||||||
if (d.from == self.peer_info){
|
if (d.from == self.peer_info){
|
||||||
var desc = new RTCSessionDescription(d.answer);
|
var desc = new RTCSessionDescription(d.answer);
|
||||||
this.peerConnection.setRemoteDescription(desc);
|
this.peerConnection.setRemoteDescription(desc);
|
||||||
}
|
}
|
||||||
|
console.log('answer branch exe');
|
||||||
break;
|
break;
|
||||||
case 'iceCandidate':
|
case 'iceCandidate':
|
||||||
if (d.from == self.peer_info){
|
if (d.from == self.peer_info){
|
||||||
var candidate = new RTCIceCandidate(d.candidate);
|
var candidate = new RTCIceCandidate(d.candidate);
|
||||||
this.peerConnection.addIceCandidate(candidate);
|
this.peerConnection.addIceCandidate(candidate);
|
||||||
}
|
}
|
||||||
|
console.log('iceCandidate branch exe');
|
||||||
break;
|
break;
|
||||||
case 'callAccepted':
|
case 'callAccepted':
|
||||||
await this.createPeerConnection(this.peer_info);
|
await this.createPeerConnection(this.peer_info);
|
||||||
|
console.log('callAccepted branch exe');
|
||||||
break;
|
break;
|
||||||
case 'callRejected':
|
case 'callRejected':
|
||||||
this.peer_info = null;
|
this.peer_info = null;
|
||||||
|
console.log('callRejected branch exe');
|
||||||
break;
|
break;
|
||||||
case 'disconnect':
|
case 'disconnect':
|
||||||
this.call_close(true);
|
this.call_close(true);
|
||||||
|
console.log('disconnect branch exe');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(d.type, 'no branch defined');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user