diff --git a/bricks/rtc.js b/bricks/rtc.js index 054fc58..8a9cd90 100644 --- a/bricks/rtc.js +++ b/bricks/rtc.js @@ -139,8 +139,9 @@ bricks.RTCClient = class extends bricks.VBox { this.socket.send(JSON.stringify(d)); } async send_offer(){ - var offer = await this.peerConnection.createOffer(); + var offer = this.peerConnection.createOffer(); this.peerConnection.setLocalDescription(offer); + console.log('offer =', offer, this.peerConnection.localDescription); this.socket.send(JSON.stringify({ type:'offer', offer:this.peerConnection.localDescription, @@ -197,7 +198,7 @@ bricks.RTCClient = class extends bricks.VBox { async signaling_message_handle(event){ var datapkg = JSON.parse(event.data); var d = datapkg.data; - console.log('data received from server', datapkg, 'd=', d, event); + console.log('data received from server', 'd=', d, d.type); switch (d.type){ case 'onlineList': this.onlineList = d.onlineList; @@ -209,7 +210,7 @@ bricks.RTCClient = class extends bricks.VBox { break; case 'offer': var offer = new RTCSessionDescription(d.offer); - var answer = await this.peerConnection.setRemoteDescription(offer); + var answer = this.peerConnection.setRemoteDescription(offer); this.peerConnection.setLocalDescription(answer); this.socket.send(JSON.stringify({ type:'answer',