|
@@ -9,7 +9,6 @@ import { translate } from '../../i18n';
|
9
|
9
|
import { JitsiParticipantConnectionStatus } from '../../lib-jitsi-meet';
|
10
|
10
|
import {
|
11
|
11
|
MEDIA_TYPE,
|
12
|
|
- shouldRenderVideoTrack,
|
13
|
12
|
VideoTrack
|
14
|
13
|
} from '../../media';
|
15
|
14
|
import { Container, TintedView } from '../../react';
|
|
@@ -20,7 +19,8 @@ import Avatar from './Avatar';
|
20
|
19
|
import {
|
21
|
20
|
getAvatarURL,
|
22
|
21
|
getParticipantById,
|
23
|
|
- getParticipantDisplayName
|
|
22
|
+ getParticipantDisplayName,
|
|
23
|
+ shouldRenderParticipantVideo
|
24
|
24
|
} from '../functions';
|
25
|
25
|
import styles from './styles';
|
26
|
26
|
|
|
@@ -29,14 +29,6 @@ import styles from './styles';
|
29
|
29
|
*/
|
30
|
30
|
type Props = {
|
31
|
31
|
|
32
|
|
- /**
|
33
|
|
- * The indicator which determines whether conferencing is in audio-only
|
34
|
|
- * mode.
|
35
|
|
- *
|
36
|
|
- * @private
|
37
|
|
- */
|
38
|
|
- _audioOnly: boolean,
|
39
|
|
-
|
40
|
32
|
/**
|
41
|
33
|
* The source (e.g. URI, URL) of the avatar image of the participant with
|
42
|
34
|
* {@link #participantId}.
|
|
@@ -61,6 +53,11 @@ type Props = {
|
61
|
53
|
*/
|
62
|
54
|
_participantName: string,
|
63
|
55
|
|
|
56
|
+ /**
|
|
57
|
+ * True if the video should be rendered, false otherwise.
|
|
58
|
+ */
|
|
59
|
+ _renderVideo: boolean,
|
|
60
|
+
|
64
|
61
|
/**
|
65
|
62
|
* The video Track of the participant with {@link #participantId}.
|
66
|
63
|
*/
|
|
@@ -192,23 +189,11 @@ class ParticipantView extends Component<Props> {
|
192
|
189
|
onPress,
|
193
|
190
|
_avatar: avatar,
|
194
|
191
|
_connectionStatus: connectionStatus,
|
|
192
|
+ _renderVideo: renderVideo,
|
195
|
193
|
_videoTrack: videoTrack
|
196
|
194
|
} = this.props;
|
197
|
195
|
|
198
|
|
- // Is the video to be rendered?
|
199
|
|
- // FIXME It's currently impossible to have true as the value of
|
200
|
|
- // waitForVideoStarted because videoTrack's state videoStarted will be
|
201
|
|
- // updated only after videoTrack is rendered.
|
202
|
|
- // XXX Note that, unlike on web, we don't render video when the
|
203
|
|
- // connection status is interrupted, this is because the renderer
|
204
|
|
- // doesn't retain the last frame forever, so we would end up with a
|
205
|
|
- // black screen.
|
206
|
196
|
const waitForVideoStarted = false;
|
207
|
|
- const renderVideo
|
208
|
|
- = !this.props._audioOnly
|
209
|
|
- && (connectionStatus
|
210
|
|
- === JitsiParticipantConnectionStatus.ACTIVE)
|
211
|
|
- && shouldRenderVideoTrack(videoTrack, waitForVideoStarted);
|
212
|
197
|
|
213
|
198
|
// Is the avatar to be rendered?
|
214
|
199
|
const renderAvatar = Boolean(!renderVideo && avatar);
|
|
@@ -271,10 +256,10 @@ class ParticipantView extends Component<Props> {
|
271
|
256
|
* associated (instance of) {@code ParticipantView}.
|
272
|
257
|
* @private
|
273
|
258
|
* @returns {{
|
274
|
|
- * _audioOnly: boolean,
|
275
|
259
|
* _avatar: string,
|
276
|
260
|
* _connectionStatus: string,
|
277
|
261
|
* _participantName: string,
|
|
262
|
+ * _renderVideo: boolean,
|
278
|
263
|
* _videoTrack: Track
|
279
|
264
|
* }}
|
280
|
265
|
*/
|
|
@@ -308,12 +293,12 @@ function _mapStateToProps(state, ownProps) {
|
308
|
293
|
}
|
309
|
294
|
|
310
|
295
|
return {
|
311
|
|
- _audioOnly: state['features/base/conference'].audioOnly,
|
312
|
296
|
_avatar: avatar,
|
313
|
297
|
_connectionStatus:
|
314
|
298
|
connectionStatus
|
315
|
299
|
|| JitsiParticipantConnectionStatus.ACTIVE,
|
316
|
300
|
_participantName: participantName,
|
|
301
|
+ _renderVideo: shouldRenderParticipantVideo(state, participantId),
|
317
|
302
|
_videoTrack:
|
318
|
303
|
getTrackByMediaTypeAndParticipant(
|
319
|
304
|
state['features/base/tracks'],
|