mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Auto-show the message when required
This commit is contained in:
		@@ -380,9 +380,14 @@ class CallWindow extends CustomEvents {
 | 
			
		||||
				if(user.userID != userID() && user.ready)
 | 
			
		||||
					await this.PeerReady(user.userID)
 | 
			
		||||
 | 
			
		||||
			// Show appropriate message
 | 
			
		||||
			this.setMessage("Click on <i class='fa fa-microphone'></i> to start to share audio"+
 | 
			
		||||
			// Show helper notice
 | 
			
		||||
			this.on("closedMainPeer", () => {
 | 
			
		||||
				// Show appropriate message
 | 
			
		||||
				this.setMessage("Click on <i class='fa fa-microphone'></i> to start to share audio"+
 | 
			
		||||
				(this.allowVideo ? " or on <i class='fa fa-video-camera'></i> to start sharing your camera" : "") + ".");
 | 
			
		||||
			})
 | 
			
		||||
 | 
			
		||||
			this.emitEvent("closedMainPeer")
 | 
			
		||||
 | 
			
		||||
		} catch(e) {
 | 
			
		||||
			console.error(e)
 | 
			
		||||
@@ -792,11 +797,11 @@ class CallWindow extends CustomEvents {
 | 
			
		||||
	 */
 | 
			
		||||
	async startStreaming(includeVideo, shareScreen = false) {
 | 
			
		||||
 | 
			
		||||
		this.setMessage(null)
 | 
			
		||||
 | 
			
		||||
		// Close any previous connection
 | 
			
		||||
		this.closeMainPeer();
 | 
			
		||||
		this.refreshButtonsState()
 | 
			
		||||
		await this.closeMainPeer();
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		this.setMessage(null)
 | 
			
		||||
 | 
			
		||||
		let stream;
 | 
			
		||||
		
 | 
			
		||||
@@ -822,6 +827,7 @@ class CallWindow extends CustomEvents {
 | 
			
		||||
		}
 | 
			
		||||
		this.mainStream = stream;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		if(includeVideo)
 | 
			
		||||
			stream.getVideoTracks()[0].applyConstraints({
 | 
			
		||||
				width: {max: 320},
 | 
			
		||||
@@ -912,6 +918,8 @@ class CallWindow extends CustomEvents {
 | 
			
		||||
		} catch(e) {
 | 
			
		||||
			console.log("Failed to notify of streaming stop", e)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		this.emitEvent("closedMainPeer")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user