Improving the video transform feedback when we are connecting, and cleaning the pc_id when disconnected.
This commit is contained in:
@@ -129,6 +129,9 @@ class WebRTCApp {
|
||||
private async start(): Promise<void> {
|
||||
this.clearAllLogs()
|
||||
|
||||
this.connectBtn.disabled = true;
|
||||
this.updateStatus("Connecting")
|
||||
|
||||
const audioDevice = this.audioInput.value;
|
||||
const audioCodec = this.audioCodec.value;
|
||||
const videoDevice = this.videoInput.value;
|
||||
|
||||
@@ -74,7 +74,7 @@ export class SmallWebRTCTransport {
|
||||
if (connectionState == 'connected') {
|
||||
this._callbacks.onConnected()
|
||||
} else if (connectionState == 'disconnected') {
|
||||
this._callbacks.onDisconnected()
|
||||
this.handleDisconnected()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,6 +167,11 @@ export class SmallWebRTCTransport {
|
||||
return this.pc!.getTransceivers()[1];
|
||||
}
|
||||
|
||||
private handleDisconnected() {
|
||||
this.pc_id = null
|
||||
this._callbacks.onDisconnected()
|
||||
}
|
||||
|
||||
async start(audioDevice: string | undefined, audioCodec: string, videoCodec: string, videoDevice: string | undefined): Promise<void> {
|
||||
this.pc = this.createPeerConnection();
|
||||
this.addInitialTransceivers();
|
||||
@@ -299,7 +304,7 @@ export class SmallWebRTCTransport {
|
||||
this.pc.close();
|
||||
|
||||
// For some reason after we close the peer connection, it is not triggering the listeners
|
||||
this._callbacks.onDisconnected()
|
||||
this.handleDisconnected()
|
||||
}
|
||||
|
||||
private async getAllDevices() {
|
||||
|
||||
Reference in New Issue
Block a user