fix(rn,participants) fix rendering screen-sharing
This commit is contained in:
parent
f2b2b02029
commit
e8df8f75a8
|
@ -12,7 +12,7 @@ import { Container, TintedView } from '../../react';
|
||||||
import { connect } from '../../redux';
|
import { connect } from '../../redux';
|
||||||
import { TestHint } from '../../testing/components';
|
import { TestHint } from '../../testing/components';
|
||||||
import { getVideoTrackByParticipant } from '../../tracks';
|
import { getVideoTrackByParticipant } from '../../tracks';
|
||||||
import { getParticipantById, shouldRenderParticipantVideo } from '../functions';
|
import { getParticipantById, isSharedVideoParticipant, shouldRenderParticipantVideo } from '../functions';
|
||||||
import { FakeParticipant } from '../types';
|
import { FakeParticipant } from '../types';
|
||||||
|
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
|
@ -38,6 +38,11 @@ type Props = {
|
||||||
*/
|
*/
|
||||||
_fakeParticipant?: FakeParticipant,
|
_fakeParticipant?: FakeParticipant,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the participant is a shared video participant.
|
||||||
|
*/
|
||||||
|
_isSharedVideoParticipant: boolean,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the participant which this component represents.
|
* The name of the participant which this component represents.
|
||||||
*
|
*
|
||||||
|
@ -176,6 +181,7 @@ class ParticipantView extends Component<Props> {
|
||||||
const {
|
const {
|
||||||
_connectionStatus: connectionStatus,
|
_connectionStatus: connectionStatus,
|
||||||
_fakeParticipant,
|
_fakeParticipant,
|
||||||
|
_isSharedVideoParticipant,
|
||||||
_renderVideo: renderVideo,
|
_renderVideo: renderVideo,
|
||||||
_videoTrack: videoTrack,
|
_videoTrack: videoTrack,
|
||||||
disableVideo,
|
disableVideo,
|
||||||
|
@ -191,7 +197,7 @@ class ParticipantView extends Component<Props> {
|
||||||
? this.props.testHintId
|
? this.props.testHintId
|
||||||
: `org.jitsi.meet.Participant#${this.props.participantId}`;
|
: `org.jitsi.meet.Participant#${this.props.participantId}`;
|
||||||
|
|
||||||
const renderSharedVideo = _fakeParticipant && !disableVideo;
|
const renderSharedVideo = _isSharedVideoParticipant && !disableVideo;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container
|
<Container
|
||||||
|
@ -209,7 +215,7 @@ class ParticipantView extends Component<Props> {
|
||||||
|
|
||||||
{ renderSharedVideo && <SharedVideo /> }
|
{ renderSharedVideo && <SharedVideo /> }
|
||||||
|
|
||||||
{ !_fakeParticipant && renderVideo
|
{ renderVideo
|
||||||
&& <VideoTrack
|
&& <VideoTrack
|
||||||
onPress = { onPress }
|
onPress = { onPress }
|
||||||
videoTrack = { videoTrack }
|
videoTrack = { videoTrack }
|
||||||
|
@ -257,6 +263,7 @@ function _mapStateToProps(state, ownProps) {
|
||||||
_connectionStatus:
|
_connectionStatus:
|
||||||
connectionStatus
|
connectionStatus
|
||||||
|| JitsiParticipantConnectionStatus.ACTIVE,
|
|| JitsiParticipantConnectionStatus.ACTIVE,
|
||||||
|
_isSharedVideoParticipant: isSharedVideoParticipant(participant),
|
||||||
_fakeParticipant: participant?.fakeParticipant,
|
_fakeParticipant: participant?.fakeParticipant,
|
||||||
_participantName: participantName,
|
_participantName: participantName,
|
||||||
_renderVideo: shouldRenderParticipantVideo(state, participantId) && !disableVideo,
|
_renderVideo: shouldRenderParticipantVideo(state, participantId) && !disableVideo,
|
||||||
|
|
|
@ -354,6 +354,16 @@ export function isScreenShareParticipant(participant?: Participant): boolean {
|
||||||
return isLocalScreenshareParticipant(participant) || isRemoteScreenshareParticipant(participant);
|
return isLocalScreenshareParticipant(participant) || isRemoteScreenshareParticipant(participant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the (fake) participant is a shared video.
|
||||||
|
*
|
||||||
|
* @param {Participant|undefined} participant - The participant entity.
|
||||||
|
* @returns {boolean} - True if it's a shared video participant.
|
||||||
|
*/
|
||||||
|
export function isSharedVideoParticipant(participant?: Participant): boolean {
|
||||||
|
return participant?.fakeParticipant === FakeParticipant.SharedVideo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the fake participant is a whiteboard.
|
* Returns whether the fake participant is a whiteboard.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue