Invert condition

This commit is contained in:
Pierre HUBERT 2020-04-13 10:31:21 +02:00
parent 2429ea2ad8
commit 3961e79491

View File

@ -109,10 +109,11 @@ class CallWindow extends CustomEvents {
// Display the list of buttons // Display the list of buttons
const buttonsList = [ const buttonsList = [
// Toggle current user camera // Toggle current user camera visibility
{ {
icon: "fa-eye", icon: "fa-eye",
selected: true, selected: false,
label: "toggle-camera-visibility",
onclick: (btn) => { onclick: (btn) => {
setButtonSelected(btn, this.toggleMainStreamVisibility()) setButtonSelected(btn, this.toggleMainStreamVisibility())
} }
@ -205,6 +206,9 @@ class CallWindow extends CustomEvents {
) )
} }
this.on("localVideo", () => {
setButtonSelected(bottomArea.querySelector("[data-label=\"toggle-camera-visibility\"]"), true)
})
@ -493,7 +497,7 @@ class CallWindow extends CustomEvents {
const el = this.videoEls.get(userID()) const el = this.videoEls.get(userID())
if(!el || el.nodeName !== "VIDEO") if(!el || el.nodeName !== "VIDEO")
return true; return false;
// Show again element // Show again element
if(el.parentNode.style.display == "none") { if(el.parentNode.style.display == "none") {
@ -542,11 +546,16 @@ class CallWindow extends CustomEvents {
this.videoEls.set(peerID, videoEl) this.videoEls.set(peerID, videoEl)
// Show user name
if(isVideo) { if(isVideo) {
// Show user name
const userName = (await user(peerID)).fullName const userName = (await user(peerID)).fullName
videoEl.title = userName videoEl.title = userName
} }
if(isVideo && peerID == userID()) {
// Emit an event
this.emitEvent("localVideo")
}
} }
/** /**