From c05376d56739a7e6d82f6f8b353617d92eb5e12d Mon Sep 17 00:00:00 2001 From: Alvaro Ramirez Castillo Date: Thu, 8 Feb 2024 23:31:16 -0500 Subject: [PATCH] message --- src/app/app.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c4f69cb..53a12dc 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -34,18 +34,18 @@ export class AppComponent { this.sendChannel.onopen = () => { this.onSendChannelStateChange() }; this.sendChannel.onclose = () => { this.onSendChannelStateChange() }; - this.remoteConnection = new RTCPeerConnection(); - this.remoteConnection.onicecandidate = (e: any) => { - this.onIceCandidate(this.remoteConnection, e); - }; - this.remoteConnection.ondatachannel = (event: any) => { this.receiveChannelCallback(event) }; - this.offer = await this.hostConnection.createOffer(); this.offerDesc = JSON.stringify(this.offer); this.gotDescription(); } createConnectionRemote() { + this.remoteConnection = new RTCPeerConnection(); + this.remoteConnection.onicecandidate = (e: any) => { + this.onIceCandidate(this.remoteConnection, e); + }; + this.remoteConnection.ondatachannel = (event: any) => { this.receiveChannelCallback(event) }; + const offer: any = JSON.parse(this.offerControl.value || '{}'); this.remoteConnection.setRemoteDescription(offer); this.remoteConnection.createAnswer()