mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Simple audio-only conversation boxes
This commit is contained in:
		@@ -18,6 +18,7 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
		// Initialize variables
 | 
							// Initialize variables
 | 
				
			||||||
		this.conv = conv;
 | 
							this.conv = conv;
 | 
				
			||||||
		this.callID = conv.ID;
 | 
							this.callID = conv.ID;
 | 
				
			||||||
 | 
							this.allowVideo = conv.can_have_video_call;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/** @type {Map<number, Peer>} */
 | 
							/** @type {Map<number, Peer>} */
 | 
				
			||||||
		this.peersEls = new Map()
 | 
							this.peersEls = new Map()
 | 
				
			||||||
@@ -117,6 +118,7 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
					icon: "fa-eye",
 | 
										icon: "fa-eye",
 | 
				
			||||||
					selected: false,
 | 
										selected: false,
 | 
				
			||||||
					label: "toggle-camera-visibility",
 | 
										label: "toggle-camera-visibility",
 | 
				
			||||||
 | 
										needVideo: true,
 | 
				
			||||||
					onclick: (btn) => {
 | 
										onclick: (btn) => {
 | 
				
			||||||
						setButtonSelected(btn, this.toggleMainStreamVisibility())
 | 
											setButtonSelected(btn, this.toggleMainStreamVisibility())
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
@@ -147,6 +149,7 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
					icon: "fa-video-camera",
 | 
										icon: "fa-video-camera",
 | 
				
			||||||
					label: "camera",
 | 
										label: "camera",
 | 
				
			||||||
					selected: false,
 | 
										selected: false,
 | 
				
			||||||
 | 
										needVideo: true,
 | 
				
			||||||
					onclick: () => {
 | 
										onclick: () => {
 | 
				
			||||||
						this.toggleStream(true)
 | 
											this.toggleStream(true)
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
@@ -157,6 +160,7 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
				{
 | 
									{
 | 
				
			||||||
					icon: "fa-expand",
 | 
										icon: "fa-expand",
 | 
				
			||||||
					selected: false,
 | 
										selected: false,
 | 
				
			||||||
 | 
										needVideo: true,
 | 
				
			||||||
					onclick: (btn) => {
 | 
										onclick: (btn) => {
 | 
				
			||||||
						RequestFullScreen(this.rootEl);
 | 
											RequestFullScreen(this.rootEl);
 | 
				
			||||||
						setTimeout(() => {
 | 
											setTimeout(() => {
 | 
				
			||||||
@@ -169,6 +173,9 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
			//Add buttons
 | 
								//Add buttons
 | 
				
			||||||
			buttonsList.forEach((button) => {
 | 
								buttonsList.forEach((button) => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if(button.needVideo && !this.allowVideo)
 | 
				
			||||||
 | 
										return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				const buttonEl = createElem2({
 | 
									const buttonEl = createElem2({
 | 
				
			||||||
					appendTo: bottomArea,
 | 
										appendTo: bottomArea,
 | 
				
			||||||
					type: "div",
 | 
										type: "div",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user