mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Show a notice to help to start calls
This commit is contained in:
		@@ -98,6 +98,12 @@
 | 
				
			|||||||
	color: rgb(1, 218, 1);
 | 
						color: rgb(1, 218, 1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.call-window .messages-area {
 | 
				
			||||||
 | 
						color: white;
 | 
				
			||||||
 | 
						margin: 1px 10px;
 | 
				
			||||||
 | 
						text-align: center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.call-window .videos-area {
 | 
					.call-window .videos-area {
 | 
				
			||||||
	display: flex;
 | 
						display: flex;
 | 
				
			||||||
	flex-direction: row;
 | 
						flex-direction: row;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -106,6 +106,13 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
				class: "members-area"
 | 
									class: "members-area"
 | 
				
			||||||
			})
 | 
								})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// Add message area
 | 
				
			||||||
 | 
								this.messageArea = createElem2({
 | 
				
			||||||
 | 
									appendTo: this.rootEl,
 | 
				
			||||||
 | 
									type: "div",
 | 
				
			||||||
 | 
									class: "messages-area"
 | 
				
			||||||
 | 
								})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Create videos area
 | 
								// Create videos area
 | 
				
			||||||
			this.videosArea = createElem2({
 | 
								this.videosArea = createElem2({
 | 
				
			||||||
@@ -373,6 +380,9 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
				if(user.userID != userID() && user.ready)
 | 
									if(user.userID != userID() && user.ready)
 | 
				
			||||||
					await this.PeerReady(user.userID)
 | 
										await this.PeerReady(user.userID)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// 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" : "") + ".");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		} catch(e) {
 | 
							} catch(e) {
 | 
				
			||||||
			console.error(e)
 | 
								console.error(e)
 | 
				
			||||||
@@ -505,6 +515,21 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
			this.emitEvent("close");
 | 
								this.emitEvent("close");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Display a new message for the window
 | 
				
			||||||
 | 
						 * 
 | 
				
			||||||
 | 
						 * @param {String} msg New message / null to remove
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						setMessage(msg) {
 | 
				
			||||||
 | 
							if(msg == null) {
 | 
				
			||||||
 | 
								this.messageArea.style.display = "none"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else {
 | 
				
			||||||
 | 
								this.messageArea.style.display = "block";
 | 
				
			||||||
 | 
								this.messageArea.innerHTML = msg;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Add a member to this call
 | 
						 * Add a member to this call
 | 
				
			||||||
	 * 
 | 
						 * 
 | 
				
			||||||
@@ -608,6 +633,7 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	async toggleStream(isVideo) {
 | 
						async toggleStream(isVideo) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		if(isVideo && !this.conv.can_have_video_call) {
 | 
							if(isVideo && !this.conv.can_have_video_call) {
 | 
				
			||||||
			notify("Video calls can not be done on this conversations!", "danger")
 | 
								notify("Video calls can not be done on this conversations!", "danger")
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
@@ -766,6 +792,8 @@ class CallWindow extends CustomEvents {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	async startStreaming(includeVideo, shareScreen = false) {
 | 
						async startStreaming(includeVideo, shareScreen = false) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							this.setMessage(null)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Close any previous connection
 | 
							// Close any previous connection
 | 
				
			||||||
		this.closeMainPeer();
 | 
							this.closeMainPeer();
 | 
				
			||||||
		this.refreshButtonsState()
 | 
							this.refreshButtonsState()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user