Skip to content

Commit

Permalink
message
Browse files Browse the repository at this point in the history
  • Loading branch information
Alvaro Ramirez Castillo authored and Alvaro Ramirez Castillo committed Feb 9, 2024
1 parent a6778b3 commit c05376d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c05376d

Please sign in to comment.