fix(rn, screen-sharing) don't render own screen-share in large view

This commit is contained in:
Saúl Ibarra Corretgé 2020-11-04 14:13:32 +01:00 committed by Saúl Ibarra Corretgé
parent 9a35026d6a
commit 4211db0893
1 changed files with 18 additions and 2 deletions

View File

@ -3,9 +3,10 @@
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { ColorSchemeRegistry } from '../../base/color-scheme'; import { ColorSchemeRegistry } from '../../base/color-scheme';
import { ParticipantView } from '../../base/participants'; import { ParticipantView, getParticipantById } from '../../base/participants';
import { connect } from '../../base/redux'; import { connect } from '../../base/redux';
import { StyleType } from '../../base/styles'; import { StyleType } from '../../base/styles';
import { isLocalVideoTrackDesktop } from '../../base/tracks/functions';
import { AVATAR_SIZE } from './styles'; import { AVATAR_SIZE } from './styles';
@ -14,6 +15,11 @@ import { AVATAR_SIZE } from './styles';
*/ */
type Props = { type Props = {
/**
* Whether video should be disabled.
*/
_disableVideo: boolean,
/** /**
* Application's viewport height. * Application's viewport height.
*/ */
@ -112,6 +118,7 @@ class LargeVideo extends PureComponent<Props, State> {
useConnectivityInfoLabel useConnectivityInfoLabel
} = this.state; } = this.state;
const { const {
_disableVideo,
_participantId, _participantId,
_styles, _styles,
onClick onClick
@ -120,6 +127,7 @@ class LargeVideo extends PureComponent<Props, State> {
return ( return (
<ParticipantView <ParticipantView
avatarSize = { avatarSize } avatarSize = { avatarSize }
disableVideo = { _disableVideo }
onPress = { onClick } onPress = { onClick }
participantId = { _participantId } participantId = { _participantId }
style = { _styles.largeVideo } style = { _styles.largeVideo }
@ -139,11 +147,19 @@ class LargeVideo extends PureComponent<Props, State> {
* @returns {Props} * @returns {Props}
*/ */
function _mapStateToProps(state) { function _mapStateToProps(state) {
const { participantId } = state['features/large-video'];
const participant = getParticipantById(state, participantId);
const { clientHeight: height, clientWidth: width } = state['features/base/responsive-ui']; const { clientHeight: height, clientWidth: width } = state['features/base/responsive-ui'];
let disableVideo = false;
if (participant?.local) {
disableVideo = isLocalVideoTrackDesktop(state);
}
return { return {
_disableVideo: disableVideo,
_height: height, _height: height,
_participantId: state['features/large-video'].participantId, _participantId: participantId,
_styles: ColorSchemeRegistry.get(state, 'LargeVideo'), _styles: ColorSchemeRegistry.get(state, 'LargeVideo'),
_width: width _width: width
}; };