浏览代码

rn,thumbnail: introduce screen-sharing indicator

j8
Saúl Ibarra Corretgé 5 年前
父节点
当前提交
4807badac8

+ 1
- 9
react/features/base/avatar/components/Avatar.js 查看文件

2
 
2
 
3
 import React, { PureComponent } from 'react';
3
 import React, { PureComponent } from 'react';
4
 
4
 
5
-import { IconShareDesktop } from '../../icons';
6
 import { getParticipantById } from '../../participants';
5
 import { getParticipantById } from '../../participants';
7
 import { connect } from '../../redux';
6
 import { connect } from '../../redux';
8
 import { getAvatarColor, getInitials } from '../functions';
7
 import { getAvatarColor, getInitials } from '../functions';
192
     const { colorBase, displayName, participantId } = ownProps;
191
     const { colorBase, displayName, participantId } = ownProps;
193
     const _participant: ?Object = participantId && getParticipantById(state, participantId);
192
     const _participant: ?Object = participantId && getParticipantById(state, participantId);
194
     const _initialsBase = _participant?.name ?? displayName;
193
     const _initialsBase = _participant?.name ?? displayName;
195
-    const screenShares = state['features/video-layout'].screenShares || [];
196
-
197
-    let _loadableAvatarUrl = _participant?.loadableAvatarUrl;
198
-
199
-    if (participantId && screenShares.includes(participantId)) {
200
-        _loadableAvatarUrl = IconShareDesktop;
201
-    }
202
 
194
 
203
     return {
195
     return {
204
         _initialsBase,
196
         _initialsBase,
205
-        _loadableAvatarUrl,
197
+        _loadableAvatarUrl: _participant?.loadableAvatarUrl,
206
         colorBase: !colorBase && _participant ? _participant.id : colorBase
198
         colorBase: !colorBase && _participant ? _participant.id : colorBase
207
     };
199
     };
208
 }
200
 }

+ 19
- 0
react/features/filmstrip/components/native/ScreenShareIndicator.js 查看文件

1
+// @flow
2
+
3
+import React from 'react';
4
+
5
+import { IconShareDesktop } from '../../../base/icons';
6
+import { BaseIndicator } from '../../../base/react';
7
+
8
+/**
9
+ * Thumbnail badge for displaying if a participant is sharing their screen.
10
+ *
11
+ * @returns {React$Element<any>}
12
+ */
13
+export default function ScreenShareIndicator() {
14
+    return (
15
+        <BaseIndicator
16
+            highlight = { false }
17
+            icon = { IconShareDesktop } />
18
+    );
19
+}

+ 3
- 1
react/features/filmstrip/components/native/Thumbnail.js 查看文件

27
 import DominantSpeakerIndicator from './DominantSpeakerIndicator';
27
 import DominantSpeakerIndicator from './DominantSpeakerIndicator';
28
 import ModeratorIndicator from './ModeratorIndicator';
28
 import ModeratorIndicator from './ModeratorIndicator';
29
 import RaisedHandIndicator from './RaisedHandIndicator';
29
 import RaisedHandIndicator from './RaisedHandIndicator';
30
+import ScreenShareIndicator from './ScreenShareIndicator';
30
 import VideoMutedIndicator from './VideoMutedIndicator';
31
 import VideoMutedIndicator from './VideoMutedIndicator';
31
 import styles, { AVATAR_SIZE } from './styles';
32
 import styles, { AVATAR_SIZE } from './styles';
32
 
33
 
186
             { !participant.isFakeParticipant && <Container style = { styles.thumbnailIndicatorContainer }>
187
             { !participant.isFakeParticipant && <Container style = { styles.thumbnailIndicatorContainer }>
187
                 { audioMuted
188
                 { audioMuted
188
                     && <AudioMutedIndicator /> }
189
                     && <AudioMutedIndicator /> }
189
-
190
                 { videoMuted
190
                 { videoMuted
191
                     && <VideoMutedIndicator /> }
191
                     && <VideoMutedIndicator /> }
192
+                { isScreenShare
193
+                    && <ScreenShareIndicator /> }
192
             </Container> }
194
             </Container> }
193
 
195
 
194
         </Container>
196
         </Container>

正在加载...
取消
保存