|
|
@@ -34,6 +34,13 @@ class ParticipantView extends Component {
|
|
34
|
34
|
*/
|
|
35
|
35
|
_avatar: React.PropTypes.string,
|
|
36
|
36
|
|
|
|
37
|
+ /**
|
|
|
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.
|
|
|
41
|
+ */
|
|
|
42
|
+ _isInLastN: React.PropTypes.bool,
|
|
|
43
|
+
|
|
37
|
44
|
/**
|
|
38
|
45
|
* The video Track of the participant with {@link #participantId}.
|
|
39
|
46
|
*/
|
|
|
@@ -85,20 +92,23 @@ class ParticipantView extends Component {
|
|
85
|
92
|
* @returns {ReactElement}
|
|
86
|
93
|
*/
|
|
87
|
94
|
render() {
|
|
88
|
|
- // Is the video to be rendered?
|
|
89
|
|
- const videoTrack = this.props._videoTrack;
|
|
|
95
|
+ const {
|
|
|
96
|
+ _avatar: avatar,
|
|
|
97
|
+ _isInLastN: isInLastN,
|
|
|
98
|
+ _videoTrack: videoTrack
|
|
|
99
|
+ } = this.props;
|
|
90
|
100
|
|
|
|
101
|
+ // Is the video to be rendered?
|
|
91
|
102
|
// FIXME It's currently impossible to have true as the value of
|
|
92
|
103
|
// waitForVideoStarted because videoTrack's state videoStarted will be
|
|
93
|
104
|
// updated only after videoTrack is rendered.
|
|
94
|
105
|
const waitForVideoStarted = false;
|
|
95
|
106
|
const renderVideo
|
|
96
|
|
- = shouldRenderVideoTrack(videoTrack, waitForVideoStarted);
|
|
|
107
|
+ = shouldRenderVideoTrack(videoTrack, waitForVideoStarted)
|
|
|
108
|
+ && (typeof isInLastN === 'undefined' || isInLastN);
|
|
97
|
109
|
|
|
98
|
110
|
// Is the avatar to be rendered?
|
|
99
|
|
- const avatar = this.props._avatar;
|
|
100
|
|
- const renderAvatar
|
|
101
|
|
- = !renderVideo && typeof avatar !== 'undefined' && avatar !== '';
|
|
|
111
|
+ const renderAvatar = Boolean(!renderVideo && avatar);
|
|
102
|
112
|
|
|
103
|
113
|
return (
|
|
104
|
114
|
<Container
|
|
|
@@ -158,6 +168,7 @@ function _toBoolean(value, undefinedValue) {
|
|
158
|
168
|
* @private
|
|
159
|
169
|
* @returns {{
|
|
160
|
170
|
* _avatar: string,
|
|
|
171
|
+ * _isInLastN: boolean,
|
|
161
|
172
|
* _videoTrack: Track
|
|
162
|
173
|
* }}
|
|
163
|
174
|
*/
|
|
|
@@ -170,6 +181,7 @@ function _mapStateToProps(state, ownProps) {
|
|
170
|
181
|
|
|
171
|
182
|
return {
|
|
172
|
183
|
_avatar: participant && getAvatarURL(participant),
|
|
|
184
|
+ _isInLastN: participant && participant.isInLastN,
|
|
173
|
185
|
_videoTrack:
|
|
174
|
186
|
getTrackByMediaTypeAndParticipant(
|
|
175
|
187
|
state['features/base/tracks'],
|