mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Invert condition
This commit is contained in:
		@@ -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")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user