From d6c93210246633a71f72fa34329b2c06006c7406 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 13 Apr 2020 14:27:11 +0200 Subject: [PATCH] Simple audio-only conversation boxes --- assets/js/components/calls/window.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assets/js/components/calls/window.js b/assets/js/components/calls/window.js index c87efe33..44e9b241 100644 --- a/assets/js/components/calls/window.js +++ b/assets/js/components/calls/window.js @@ -18,6 +18,7 @@ class CallWindow extends CustomEvents { // Initialize variables this.conv = conv; this.callID = conv.ID; + this.allowVideo = conv.can_have_video_call; /** @type {Map} */ this.peersEls = new Map() @@ -117,6 +118,7 @@ class CallWindow extends CustomEvents { icon: "fa-eye", selected: false, label: "toggle-camera-visibility", + needVideo: true, onclick: (btn) => { setButtonSelected(btn, this.toggleMainStreamVisibility()) } @@ -147,6 +149,7 @@ class CallWindow extends CustomEvents { icon: "fa-video-camera", label: "camera", selected: false, + needVideo: true, onclick: () => { this.toggleStream(true) } @@ -157,6 +160,7 @@ class CallWindow extends CustomEvents { { icon: "fa-expand", selected: false, + needVideo: true, onclick: (btn) => { RequestFullScreen(this.rootEl); setTimeout(() => { @@ -169,6 +173,9 @@ class CallWindow extends CustomEvents { //Add buttons buttonsList.forEach((button) => { + if(button.needVideo && !this.allowVideo) + return; + const buttonEl = createElem2({ appendTo: bottomArea, type: "div",