From fe66a0b23dafd562fc50ddfe5ba326ee33872c24 Mon Sep 17 00:00:00 2001 From: MetaMuffin Date: Fri, 6 Aug 2021 15:04:50 +0200 Subject: mute preview of local user --- source/client/local_user.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/client/local_user.ts') diff --git a/source/client/local_user.ts b/source/client/local_user.ts index 729dcb7..78652b3 100644 --- a/source/client/local_user.ts +++ b/source/client/local_user.ts @@ -16,6 +16,7 @@ export class LocalUser extends User { constructor(room: Room, name: string) { super(room, name) this.el.classList.add("local") + this.local = true this.create_controls() if (parameter_bool("audio_enabled", false)) this.enable_audio() if (parameter_bool("video_enabled", false)) this.enable_video() @@ -93,6 +94,7 @@ export class LocalUser extends User { this.audio_track = t this.room.remote_users.forEach(u => u.peer.addTrack(t)) + this.stream.addTrack(t) this.update_view_w() } async disable_video() { @@ -113,6 +115,7 @@ export class LocalUser extends User { if (s.track == this.audio_track) u.peer.removeTrack(s) }) }) + this.stream.removeTrack(this.audio_track) this.update_view_w() this.audio_track = undefined } -- cgit v1.2.3-70-g09d2