|
@@ -4,7 +4,6 @@ import React, { PureComponent } from 'react';
|
4
|
4
|
import { Image, View } from 'react-native';
|
5
|
5
|
import type { Dispatch } from 'redux';
|
6
|
6
|
|
7
|
|
-import { ColorSchemeRegistry } from '../../../base/color-scheme';
|
8
|
7
|
import { MEDIA_TYPE, VIDEO_TYPE } from '../../../base/media';
|
9
|
8
|
import {
|
10
|
9
|
PARTICIPANT_ROLE,
|
|
@@ -18,7 +17,6 @@ import {
|
18
|
17
|
} from '../../../base/participants';
|
19
|
18
|
import { Container } from '../../../base/react';
|
20
|
19
|
import { connect } from '../../../base/redux';
|
21
|
|
-import { StyleType } from '../../../base/styles';
|
22
|
20
|
import { getTrackByMediaTypeAndParticipant } from '../../../base/tracks';
|
23
|
21
|
import { ConnectionIndicator } from '../../../connection-indicator';
|
24
|
22
|
import { DisplayNameLabel } from '../../../display-name';
|
|
@@ -32,6 +30,7 @@ import { SQUARE_TILE_ASPECT_RATIO } from '../../constants';
|
32
|
30
|
|
33
|
31
|
import AudioMutedIndicator from './AudioMutedIndicator';
|
34
|
32
|
import ModeratorIndicator from './ModeratorIndicator';
|
|
33
|
+import PinnedIndicator from './PinnedIndicator';
|
35
|
34
|
import RaisedHandIndicator from './RaisedHandIndicator';
|
36
|
35
|
import ScreenShareIndicator from './ScreenShareIndicator';
|
37
|
36
|
import styles, { AVATAR_SIZE } from './styles';
|
|
@@ -79,11 +78,6 @@ type Props = {
|
79
|
78
|
*/
|
80
|
79
|
_participantId: string,
|
81
|
80
|
|
82
|
|
- /**
|
83
|
|
- * Indicates whether the participant is displayed on the large video.
|
84
|
|
- */
|
85
|
|
- _participantInLargeVideo: boolean,
|
86
|
|
-
|
87
|
81
|
/**
|
88
|
82
|
* Indicates whether the participant is pinned or not.
|
89
|
83
|
*/
|
|
@@ -104,18 +98,6 @@ type Props = {
|
104
|
98
|
*/
|
105
|
99
|
_renderModeratorIndicator: boolean,
|
106
|
100
|
|
107
|
|
- /**
|
108
|
|
- * The color-schemed stylesheet of the feature.
|
109
|
|
- */
|
110
|
|
- _styles: StyleType,
|
111
|
|
-
|
112
|
|
- /**
|
113
|
|
- * If true, there will be no color overlay (tint) on the thumbnail
|
114
|
|
- * indicating the participant associated with the thumbnail is displayed on
|
115
|
|
- * large video. By default there will be a tint.
|
116
|
|
- */
|
117
|
|
- disableTint?: boolean,
|
118
|
|
-
|
119
|
101
|
/**
|
120
|
102
|
* Invoked to trigger state changes in Redux.
|
121
|
103
|
*/
|
|
@@ -208,7 +190,9 @@ class Thumbnail extends PureComponent<Props> {
|
208
|
190
|
_isFakeParticipant,
|
209
|
191
|
_renderModeratorIndicator: renderModeratorIndicator,
|
210
|
192
|
_participantId: participantId,
|
211
|
|
- renderDisplayName
|
|
193
|
+ _pinned,
|
|
194
|
+ renderDisplayName,
|
|
195
|
+ tileView
|
212
|
196
|
} = this.props;
|
213
|
197
|
const indicators = [];
|
214
|
198
|
|
|
@@ -221,7 +205,7 @@ class Thumbnail extends PureComponent<Props> {
|
221
|
205
|
] }>
|
222
|
206
|
<ConnectionIndicator participantId = { participantId } />
|
223
|
207
|
<RaisedHandIndicator participantId = { participantId } />
|
224
|
|
- {isScreenShare && (
|
|
208
|
+ {tileView && isScreenShare && (
|
225
|
209
|
<View style = { styles.indicatorContainer }>
|
226
|
210
|
<ScreenShareIndicator />
|
227
|
211
|
</View>
|
|
@@ -232,7 +216,11 @@ class Thumbnail extends PureComponent<Props> {
|
232
|
216
|
style = { styles.thumbnailIndicatorContainer }>
|
233
|
217
|
<Container style = { (audioMuted || renderModeratorIndicator) && styles.bottomIndicatorsContainer }>
|
234
|
218
|
{ audioMuted && <AudioMutedIndicator /> }
|
|
219
|
+ { !tileView && _pinned && <PinnedIndicator />}
|
235
|
220
|
{ renderModeratorIndicator && <ModeratorIndicator />}
|
|
221
|
+ { !tileView && isScreenShare
|
|
222
|
+ && <ScreenShareIndicator />
|
|
223
|
+ }
|
236
|
224
|
</Container>
|
237
|
225
|
{
|
238
|
226
|
renderDisplayName && <DisplayNameLabel
|
|
@@ -257,12 +245,8 @@ class Thumbnail extends PureComponent<Props> {
|
257
|
245
|
_isScreenShare: isScreenShare,
|
258
|
246
|
_isFakeParticipant,
|
259
|
247
|
_participantId: participantId,
|
260
|
|
- _participantInLargeVideo: participantInLargeVideo,
|
261
|
|
- _pinned,
|
262
|
248
|
_raisedHand,
|
263
|
249
|
_renderDominantSpeakerIndicator,
|
264
|
|
- _styles,
|
265
|
|
- disableTint,
|
266
|
250
|
height,
|
267
|
251
|
tileView
|
268
|
252
|
} = this.props;
|
|
@@ -281,7 +265,6 @@ class Thumbnail extends PureComponent<Props> {
|
281
|
265
|
onLongPress = { this._onThumbnailLongPress }
|
282
|
266
|
style = { [
|
283
|
267
|
styles.thumbnail,
|
284
|
|
- _pinned && !tileView ? _styles.thumbnailPinned : null,
|
285
|
268
|
styleOverrides,
|
286
|
269
|
_raisedHand ? styles.thumbnailRaisedHand : null,
|
287
|
270
|
_renderDominantSpeakerIndicator ? styles.thumbnailDominantSpeaker : null
|
|
@@ -295,8 +278,6 @@ class Thumbnail extends PureComponent<Props> {
|
295
|
278
|
avatarSize = { tileView ? AVATAR_SIZE * 1.5 : AVATAR_SIZE }
|
296
|
279
|
disableVideo = { isScreenShare || _isFakeParticipant }
|
297
|
280
|
participantId = { participantId }
|
298
|
|
- tintEnabled = { participantInLargeVideo && !disableTint }
|
299
|
|
- tintStyle = { _styles.activeThumbnailTint }
|
300
|
281
|
zOrder = { 1 } />
|
301
|
282
|
{
|
302
|
283
|
this._renderIndicators()
|
|
@@ -316,13 +297,9 @@ class Thumbnail extends PureComponent<Props> {
|
316
|
297
|
* @returns {Object}
|
317
|
298
|
*/
|
318
|
299
|
function _mapStateToProps(state, ownProps) {
|
319
|
|
- // We need read-only access to the state of features/large-video so that the
|
320
|
|
- // filmstrip doesn't render the video of the participant who is rendered on
|
321
|
|
- // the stage i.e. as a large video.
|
322
|
|
- const largeVideo = state['features/large-video'];
|
323
|
300
|
const { ownerId } = state['features/shared-video'];
|
324
|
301
|
const tracks = state['features/base/tracks'];
|
325
|
|
- const { participantID } = ownProps;
|
|
302
|
+ const { participantID, tileView } = ownProps;
|
326
|
303
|
const participant = getParticipantByIdOrUndefined(state, participantID);
|
327
|
304
|
const localParticipantId = getLocalParticipant(state).id;
|
328
|
305
|
const id = participant?.id;
|
|
@@ -334,9 +311,8 @@ function _mapStateToProps(state, ownProps) {
|
334
|
311
|
const participantCount = getParticipantCount(state);
|
335
|
312
|
const renderDominantSpeakerIndicator = participant && participant.dominantSpeaker && participantCount > 2;
|
336
|
313
|
const _isEveryoneModerator = isEveryoneModerator(state);
|
337
|
|
- const renderModeratorIndicator = !_isEveryoneModerator
|
|
314
|
+ const renderModeratorIndicator = tileView && !_isEveryoneModerator
|
338
|
315
|
&& participant?.role === PARTICIPANT_ROLE.MODERATOR;
|
339
|
|
- const participantInLargeVideo = id === largeVideo.participantId;
|
340
|
316
|
const { gifUrl: gifSrc } = getGifForParticipant(state, id);
|
341
|
317
|
const mode = getGifDisplayMode(state);
|
342
|
318
|
|
|
@@ -347,13 +323,11 @@ function _mapStateToProps(state, ownProps) {
|
347
|
323
|
_isScreenShare: isScreenShare,
|
348
|
324
|
_local: participant?.local,
|
349
|
325
|
_localVideoOwner: Boolean(ownerId === localParticipantId),
|
350
|
|
- _participantInLargeVideo: participantInLargeVideo,
|
351
|
326
|
_participantId: id,
|
352
|
327
|
_pinned: participant?.pinned,
|
353
|
328
|
_raisedHand: hasRaisedHand(participant),
|
354
|
329
|
_renderDominantSpeakerIndicator: renderDominantSpeakerIndicator,
|
355
|
|
- _renderModeratorIndicator: renderModeratorIndicator,
|
356
|
|
- _styles: ColorSchemeRegistry.get(state, 'Thumbnail')
|
|
330
|
+ _renderModeratorIndicator: renderModeratorIndicator
|
357
|
331
|
};
|
358
|
332
|
}
|
359
|
333
|
|