|
|
@@ -1,6 +1,7 @@
|
|
1
|
1
|
import React, { Component } from 'react';
|
|
2
|
2
|
import { connect } from 'react-redux';
|
|
3
|
3
|
|
|
|
4
|
+import { JitsiParticipantConnectionStatus } from '../../lib-jitsi-meet';
|
|
4
|
5
|
import {
|
|
5
|
6
|
MEDIA_TYPE,
|
|
6
|
7
|
shouldRenderVideoTrack,
|
|
|
@@ -35,11 +36,12 @@ class ParticipantView extends Component {
|
|
35
|
36
|
_avatar: React.PropTypes.string,
|
|
36
|
37
|
|
|
37
|
38
|
/**
|
|
38
|
|
- * True if the participant is in the last N endpoints set, false if he
|
|
39
|
|
- * isn't. If undefined, we have no indication, so the same course of
|
|
40
|
|
- * action as true is taken.
|
|
|
39
|
+ * The connection status for the participant. Its video will only be
|
|
|
40
|
+ * rendered if the connection status is 'active', otherwise the avatar
|
|
|
41
|
+ * will be rendered. If undefined, we have no indication, so the same
|
|
|
42
|
+ * course of action as 'active' is taken.
|
|
41
|
43
|
*/
|
|
42
|
|
- _isInLastN: React.PropTypes.bool,
|
|
|
44
|
+ _connectionStatus: React.PropTypes.string,
|
|
43
|
45
|
|
|
44
|
46
|
/**
|
|
45
|
47
|
* The video Track of the participant with {@link #participantId}.
|
|
|
@@ -94,7 +96,7 @@ class ParticipantView extends Component {
|
|
94
|
96
|
render() {
|
|
95
|
97
|
const {
|
|
96
|
98
|
_avatar: avatar,
|
|
97
|
|
- _isInLastN: isInLastN,
|
|
|
99
|
+ _connectionStatus: connectionStatus,
|
|
98
|
100
|
_videoTrack: videoTrack
|
|
99
|
101
|
} = this.props;
|
|
100
|
102
|
|
|
|
@@ -105,7 +107,9 @@ class ParticipantView extends Component {
|
|
105
|
107
|
const waitForVideoStarted = false;
|
|
106
|
108
|
const renderVideo
|
|
107
|
109
|
= shouldRenderVideoTrack(videoTrack, waitForVideoStarted)
|
|
108
|
|
- && (typeof isInLastN === 'undefined' || isInLastN);
|
|
|
110
|
+ && (typeof connectionStatus === 'undefined'
|
|
|
111
|
+ || connectionStatus
|
|
|
112
|
+ === JitsiParticipantConnectionStatus.ACTIVE);
|
|
109
|
113
|
|
|
110
|
114
|
// Is the avatar to be rendered?
|
|
111
|
115
|
const renderAvatar = Boolean(!renderVideo && avatar);
|
|
|
@@ -168,7 +172,7 @@ function _toBoolean(value, undefinedValue) {
|
|
168
|
172
|
* @private
|
|
169
|
173
|
* @returns {{
|
|
170
|
174
|
* _avatar: string,
|
|
171
|
|
- * _isInLastN: boolean,
|
|
|
175
|
+ * _connectionStatus: string,
|
|
172
|
176
|
* _videoTrack: Track
|
|
173
|
177
|
* }}
|
|
174
|
178
|
*/
|
|
|
@@ -181,7 +185,7 @@ function _mapStateToProps(state, ownProps) {
|
|
181
|
185
|
|
|
182
|
186
|
return {
|
|
183
|
187
|
_avatar: participant && getAvatarURL(participant),
|
|
184
|
|
- _isInLastN: participant && participant.isInLastN,
|
|
|
188
|
+ _connectionStatus: participant && participant.connectionStatus,
|
|
185
|
189
|
_videoTrack:
|
|
186
|
190
|
getTrackByMediaTypeAndParticipant(
|
|
187
|
191
|
state['features/base/tracks'],
|