From 720c2f7a3dce677338d861ee9d4b9c7812d92fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Wed, 31 May 2023 22:21:57 +0200 Subject: [PATCH] call onDisconnected in webrtc close. --- src/component/internal/webrtc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/internal/webrtc.ts b/src/component/internal/webrtc.ts index 95221516..19bb8b64 100644 --- a/src/component/internal/webrtc.ts +++ b/src/component/internal/webrtc.ts @@ -281,7 +281,7 @@ export class NekoWebRTC extends EventEmitter { this._log.warn(`unable to generate video snap`, { error }) } - this._peer.close() + this.onDisconnected(new Error('connection closed')) } public addTrack(track: MediaStreamTrack, ...streams: MediaStream[]): RTCRtpSender {