From 305271916cb813beff34e47404cc0b8f284f222b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Mon, 7 Jun 2021 11:57:44 +0200 Subject: [PATCH] start unmuted on reconnects #65. --- README.md | 1 + client/src/components/video.vue | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d4c5dae..108769b2 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms. - Added HEALTHCHECK to Dockerfile. - Arguments in broadcast pipeline are optional, not positional and can be repeated `{url} {device} {display}`. - Chat messages are dense, when repeated, they are joined together. +- Start unmuted on reconnects. ### Roadmap & TODOs - Catch errors from gst pipeline, tell user if broadcast failed. diff --git a/client/src/components/video.vue b/client/src/components/video.vue index c302331c..f9d1e388 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -217,6 +217,7 @@ private observer = new ResizeObserver(this.onResise.bind(this)) private focused = false private fullscreen = false + private startsMuted = true get admin() { return this.$accessor.user.admin @@ -336,6 +337,7 @@ onMutedChanged(muted: boolean) { if (this._video) { this._video.muted = muted + this.startsMuted = muted } } @@ -385,7 +387,7 @@ this._video.addEventListener('canplaythrough', () => { this.$accessor.video.setPlayable(true) if (this.autoplay) { - if (!document.hasFocus() || !this.$accessor.active) { + if (this.startsMuted && (!document.hasFocus() || !this.$accessor.active)) { this.$accessor.video.setMuted(true) this._video.muted = true }