From 804ad49d110f6b6c2db6370ab89815fd8a73919c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 12 Sep 2021 19:08:18 +0200 Subject: [PATCH] fix icecandidateerror. --- src/component/internal/webrtc.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/component/internal/webrtc.ts b/src/component/internal/webrtc.ts index ca178c15..143594b9 100644 --- a/src/component/internal/webrtc.ts +++ b/src/component/internal/webrtc.ts @@ -94,12 +94,13 @@ export class NekoWebRTC extends EventEmitter { this._log.debug(`sending remote ICE candidate`, { init }) } - this._peer.onicecandidateerror = (event: RTCPeerConnectionIceErrorEvent) => { - const fields = { error: event.errorText, code: event.errorCode, port: event.port, url: event.url } + this._peer.onicecandidateerror = (event: Event) => { + const e = event as RTCPeerConnectionIceErrorEvent + const fields = { error: e.errorText, code: e.errorCode, port: e.port, url: e.url } this._log.warn(`ICE candidate error`, fields) } - this._peer.onconnectionstatechange = (event) => { + this._peer.onconnectionstatechange = () => { const state = this._peer!.connectionState this._log.info(`peer connection state changed`, { state }) @@ -113,7 +114,7 @@ export class NekoWebRTC extends EventEmitter { } } - this._peer.oniceconnectionstatechange = (event) => { + this._peer.oniceconnectionstatechange = () => { this._state = this._peer!.iceConnectionState this._log.info(`peer ice connection state changed`, { state: this._state }) @@ -128,7 +129,7 @@ export class NekoWebRTC extends EventEmitter { } } - this._peer.onsignalingstatechange = (event) => { + this._peer.onsignalingstatechange = () => { const state = this._peer!.iceConnectionState this._log.info(`peer signaling state changed`, { state }) @@ -142,7 +143,7 @@ export class NekoWebRTC extends EventEmitter { } } - this._peer.onnegotiationneeded = (event) => { + this._peer.onnegotiationneeded = () => { this._log.warn(`negotiation is neded`) }