浏览代码

rn,thumbnail: introduce screen-sharing indicator

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

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

@@ -2,7 +2,6 @@
2 2
 
3 3
 import React, { PureComponent } from 'react';
4 4
 
5
-import { IconShareDesktop } from '../../icons';
6 5
 import { getParticipantById } from '../../participants';
7 6
 import { connect } from '../../redux';
8 7
 import { getAvatarColor, getInitials } from '../functions';
@@ -192,17 +191,10 @@ export function _mapStateToProps(state: Object, ownProps: Props) {
192 191
     const { colorBase, displayName, participantId } = ownProps;
193 192
     const _participant: ?Object = participantId && getParticipantById(state, participantId);
194 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 195
     return {
204 196
         _initialsBase,
205
-        _loadableAvatarUrl,
197
+        _loadableAvatarUrl: _participant?.loadableAvatarUrl,
206 198
         colorBase: !colorBase && _participant ? _participant.id : colorBase
207 199
     };
208 200
 }

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

@@ -0,0 +1,19 @@
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,6 +27,7 @@ import AudioMutedIndicator from './AudioMutedIndicator';
27 27
 import DominantSpeakerIndicator from './DominantSpeakerIndicator';
28 28
 import ModeratorIndicator from './ModeratorIndicator';
29 29
 import RaisedHandIndicator from './RaisedHandIndicator';
30
+import ScreenShareIndicator from './ScreenShareIndicator';
30 31
 import VideoMutedIndicator from './VideoMutedIndicator';
31 32
 import styles, { AVATAR_SIZE } from './styles';
32 33
 
@@ -186,9 +187,10 @@ function Thumbnail(props: Props) {
186 187
             { !participant.isFakeParticipant && <Container style = { styles.thumbnailIndicatorContainer }>
187 188
                 { audioMuted
188 189
                     && <AudioMutedIndicator /> }
189
-
190 190
                 { videoMuted
191 191
                     && <VideoMutedIndicator /> }
192
+                { isScreenShare
193
+                    && <ScreenShareIndicator /> }
192 194
             </Container> }
193 195
 
194 196
         </Container>

正在加载...
取消
保存