|
|
@@ -3,15 +3,22 @@
|
|
3
|
3
|
import React, { Component } from 'react';
|
|
4
|
4
|
|
|
5
|
5
|
import VideoLayout from '../../../../modules/UI/videolayout/VideoLayout';
|
|
|
6
|
+import { getLocalParticipant } from '../../base/participants';
|
|
6
|
7
|
import { Watermarks } from '../../base/react';
|
|
7
|
8
|
import { connect } from '../../base/redux';
|
|
|
9
|
+import { getVideoTrackByParticipant } from '../../base/tracks';
|
|
8
|
10
|
import { setColorAlpha } from '../../base/util';
|
|
9
|
11
|
import { StageParticipantNameLabel } from '../../display-name';
|
|
10
|
12
|
import { FILMSTRIP_BREAKPOINT, isFilmstripResizable } from '../../filmstrip';
|
|
11
|
13
|
import { getVerticalViewMaxWidth } from '../../filmstrip/functions.web';
|
|
|
14
|
+import { getLargeVideoParticipant } from '../../large-video/functions';
|
|
12
|
15
|
import { SharedVideo } from '../../shared-video/components/web';
|
|
13
|
16
|
import { Captions } from '../../subtitles/';
|
|
14
|
17
|
import { setTileView } from '../../video-layout/actions';
|
|
|
18
|
+import { setSeeWhatIsBeingShared } from '../actions.web';
|
|
|
19
|
+
|
|
|
20
|
+import ScreenSharePlaceholder from './ScreenSharePlaceholder.web';
|
|
|
21
|
+
|
|
15
|
22
|
|
|
16
|
23
|
declare var interfaceConfig: Object;
|
|
17
|
24
|
|
|
|
@@ -68,6 +75,21 @@ type Props = {
|
|
68
|
75
|
*/
|
|
69
|
76
|
_visibleFilmstrip: boolean,
|
|
70
|
77
|
|
|
|
78
|
+ /**
|
|
|
79
|
+ * The large video participant id.
|
|
|
80
|
+ */
|
|
|
81
|
+ _largeVideoParticipantId: string,
|
|
|
82
|
+
|
|
|
83
|
+ /**
|
|
|
84
|
+ * Whether or not the screen sharing is on.
|
|
|
85
|
+ */
|
|
|
86
|
+ _isScreenSharing: boolean,
|
|
|
87
|
+
|
|
|
88
|
+ /**
|
|
|
89
|
+ * Whether or not the screen sharing is visible.
|
|
|
90
|
+ */
|
|
|
91
|
+ _seeWhatIsBeingShared: boolean,
|
|
|
92
|
+
|
|
71
|
93
|
/**
|
|
72
|
94
|
* The Redux dispatch function.
|
|
73
|
95
|
*/
|
|
|
@@ -109,11 +131,19 @@ class LargeVideo extends Component<Props> {
|
|
109
|
131
|
* @inheritdoc
|
|
110
|
132
|
*/
|
|
111
|
133
|
componentDidUpdate(prevProps: Props) {
|
|
112
|
|
- const { _visibleFilmstrip } = this.props;
|
|
|
134
|
+ const { _visibleFilmstrip, _isScreenSharing, _seeWhatIsBeingShared, _largeVideoParticipantId } = this.props;
|
|
113
|
135
|
|
|
114
|
136
|
if (prevProps._visibleFilmstrip !== _visibleFilmstrip) {
|
|
115
|
137
|
this._updateLayout();
|
|
116
|
138
|
}
|
|
|
139
|
+
|
|
|
140
|
+ if (prevProps._isScreenSharing !== _isScreenSharing && !_isScreenSharing) {
|
|
|
141
|
+ this.props.dispatch(setSeeWhatIsBeingShared(false));
|
|
|
142
|
+ }
|
|
|
143
|
+
|
|
|
144
|
+ if (_isScreenSharing && _seeWhatIsBeingShared) {
|
|
|
145
|
+ VideoLayout.updateLargeVideo(_largeVideoParticipantId, true, true);
|
|
|
146
|
+ }
|
|
117
|
147
|
}
|
|
118
|
148
|
|
|
119
|
149
|
/**
|
|
|
@@ -126,7 +156,9 @@ class LargeVideo extends Component<Props> {
|
|
126
|
156
|
const {
|
|
127
|
157
|
_isChatOpen,
|
|
128
|
158
|
_noAutoPlayVideo,
|
|
129
|
|
- _showDominantSpeakerBadge
|
|
|
159
|
+ _showDominantSpeakerBadge,
|
|
|
160
|
+ _isScreenSharing,
|
|
|
161
|
+ _seeWhatIsBeingShared
|
|
130
|
162
|
} = this.props;
|
|
131
|
163
|
const style = this._getCustomSyles();
|
|
132
|
164
|
const className = `videocontainer${_isChatOpen ? ' shift-right' : ''}`;
|
|
|
@@ -152,7 +184,6 @@ class LargeVideo extends Component<Props> {
|
|
152
|
184
|
<span id = 'remoteConnectionMessage' />
|
|
153
|
185
|
<div id = 'largeVideoElementsContainer'>
|
|
154
|
186
|
<div id = 'largeVideoBackgroundContainer' />
|
|
155
|
|
-
|
|
156
|
187
|
{/*
|
|
157
|
188
|
* FIXME: the architecture of elements related to the large
|
|
158
|
189
|
* video and the naming. The background is not part of
|
|
|
@@ -166,11 +197,11 @@ class LargeVideo extends Component<Props> {
|
|
166
|
197
|
onTouchEnd = { this._onDoubleTap }
|
|
167
|
198
|
ref = { this._wrapperRef }
|
|
168
|
199
|
role = 'figure' >
|
|
169
|
|
- <video
|
|
|
200
|
+ {_isScreenSharing && !_seeWhatIsBeingShared ? <ScreenSharePlaceholder /> : <video
|
|
170
|
201
|
autoPlay = { !_noAutoPlayVideo }
|
|
171
|
202
|
id = 'largeVideo'
|
|
172
|
203
|
muted = { true }
|
|
173
|
|
- playsInline = { true } /* for Safari on iOS to work */ />
|
|
|
204
|
+ playsInline = { true } /* for Safari on iOS to work */ />}
|
|
174
|
205
|
</div>
|
|
175
|
206
|
</div>
|
|
176
|
207
|
{ interfaceConfig.DISABLE_TRANSCRIPTION_SUBTITLES
|
|
|
@@ -292,13 +323,23 @@ function _mapStateToProps(state) {
|
|
292
|
323
|
const { width: verticalFilmstripWidth, visible } = state['features/filmstrip'];
|
|
293
|
324
|
const { hideDominantSpeakerBadge } = state['features/base/config'];
|
|
294
|
325
|
|
|
|
326
|
+ const tracks = state['features/base/tracks'];
|
|
|
327
|
+ const localParticipantId = getLocalParticipant(state)?.id;
|
|
|
328
|
+ const largeVideoParticipant = getLargeVideoParticipant(state);
|
|
|
329
|
+ const videoTrack = getVideoTrackByParticipant(tracks, largeVideoParticipant);
|
|
|
330
|
+ const localParticipantisSharingTheScreen = largeVideoParticipant?.id?.includes(localParticipantId);
|
|
|
331
|
+ const isScreenSharing = localParticipantisSharingTheScreen && videoTrack?.videoType === 'desktop';
|
|
|
332
|
+
|
|
295
|
333
|
return {
|
|
296
|
334
|
_backgroundAlpha: state['features/base/config'].backgroundAlpha,
|
|
297
|
335
|
_customBackgroundColor: backgroundColor,
|
|
298
|
336
|
_customBackgroundImageUrl: backgroundImageUrl,
|
|
299
|
337
|
_isChatOpen: isChatOpen,
|
|
|
338
|
+ _isScreenSharing: isScreenSharing,
|
|
|
339
|
+ _largeVideoParticipantId: largeVideoParticipant?.id,
|
|
300
|
340
|
_noAutoPlayVideo: testingConfig?.noAutoPlayVideo,
|
|
301
|
341
|
_resizableFilmstrip: isFilmstripResizable(state),
|
|
|
342
|
+ _seeWhatIsBeingShared: state['features/large-video'].seeWhatIsBeingShared,
|
|
302
|
343
|
_showDominantSpeakerBadge: !hideDominantSpeakerBadge,
|
|
303
|
344
|
_verticalFilmstripWidth: verticalFilmstripWidth.current,
|
|
304
|
345
|
_verticalViewMaxWidth: getVerticalViewMaxWidth(state),
|