|
@@ -1,4 +1,4 @@
|
1
|
|
-/* global $, APP */
|
|
1
|
+/* global $, APP, JitsiMeetJS */
|
2
|
2
|
const logger = require("jitsi-meet-logger").getLogger(__filename);
|
3
|
3
|
|
4
|
4
|
import Avatar from "../avatar/Avatar";
|
|
@@ -9,6 +9,9 @@ import {VideoContainer, VIDEO_CONTAINER_TYPE} from "./VideoContainer";
|
9
|
9
|
|
10
|
10
|
import AudioLevels from "../audio_levels/AudioLevels";
|
11
|
11
|
|
|
12
|
+const ParticipantConnectionStatus
|
|
13
|
+ = JitsiMeetJS.constants.participantConnectionStatus;
|
|
14
|
+
|
12
|
15
|
/**
|
13
|
16
|
* Manager for all Large containers.
|
14
|
17
|
*/
|
|
@@ -114,7 +117,7 @@ export default class LargeVideoManager {
|
114
|
117
|
// (camera or desktop) is a completely different thing than
|
115
|
118
|
// the video container type (Etherpad, SharedVideo, VideoContainer).
|
116
|
119
|
// ----------------------------------------------------------------
|
117
|
|
- // If we the continer is VIDEO_CONTAINER_TYPE, we need to check
|
|
120
|
+ // If the container is VIDEO_CONTAINER_TYPE, we need to check
|
118
|
121
|
// its stream whether exist and is muted to set isVideoMuted
|
119
|
122
|
// in rest of the cases it is false
|
120
|
123
|
let showAvatar
|
|
@@ -125,11 +128,10 @@ export default class LargeVideoManager {
|
125
|
128
|
// displayed in case we have no video image cached. That is if
|
126
|
129
|
// there was a user switch(image is lost on stream detach) or if
|
127
|
130
|
// the video was not rendered, before the connection has failed.
|
128
|
|
- const isHavingConnectivityIssues
|
129
|
|
- = APP.conference.isParticipantConnectionActive(id) === false;
|
|
131
|
+ const isConnectionActive = this._isConnectionActive(id);
|
130
|
132
|
|
131
|
133
|
if (videoType === VIDEO_CONTAINER_TYPE
|
132
|
|
- && isHavingConnectivityIssues
|
|
134
|
+ && !isConnectionActive
|
133
|
135
|
&& (isUserSwitch || !container.wasVideoRendered)) {
|
134
|
136
|
showAvatar = true;
|
135
|
137
|
}
|
|
@@ -158,12 +160,19 @@ export default class LargeVideoManager {
|
158
|
160
|
// Make sure no notification about remote failure is shown as
|
159
|
161
|
// its UI conflicts with the one for local connection interrupted.
|
160
|
162
|
const isConnected = APP.conference.isConnectionInterrupted()
|
161
|
|
- || !isHavingConnectivityIssues;
|
|
163
|
+ || isConnectionActive;
|
|
164
|
+
|
|
165
|
+ // when isHavingConnectivityIssues, state can be inactive,
|
|
166
|
+ // interrupted or restoring. We show different message for
|
|
167
|
+ // interrupted and the rest.
|
|
168
|
+ const isConnectionInterrupted =
|
|
169
|
+ APP.conference.getParticipantConnectionStatus(id)
|
|
170
|
+ === ParticipantConnectionStatus.INTERRUPTED;
|
162
|
171
|
|
163
|
172
|
this.updateParticipantConnStatusIndication(
|
164
|
173
|
id,
|
165
|
174
|
isConnected,
|
166
|
|
- (isHavingConnectivityIssues)
|
|
175
|
+ (isConnectionInterrupted)
|
167
|
176
|
? "connection.USER_CONNECTION_INTERRUPTED"
|
168
|
177
|
: "connection.LOW_BANDWIDTH");
|
169
|
178
|
|
|
@@ -180,6 +189,22 @@ export default class LargeVideoManager {
|
180
|
189
|
});
|
181
|
190
|
}
|
182
|
191
|
|
|
192
|
+ /**
|
|
193
|
+ * Checks whether a participant's peer connection status is active.
|
|
194
|
+ * There is no JitsiParticipant for local id we skip checking local
|
|
195
|
+ * participant and report it as having no connectivity issues.
|
|
196
|
+ *
|
|
197
|
+ * @param {string} id the id of participant(MUC nickname)
|
|
198
|
+ * @returns {boolean} <tt>true</tt> when participant connection status is
|
|
199
|
+ * {@link ParticipantConnectionStatus.ACTIVE} and <tt>false</tt> otherwise.
|
|
200
|
+ * @private
|
|
201
|
+ */
|
|
202
|
+ _isConnectionActive(id) {
|
|
203
|
+ return APP.conference.isLocalId(id)
|
|
204
|
+ || APP.conference.getParticipantConnectionStatus(this.id)
|
|
205
|
+ === ParticipantConnectionStatus.ACTIVE;
|
|
206
|
+ }
|
|
207
|
+
|
183
|
208
|
/**
|
184
|
209
|
* Shows/hides notification about participant's connectivity issues to be
|
185
|
210
|
* shown on the large video area.
|
|
@@ -340,7 +365,7 @@ export default class LargeVideoManager {
|
340
|
365
|
*/
|
341
|
366
|
showRemoteConnectionMessage (show) {
|
342
|
367
|
if (typeof show !== 'boolean') {
|
343
|
|
- show = !APP.conference.isParticipantConnectionActive(this.id);
|
|
368
|
+ show = !this._isConnectionActive(this.id);
|
344
|
369
|
}
|
345
|
370
|
|
346
|
371
|
if (show) {
|