aboutsummaryrefslogtreecommitdiff
path: root/source/client/user.ts
diff options
context:
space:
mode:
authorMetaMuffin <metamuffin@yandex.com>2021-08-06 15:04:50 +0200
committerMetaMuffin <metamuffin@yandex.com>2021-08-06 15:04:50 +0200
commitfe66a0b23dafd562fc50ddfe5ba326ee33872c24 (patch)
treefbe80cc7acddbf34b109c5ae5fdee5eb5e7ccae9 /source/client/user.ts
parent23655aec49f4920a8d5fa77899a0199dc651c907 (diff)
downloadkeks-meet-fe66a0b23dafd562fc50ddfe5ba326ee33872c24.tar
keks-meet-fe66a0b23dafd562fc50ddfe5ba326ee33872c24.tar.bz2
keks-meet-fe66a0b23dafd562fc50ddfe5ba326ee33872c24.tar.zst
mute preview of local user
Diffstat (limited to 'source/client/user.ts')
-rw-r--r--source/client/user.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/client/user.ts b/source/client/user.ts
index 579886f..f4f33e1 100644
--- a/source/client/user.ts
+++ b/source/client/user.ts
@@ -22,7 +22,7 @@ export abstract class User {
this.el.classList.add("user")
this.room.el.append(this.el)
this.setup_view()
- this.update_view()
+ setTimeout(() => this.update_view(), 1)
}
add_track(t: MediaStreamTrack) {
@@ -79,6 +79,7 @@ export abstract class User {
create_media_view() {
const has_video = this.stream.getVideoTracks().length > 0
const has_audio = this.stream.getAudioTracks().length > 0
+ if (this.local && !has_video) return document.createElement("div")
const media_el = has_video ? document.createElement("video") : document.createElement("audio")
media_el.classList.add("media")
media_el.autoplay = true
@@ -87,6 +88,7 @@ export abstract class User {
if (has_video) media_el.addEventListener("click", () => {
media_el.classList.remove("maximized")
})
+ if (this.local) media_el.muted = true
const controls_el = document.createElement("div")
controls_el.classList.add("media-controls")