浏览代码

web,small-video: introduce screen-sharing indicator

factor2
Saúl Ibarra Corretgé 5 年前
父节点
当前提交
fdffb688c1

+ 13
- 0
modules/UI/videolayout/SmallVideo.js 查看文件

83
     constructor(VideoLayout) {
83
     constructor(VideoLayout) {
84
         this.isAudioMuted = false;
84
         this.isAudioMuted = false;
85
         this.isVideoMuted = false;
85
         this.isVideoMuted = false;
86
+        this.isScreenSharing = false;
86
         this.videoStream = null;
87
         this.videoStream = null;
87
         this.audioStream = null;
88
         this.audioStream = null;
88
         this.VideoLayout = VideoLayout;
89
         this.VideoLayout = VideoLayout;
234
         this.updateStatusBar();
235
         this.updateStatusBar();
235
     }
236
     }
236
 
237
 
238
+    /**
239
+     * Shows / hides the screen-share indicator over small videos.
240
+     *
241
+     * @param {boolean} isScreenSharing indicates if the screen-share element should be shown
242
+     * or hidden
243
+     */
244
+    setScreenSharing(isScreenSharing) {
245
+        this.isScreenSharing = isScreenSharing;
246
+        this.updateStatusBar();
247
+    }
248
+
237
     /**
249
     /**
238
      * Shows video muted indicator over small videos and disables/enables avatar
250
      * Shows video muted indicator over small videos and disables/enables avatar
239
      * if video muted.
251
      * if video muted.
265
                 <I18nextProvider i18n = { i18next }>
277
                 <I18nextProvider i18n = { i18next }>
266
                     <StatusIndicators
278
                     <StatusIndicators
267
                         showAudioMutedIndicator = { this.isAudioMuted }
279
                         showAudioMutedIndicator = { this.isAudioMuted }
280
+                        showScreenShareIndicator = { this.isScreenSharing }
268
                         showVideoMutedIndicator = { this.isVideoMuted }
281
                         showVideoMutedIndicator = { this.isVideoMuted }
269
                         participantID = { this.id } />
282
                         participantID = { this.id } />
270
                 </I18nextProvider>
283
                 </I18nextProvider>

+ 8
- 0
modules/UI/videolayout/VideoLayout.js 查看文件

177
             this.onAudioMute(id, stream.isMuted());
177
             this.onAudioMute(id, stream.isMuted());
178
         } else {
178
         } else {
179
             this.onVideoMute(id, stream.isMuted());
179
             this.onVideoMute(id, stream.isMuted());
180
+
181
+            if (stream.videoType === 'desktop') {
182
+                remoteVideo.setScreenSharing(true);
183
+            }
180
         }
184
         }
181
     },
185
     },
182
 
186
 
188
 
192
 
189
         if (remoteVideo) {
193
         if (remoteVideo) {
190
             remoteVideo.removeRemoteStreamElement(stream);
194
             remoteVideo.removeRemoteStreamElement(stream);
195
+
196
+            if (stream.videoType === 'desktop') {
197
+                remoteVideo.setScreenSharing(false);
198
+            }
191
         }
199
         }
192
 
200
 
193
         this.updateMutedForNoTracks(id, stream.getType());
201
         this.updateMutedForNoTracks(id, stream.getType());

+ 33
- 0
react/features/filmstrip/components/web/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
+type Props = {
10
+
11
+    /**
12
+     * From which side of the indicator the tooltip should appear from.
13
+     */
14
+    tooltipPosition: string
15
+};
16
+
17
+/**
18
+ * React {@code Component} for showing a screen-sharing icon with a tooltip.
19
+ *
20
+ * @param {Props} props - React props passed to this component.
21
+ * @returns {React$Element<any>}
22
+ */
23
+export default function ScreenShareIndicator(props: Props) {
24
+    return (
25
+        <BaseIndicator
26
+            className = 'screenShare toolbar-icon'
27
+            icon = { IconShareDesktop }
28
+            iconId = 'share-desktop'
29
+            iconSize = { 13 }
30
+            tooltipKey = 'videothumbnail.videomute'
31
+            tooltipPosition = { props.tooltipPosition } />
32
+    );
33
+}

+ 8
- 0
react/features/filmstrip/components/web/StatusIndicators.js 查看文件

8
 
8
 
9
 import AudioMutedIndicator from './AudioMutedIndicator';
9
 import AudioMutedIndicator from './AudioMutedIndicator';
10
 import ModeratorIndicator from './ModeratorIndicator';
10
 import ModeratorIndicator from './ModeratorIndicator';
11
+import ScreenShareIndicator from './ScreenShareIndicator';
11
 import VideoMutedIndicator from './VideoMutedIndicator';
12
 import VideoMutedIndicator from './VideoMutedIndicator';
12
 
13
 
13
 declare var interfaceConfig: Object;
14
 declare var interfaceConfig: Object;
32
      */
33
      */
33
     showAudioMutedIndicator: Boolean,
34
     showAudioMutedIndicator: Boolean,
34
 
35
 
36
+    /**
37
+     * Indicates if the screen share indicator should be visible or not.
38
+     */
39
+    showScreenShareIndicator: Boolean,
40
+
35
     /**
41
     /**
36
      * Indicates if the video muted indicator should be visible or not.
42
      * Indicates if the video muted indicator should be visible or not.
37
      */
43
      */
60
             _currentLayout,
66
             _currentLayout,
61
             _showModeratorIndicator,
67
             _showModeratorIndicator,
62
             showAudioMutedIndicator,
68
             showAudioMutedIndicator,
69
+            showScreenShareIndicator,
63
             showVideoMutedIndicator
70
             showVideoMutedIndicator
64
         } = this.props;
71
         } = this.props;
65
         let tooltipPosition;
72
         let tooltipPosition;
78
         return (
85
         return (
79
             <div>
86
             <div>
80
                 { showAudioMutedIndicator ? <AudioMutedIndicator tooltipPosition = { tooltipPosition } /> : null }
87
                 { showAudioMutedIndicator ? <AudioMutedIndicator tooltipPosition = { tooltipPosition } /> : null }
88
+                { showScreenShareIndicator ? <ScreenShareIndicator tooltipPosition = { tooltipPosition } /> : null }
81
                 { showVideoMutedIndicator ? <VideoMutedIndicator tooltipPosition = { tooltipPosition } /> : null }
89
                 { showVideoMutedIndicator ? <VideoMutedIndicator tooltipPosition = { tooltipPosition } /> : null }
82
                 { _showModeratorIndicator ? <ModeratorIndicator tooltipPosition = { tooltipPosition } /> : null }
90
                 { _showModeratorIndicator ? <ModeratorIndicator tooltipPosition = { tooltipPosition } /> : null }
83
             </div>
91
             </div>

正在加载...
取消
保存