call onDisconnected in webrtc close.

This commit is contained in:
Miroslav Šedivý 2023-05-31 22:21:57 +02:00
parent 78a9a31624
commit 720c2f7a3d

View File

@ -281,7 +281,7 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
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 {