diff options
author | MetaMuffin <metamuffin@yandex.com> | 2021-08-06 10:00:48 +0200 |
---|---|---|
committer | MetaMuffin <metamuffin@yandex.com> | 2021-08-06 10:00:48 +0200 |
commit | 2387d8910d80b86a95e8c3242bdb6809dddda1aa (patch) | |
tree | c30cc11040534d4893f163e261a0c54f53fabadf /source/client/local_user.ts | |
parent | 57785600bb67dc1163945bd19ff3bbb9f0aab0c2 (diff) | |
download | keks-meet-2387d8910d80b86a95e8c3242bdb6809dddda1aa.tar keks-meet-2387d8910d80b86a95e8c3242bdb6809dddda1aa.tar.bz2 keks-meet-2387d8910d80b86a95e8c3242bdb6809dddda1aa.tar.zst |
works somewhat
Diffstat (limited to 'source/client/local_user.ts')
-rw-r--r-- | source/client/local_user.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/client/local_user.ts b/source/client/local_user.ts index fcad4f3..70a8618 100644 --- a/source/client/local_user.ts +++ b/source/client/local_user.ts @@ -28,8 +28,8 @@ export class LocalUser extends User { } async add_initial_to_remote(ru: RemoteUser) { - if (this.audio_track) ru.peer.addTrack(this.audio_track, new MediaStream()) - if (this.video_track) ru.peer.addTrack(this.video_track, new MediaStream()) + if (this.audio_track) ru.peer.addTrack(this.audio_track) + if (this.video_track) ru.peer.addTrack(this.video_track) } async enable_video() { @@ -47,21 +47,22 @@ export class LocalUser extends User { } async disable_video() { if (!this.video_track) return - this.video_track = undefined this.room.remote_users.forEach(u => { u.peer.getSenders().forEach(s => { + console.log(u, s, this.video_track); if (s.track == this.video_track) u.peer.removeTrack(s) }) }) + this.video_track = undefined } async disable_audio() { if (!this.audio_track) return - this.audio_track = undefined this.room.remote_users.forEach(u => { u.peer.getSenders().forEach(s => { if (s.track == this.audio_track) u.peer.removeTrack(s) }) }) + this.audio_track = undefined } |