You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2020/03/31 13:56:40 UTC

[openmeetings] branch master updated: [OPENMEETINGS-2209] additional debugging to understand what is wrong

This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new 2f6f6e1  [OPENMEETINGS-2209] additional debugging to understand what is wrong
2f6f6e1 is described below

commit 2f6f6e14d0820979ab91d7021d54d8e612250aff
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Tue Mar 31 20:56:25 2020 +0700

    [OPENMEETINGS-2209] additional debugging to understand what is wrong
---
 .../org/apache/openmeetings/web/room/raw-video.js  | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video.js
index f0e3775..43eef4e 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video.js
@@ -112,6 +112,26 @@ var Video = (function() {
 				});
 		});
 	}
+	function __attachListener(rtcPeer) {
+		if (rtcPeer) {
+			const pc = rtcPeer.peerConnection;
+			pc.onconnectionstatechange = function(event) {
+				console.warn(`!!RTCPeerConnection state changed: ${pc.connectionState}`, event);
+				switch(pc.connectionState) {
+					case "connected":
+						// The connection has become fully connected
+						break;
+					case "disconnected":
+					case "failed":
+						// One or more transports has terminated unexpectedly or in an error
+						break;
+					case "closed":
+						// The connection has been closed
+						break;
+				}
+			}
+		}
+	}
 	function __createSendPeer(msg, cnts, stream) {
 		const options = {
 			videoStream: stream
@@ -150,6 +170,7 @@ var Video = (function() {
 					}
 				});
 			});
+		__attachListener(data.rtcPeer);
 	}
 	function _createSendPeer(msg) {
 		if (VideoUtil.isSharing(sd) || VideoUtil.isRecording(sd)) {
@@ -183,6 +204,7 @@ var Video = (function() {
 					});
 				});
 			});
+		__attachListener(data.rtcPeer);
 	}
 	function _handleMicStatus(state) {
 		if (!footer || !footer.is(':visible')) {