|
@@ -3,9 +3,10 @@
|
3
|
3
|
import React, { PureComponent } from 'react';
|
4
|
4
|
|
5
|
5
|
import { ColorSchemeRegistry } from '../../base/color-scheme';
|
6
|
|
-import { ParticipantView } from '../../base/participants';
|
|
6
|
+import { ParticipantView, getParticipantById } from '../../base/participants';
|
7
|
7
|
import { connect } from '../../base/redux';
|
8
|
8
|
import { StyleType } from '../../base/styles';
|
|
9
|
+import { isLocalVideoTrackDesktop } from '../../base/tracks/functions';
|
9
|
10
|
|
10
|
11
|
import { AVATAR_SIZE } from './styles';
|
11
|
12
|
|
|
@@ -14,6 +15,11 @@ import { AVATAR_SIZE } from './styles';
|
14
|
15
|
*/
|
15
|
16
|
type Props = {
|
16
|
17
|
|
|
18
|
+ /**
|
|
19
|
+ * Whether video should be disabled.
|
|
20
|
+ */
|
|
21
|
+ _disableVideo: boolean,
|
|
22
|
+
|
17
|
23
|
/**
|
18
|
24
|
* Application's viewport height.
|
19
|
25
|
*/
|
|
@@ -112,6 +118,7 @@ class LargeVideo extends PureComponent<Props, State> {
|
112
|
118
|
useConnectivityInfoLabel
|
113
|
119
|
} = this.state;
|
114
|
120
|
const {
|
|
121
|
+ _disableVideo,
|
115
|
122
|
_participantId,
|
116
|
123
|
_styles,
|
117
|
124
|
onClick
|
|
@@ -120,6 +127,7 @@ class LargeVideo extends PureComponent<Props, State> {
|
120
|
127
|
return (
|
121
|
128
|
<ParticipantView
|
122
|
129
|
avatarSize = { avatarSize }
|
|
130
|
+ disableVideo = { _disableVideo }
|
123
|
131
|
onPress = { onClick }
|
124
|
132
|
participantId = { _participantId }
|
125
|
133
|
style = { _styles.largeVideo }
|
|
@@ -139,11 +147,19 @@ class LargeVideo extends PureComponent<Props, State> {
|
139
|
147
|
* @returns {Props}
|
140
|
148
|
*/
|
141
|
149
|
function _mapStateToProps(state) {
|
|
150
|
+ const { participantId } = state['features/large-video'];
|
|
151
|
+ const participant = getParticipantById(state, participantId);
|
142
|
152
|
const { clientHeight: height, clientWidth: width } = state['features/base/responsive-ui'];
|
|
153
|
+ let disableVideo = false;
|
|
154
|
+
|
|
155
|
+ if (participant?.local) {
|
|
156
|
+ disableVideo = isLocalVideoTrackDesktop(state);
|
|
157
|
+ }
|
143
|
158
|
|
144
|
159
|
return {
|
|
160
|
+ _disableVideo: disableVideo,
|
145
|
161
|
_height: height,
|
146
|
|
- _participantId: state['features/large-video'].participantId,
|
|
162
|
+ _participantId: participantId,
|
147
|
163
|
_styles: ColorSchemeRegistry.get(state, 'LargeVideo'),
|
148
|
164
|
_width: width
|
149
|
165
|
};
|