()
| 54 | } |
| 55 | |
| 56 | private setupPeerConnection(): void { |
| 57 | this.pc.ondatachannel = this.handleDataChannel.bind(this) |
| 58 | this.pc.onnegotiationneeded = this.reNegotiation.bind(this) |
| 59 | this.pc.onicecandidate = (e) => e.candidate && this.onICECandidate(e.candidate) |
| 60 | this.pc.onicecandidateerror = (e) => { |
| 61 | // console.warn(e) |
| 62 | // ingore |
| 63 | } |
| 64 | this.pc.onconnectionstatechange = this.handleConnectionStateChange.bind(this) |
| 65 | } |
| 66 | |
| 67 | private handleDataChannel(e: RTCDataChannelEvent): void { |
| 68 | this.dc = e.channel |