2020-11-09 20:59:13 +00:00
|
|
|
// @flow
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
import { withStyles } from '@material-ui/styles';
|
|
|
|
import clsx from 'clsx';
|
2022-02-02 20:33:30 +00:00
|
|
|
import debounce from 'lodash/debounce';
|
2020-11-09 20:59:13 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
import { createScreenSharingIssueEvent, sendAnalytics } from '../../../analytics';
|
2020-11-09 20:59:13 +00:00
|
|
|
import { Avatar } from '../../../base/avatar';
|
2022-04-29 14:32:16 +00:00
|
|
|
import { getMultipleVideoSupportFeatureFlag, getSourceNameSignalingFeatureFlag } from '../../../base/config';
|
2021-07-20 08:30:12 +00:00
|
|
|
import { isMobileBrowser } from '../../../base/environment/utils';
|
2022-04-26 20:33:50 +00:00
|
|
|
import { JitsiTrackEvents } from '../../../base/lib-jitsi-meet';
|
2020-11-09 20:59:13 +00:00
|
|
|
import { MEDIA_TYPE, VideoTrack } from '../../../base/media';
|
|
|
|
import {
|
2022-04-12 06:57:01 +00:00
|
|
|
getLocalParticipant,
|
2021-07-09 12:36:19 +00:00
|
|
|
getParticipantByIdOrUndefined,
|
2021-12-20 08:44:22 +00:00
|
|
|
hasRaisedHand,
|
2021-01-21 20:46:47 +00:00
|
|
|
pinParticipant
|
2020-11-09 20:59:13 +00:00
|
|
|
} from '../../../base/participants';
|
|
|
|
import { connect } from '../../../base/redux';
|
2021-09-09 13:14:09 +00:00
|
|
|
import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants';
|
2021-01-21 20:46:47 +00:00
|
|
|
import { isTestModeEnabled } from '../../../base/testing';
|
|
|
|
import {
|
|
|
|
getLocalAudioTrack,
|
|
|
|
getLocalVideoTrack,
|
|
|
|
getTrackByMediaTypeAndParticipant,
|
2022-04-29 14:32:16 +00:00
|
|
|
getVirtualScreenshareParticipantTrack,
|
2022-04-26 20:33:50 +00:00
|
|
|
updateLastTrackVideoMediaEvent,
|
|
|
|
trackStreamingStatusChanged
|
2021-01-21 20:46:47 +00:00
|
|
|
} from '../../../base/tracks';
|
2022-04-06 09:10:31 +00:00
|
|
|
import { getVideoObjectPosition } from '../../../face-landmarks/functions';
|
2022-03-11 13:00:49 +00:00
|
|
|
import { hideGif, showGif } from '../../../gifs/actions';
|
|
|
|
import { getGifDisplayMode, getGifForParticipant } from '../../../gifs/functions';
|
2020-11-09 20:59:13 +00:00
|
|
|
import { PresenceLabel } from '../../../presence-status';
|
|
|
|
import { getCurrentLayout, LAYOUTS } from '../../../video-layout';
|
2022-04-12 06:57:01 +00:00
|
|
|
import { togglePinStageParticipant } from '../../actions';
|
2021-01-21 20:46:47 +00:00
|
|
|
import {
|
|
|
|
DISPLAY_MODE_TO_CLASS_NAME,
|
|
|
|
DISPLAY_VIDEO,
|
2022-02-24 12:20:37 +00:00
|
|
|
SHOW_TOOLBAR_CONTEXT_MENU_AFTER,
|
2022-04-12 13:19:10 +00:00
|
|
|
THUMBNAIL_TYPE,
|
2022-02-24 12:20:37 +00:00
|
|
|
VIDEO_TEST_EVENTS
|
2021-01-21 20:46:47 +00:00
|
|
|
} from '../../constants';
|
2022-02-24 12:20:37 +00:00
|
|
|
import {
|
|
|
|
computeDisplayModeFromInput,
|
2022-03-29 08:45:09 +00:00
|
|
|
getActiveParticipantsIds,
|
2022-02-24 12:20:37 +00:00
|
|
|
getDisplayModeInput,
|
2022-04-21 06:15:34 +00:00
|
|
|
getThumbnailTypeFromLayout,
|
2022-02-24 12:20:37 +00:00
|
|
|
isVideoPlayable,
|
2022-04-21 06:15:34 +00:00
|
|
|
isStageFilmstripAvailable,
|
|
|
|
showGridInVerticalView
|
2022-02-24 12:20:37 +00:00
|
|
|
} from '../../functions';
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
import ThumbnailAudioIndicator from './ThumbnailAudioIndicator';
|
|
|
|
import ThumbnailBottomIndicators from './ThumbnailBottomIndicators';
|
|
|
|
import ThumbnailTopIndicators from './ThumbnailTopIndicators';
|
2022-04-29 14:32:16 +00:00
|
|
|
import VirtualScreenshareParticipant from './VirtualScreenshareParticipant';
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2022-04-26 20:33:50 +00:00
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
declare var interfaceConfig: Object;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} state of {@link Thumbnail}.
|
|
|
|
*/
|
2021-01-21 20:46:47 +00:00
|
|
|
export type State = {|
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
/**
|
|
|
|
* Indicates that the canplay event has been received.
|
|
|
|
*/
|
|
|
|
canPlayEventReceived: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current display mode of the thumbnail.
|
|
|
|
*/
|
|
|
|
displayMode: number,
|
|
|
|
|
|
|
|
/**
|
2021-12-15 13:18:41 +00:00
|
|
|
* Whether popover is visible or not.
|
2021-01-21 20:46:47 +00:00
|
|
|
*/
|
2021-12-15 13:18:41 +00:00
|
|
|
popoverVisible: boolean,
|
2021-11-01 09:39:19 +00:00
|
|
|
|
|
|
|
/**
|
2021-12-15 13:18:41 +00:00
|
|
|
* Indicates whether the thumbnail is hovered or not.
|
2021-11-01 09:39:19 +00:00
|
|
|
*/
|
2021-12-15 13:18:41 +00:00
|
|
|
isHovered: boolean
|
2021-01-21 20:46:47 +00:00
|
|
|
|};
|
2020-11-09 20:59:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link Thumbnail}.
|
|
|
|
*/
|
2021-01-21 20:46:47 +00:00
|
|
|
export type Props = {|
|
2020-11-09 20:59:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The audio track related to the participant.
|
|
|
|
*/
|
|
|
|
_audioTrack: ?Object,
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
/**
|
|
|
|
* Indicates whether the local video flip feature is disabled or not.
|
|
|
|
*/
|
|
|
|
_disableLocalVideoFlip: boolean,
|
|
|
|
|
2021-12-01 10:40:40 +00:00
|
|
|
/**
|
|
|
|
* Indicates whether enlargement of tiles to fill the available space is disabled.
|
|
|
|
*/
|
|
|
|
_disableTileEnlargement: boolean,
|
|
|
|
|
2022-03-11 13:00:49 +00:00
|
|
|
/**
|
|
|
|
* URL of GIF sent by this participant, null if there's none.
|
|
|
|
*/
|
|
|
|
_gifSrc ?: string,
|
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
/**
|
|
|
|
* The height of the Thumbnail.
|
|
|
|
*/
|
|
|
|
_height: number,
|
|
|
|
|
|
|
|
/**
|
2022-03-29 08:45:09 +00:00
|
|
|
* Whether or not the participant is displayed on the stage filmstrip.
|
|
|
|
* Used to hide the video from the vertical filmstrip.
|
2020-11-09 20:59:13 +00:00
|
|
|
*/
|
2022-03-29 08:45:09 +00:00
|
|
|
_isActiveParticipant: boolean,
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
/**
|
2022-03-29 08:45:09 +00:00
|
|
|
* Indicates whether the thumbnail should be hidden or not.
|
2021-01-21 20:46:47 +00:00
|
|
|
*/
|
2022-03-29 08:45:09 +00:00
|
|
|
_isHidden: boolean,
|
2021-01-21 20:46:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether audio only mode is enabled.
|
|
|
|
*/
|
|
|
|
_isAudioOnly: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether the participant associated with the thumbnail is displayed on the large video.
|
|
|
|
*/
|
|
|
|
_isCurrentlyOnLargeVideo: boolean,
|
|
|
|
|
2022-04-04 18:57:58 +00:00
|
|
|
/**
|
2022-05-12 22:47:38 +00:00
|
|
|
* Disable/enable the dominant speaker indicator.
|
2022-04-04 18:57:58 +00:00
|
|
|
*/
|
2022-05-12 22:47:38 +00:00
|
|
|
_isDominantSpeakerDisabled: boolean,
|
2022-04-04 18:57:58 +00:00
|
|
|
|
2021-07-20 08:30:12 +00:00
|
|
|
/**
|
|
|
|
* Whether we are currently running in a mobile browser.
|
|
|
|
*/
|
|
|
|
_isMobile: boolean,
|
|
|
|
|
2021-09-09 13:14:09 +00:00
|
|
|
/**
|
|
|
|
* Whether we are currently running in a mobile browser in portrait orientation.
|
|
|
|
*/
|
|
|
|
_isMobilePortrait: boolean,
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
/**
|
|
|
|
* Indicates whether the participant is screen sharing.
|
|
|
|
*/
|
|
|
|
_isScreenSharing: boolean,
|
|
|
|
|
|
|
|
/**
|
2022-05-12 22:47:38 +00:00
|
|
|
* Indicates whether testing mode is enabled.
|
2021-01-21 20:46:47 +00:00
|
|
|
*/
|
2022-05-12 22:47:38 +00:00
|
|
|
_isTestModeEnabled: boolean,
|
2021-01-21 20:46:47 +00:00
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
/**
|
2022-05-12 22:47:38 +00:00
|
|
|
* Indicates whether the video associated with the thumbnail is playable.
|
2020-11-09 20:59:13 +00:00
|
|
|
*/
|
2022-05-12 22:47:38 +00:00
|
|
|
_isVideoPlayable: boolean,
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
/**
|
2022-05-12 22:47:38 +00:00
|
|
|
* Indicates whether the participant is a virtual screen share participant. This prop is behind the
|
|
|
|
* sourceNameSignaling feature flag.
|
2021-01-21 20:46:47 +00:00
|
|
|
*/
|
2022-05-12 22:47:38 +00:00
|
|
|
_isVirtualScreenshareParticipant: boolean,
|
2021-01-21 20:46:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The current local video flip setting.
|
|
|
|
*/
|
|
|
|
_localFlipX: boolean,
|
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
/**
|
2021-10-22 12:35:33 +00:00
|
|
|
* An object with information about the participant related to the thumbnail.
|
2020-11-09 20:59:13 +00:00
|
|
|
*/
|
|
|
|
_participant: Object,
|
|
|
|
|
2021-12-20 08:44:22 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the participant has the hand raised.
|
|
|
|
*/
|
|
|
|
_raisedHand: boolean,
|
|
|
|
|
2022-05-12 22:47:38 +00:00
|
|
|
/**
|
|
|
|
* Whether source name signaling is enabled.
|
|
|
|
*/
|
|
|
|
_sourceNameSignalingEnabled: boolean,
|
|
|
|
|
2022-03-29 08:45:09 +00:00
|
|
|
/**
|
2022-04-12 13:19:10 +00:00
|
|
|
* Whether or not the current layout is stage filmstrip layout.
|
2022-03-29 08:45:09 +00:00
|
|
|
*/
|
2022-04-12 13:19:10 +00:00
|
|
|
_stageFilmstripLayout: boolean,
|
2022-03-29 08:45:09 +00:00
|
|
|
|
2022-04-12 06:57:01 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the participants are displayed on stage.
|
|
|
|
* (and not screensharing or shared video; used to determine
|
|
|
|
* whether or not the display the participant video in the vertical filmstrip).
|
|
|
|
*/
|
|
|
|
_stageParticipantsVisible: boolean,
|
|
|
|
|
2022-04-12 13:19:10 +00:00
|
|
|
/**
|
|
|
|
* The type of thumbnail to display.
|
|
|
|
*/
|
|
|
|
_thumbnailType: string,
|
|
|
|
|
2022-03-02 12:39:50 +00:00
|
|
|
/**
|
|
|
|
* The video object position for the participant.
|
|
|
|
*/
|
|
|
|
_videoObjectPosition: string,
|
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
/**
|
|
|
|
* The video track that will be displayed in the thumbnail.
|
|
|
|
*/
|
|
|
|
_videoTrack: ?Object,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The width of the thumbnail.
|
|
|
|
*/
|
|
|
|
_width: number,
|
|
|
|
|
|
|
|
/**
|
2022-03-11 13:00:49 +00:00
|
|
|
* An object containing CSS classes.
|
2020-11-09 20:59:13 +00:00
|
|
|
*/
|
2022-03-11 13:00:49 +00:00
|
|
|
classes: Object,
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
/**
|
2022-03-11 13:00:49 +00:00
|
|
|
* The redux dispatch function.
|
2021-12-15 13:18:41 +00:00
|
|
|
*/
|
2022-03-11 13:00:49 +00:00
|
|
|
dispatch: Function,
|
2021-12-15 13:18:41 +00:00
|
|
|
|
2021-03-26 20:23:05 +00:00
|
|
|
/**
|
|
|
|
* The horizontal offset in px for the thumbnail. Used to center the thumbnails from the last row in tile view.
|
|
|
|
*/
|
|
|
|
horizontalOffset: number,
|
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
/**
|
|
|
|
* The ID of the participant related to the thumbnail.
|
|
|
|
*/
|
2021-03-26 20:23:05 +00:00
|
|
|
participantID: ?string,
|
|
|
|
|
2022-03-29 08:45:09 +00:00
|
|
|
/**
|
|
|
|
* Whether the tile is displayed in the stage filmstrip or not.
|
|
|
|
*/
|
|
|
|
stageFilmstrip: boolean,
|
|
|
|
|
2021-03-26 20:23:05 +00:00
|
|
|
/**
|
|
|
|
* Styles that will be set to the Thumbnail's main span element.
|
|
|
|
*/
|
2022-04-26 20:33:50 +00:00
|
|
|
style?: ?Object,
|
|
|
|
|
2022-05-03 21:55:33 +00:00
|
|
|
/**
|
|
|
|
* The width of the thumbnail. Used for expanding the width of the thumbnails on last row in case
|
|
|
|
* there is empty space.
|
|
|
|
*/
|
2022-05-12 22:47:38 +00:00
|
|
|
width?: number
|
2021-01-21 20:46:47 +00:00
|
|
|
|};
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
const defaultStyles = theme => {
|
|
|
|
return {
|
|
|
|
indicatorsContainer: {
|
|
|
|
position: 'absolute',
|
|
|
|
padding: `${theme.spacing(1)}px`,
|
|
|
|
zIndex: 10,
|
|
|
|
width: '100%',
|
|
|
|
boxSizing: 'border-box',
|
|
|
|
display: 'flex',
|
|
|
|
left: 0,
|
|
|
|
|
|
|
|
'&.tile-view-mode': {
|
|
|
|
padding: `${theme.spacing(2)}px`
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
indicatorsTopContainer: {
|
|
|
|
top: 0,
|
|
|
|
justifyContent: 'space-between'
|
|
|
|
},
|
|
|
|
|
|
|
|
indicatorsBottomContainer: {
|
|
|
|
bottom: 0
|
|
|
|
},
|
|
|
|
|
|
|
|
indicatorsBackground: {
|
|
|
|
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
|
|
borderRadius: '4px',
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
maxWidth: '100%',
|
|
|
|
overflow: 'hidden',
|
|
|
|
|
|
|
|
'&:not(:empty)': {
|
|
|
|
padding: '2px'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& > *:not(:last-child)': {
|
|
|
|
marginRight: '4px'
|
|
|
|
},
|
|
|
|
|
2021-12-20 08:46:47 +00:00
|
|
|
'&:not(.top-indicators) > span:last-child': {
|
2021-12-15 13:18:41 +00:00
|
|
|
marginRight: '6px'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
containerBackground: {
|
|
|
|
position: 'absolute',
|
|
|
|
top: 0,
|
|
|
|
left: 0,
|
|
|
|
height: '100%',
|
|
|
|
width: '100%',
|
|
|
|
borderRadius: '4px',
|
|
|
|
backgroundColor: theme.palette.ui02
|
|
|
|
},
|
|
|
|
|
2021-12-20 08:44:22 +00:00
|
|
|
borderIndicator: {
|
|
|
|
position: 'absolute',
|
|
|
|
width: '100%',
|
|
|
|
height: '100%',
|
2022-03-11 13:00:49 +00:00
|
|
|
zIndex: 9,
|
2021-12-20 08:44:22 +00:00
|
|
|
borderRadius: '4px'
|
|
|
|
},
|
|
|
|
|
2022-03-11 13:00:49 +00:00
|
|
|
borderIndicatorOnTop: {
|
|
|
|
zIndex: 11
|
|
|
|
},
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
activeSpeaker: {
|
|
|
|
'& .active-speaker-indicator': {
|
2021-12-20 08:44:22 +00:00
|
|
|
boxShadow: `inset 0px 0px 0px 4px ${theme.palette.link01Active} !important`
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
raisedHand: {
|
|
|
|
'& .raised-hand-border': {
|
|
|
|
boxShadow: `inset 0px 0px 0px 2px ${theme.palette.warning02} !important`
|
2021-12-15 13:18:41 +00:00
|
|
|
}
|
2022-03-11 13:00:49 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
gif: {
|
|
|
|
position: 'absolute',
|
|
|
|
width: '100%',
|
|
|
|
height: '100%',
|
|
|
|
zIndex: 11,
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
overflow: 'hidden',
|
|
|
|
backgroundColor: theme.palette.ui02,
|
|
|
|
|
|
|
|
'& img': {
|
|
|
|
maxWidth: '100%',
|
|
|
|
maxHeight: '100%',
|
|
|
|
objectFit: 'contain',
|
|
|
|
flexGrow: '1'
|
|
|
|
}
|
2021-12-15 13:18:41 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
2020-11-09 20:59:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a thumbnail.
|
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments Component
|
2020-11-09 20:59:13 +00:00
|
|
|
*/
|
|
|
|
class Thumbnail extends Component<Props, State> {
|
2021-06-30 16:12:12 +00:00
|
|
|
/**
|
|
|
|
* The long touch setTimeout handler.
|
|
|
|
*/
|
|
|
|
timeoutHandle: Object;
|
|
|
|
|
2021-10-25 09:16:03 +00:00
|
|
|
/**
|
|
|
|
* Timeout used to detect double tapping.
|
|
|
|
* It is active while user has tapped once.
|
|
|
|
*/
|
|
|
|
_firstTap: ?TimeoutID;
|
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
/**
|
|
|
|
* Initializes a new Thumbnail instance.
|
|
|
|
*
|
|
|
|
* @param {Object} props - The read-only React Component props with which
|
|
|
|
* the new instance is to be initialized.
|
|
|
|
*/
|
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
const state = {
|
|
|
|
canPlayEventReceived: false,
|
2021-11-01 09:39:19 +00:00
|
|
|
displayMode: DISPLAY_VIDEO,
|
2021-12-15 13:18:41 +00:00
|
|
|
popoverVisible: false,
|
|
|
|
isHovered: false
|
2021-01-21 20:46:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
...state,
|
2021-12-15 13:18:41 +00:00
|
|
|
displayMode: computeDisplayModeFromInput(getDisplayModeInput(props, state))
|
2020-11-09 20:59:13 +00:00
|
|
|
};
|
2021-06-30 16:12:12 +00:00
|
|
|
this.timeoutHandle = null;
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2021-10-25 09:16:03 +00:00
|
|
|
this._clearDoubleClickTimeout = this._clearDoubleClickTimeout.bind(this);
|
2021-01-21 20:46:47 +00:00
|
|
|
this._onCanPlay = this._onCanPlay.bind(this);
|
|
|
|
this._onClick = this._onClick.bind(this);
|
|
|
|
this._onMouseEnter = this._onMouseEnter.bind(this);
|
2022-02-02 20:33:30 +00:00
|
|
|
this._onMouseMove = debounce(this._onMouseMove.bind(this), 100, {
|
|
|
|
leading: true,
|
|
|
|
trailing: false
|
|
|
|
});
|
2021-01-21 20:46:47 +00:00
|
|
|
this._onMouseLeave = this._onMouseLeave.bind(this);
|
|
|
|
this._onTestingEvent = this._onTestingEvent.bind(this);
|
2021-06-30 16:12:12 +00:00
|
|
|
this._onTouchStart = this._onTouchStart.bind(this);
|
|
|
|
this._onTouchEnd = this._onTouchEnd.bind(this);
|
|
|
|
this._onTouchMove = this._onTouchMove.bind(this);
|
2021-11-01 09:39:19 +00:00
|
|
|
this._showPopover = this._showPopover.bind(this);
|
|
|
|
this._hidePopover = this._hidePopover.bind(this);
|
2022-03-11 13:00:49 +00:00
|
|
|
this._onGifMouseEnter = this._onGifMouseEnter.bind(this);
|
|
|
|
this._onGifMouseLeave = this._onGifMouseLeave.bind(this);
|
2022-04-26 20:33:50 +00:00
|
|
|
this.handleTrackStreamingStatusChanged = this.handleTrackStreamingStatusChanged.bind(this);
|
2020-11-09 20:59:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-05-25 01:37:08 +00:00
|
|
|
* Starts listening for track streaming status updates after the initial render.
|
2020-11-09 20:59:13 +00:00
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
componentDidMount() {
|
2021-01-21 20:46:47 +00:00
|
|
|
this._onDisplayModeChanged();
|
2022-04-26 20:33:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Listen to track streaming status changed event to keep it updated.
|
|
|
|
// TODO: after converting this component to a react function component,
|
|
|
|
// use a custom hook to update local track streaming status.
|
|
|
|
const { _videoTrack, dispatch, _sourceNameSignalingEnabled } = this.props;
|
|
|
|
|
|
|
|
if (_sourceNameSignalingEnabled && _videoTrack && !_videoTrack.local) {
|
|
|
|
_videoTrack.jitsiTrack.on(JitsiTrackEvents.TRACK_STREAMING_STATUS_CHANGED,
|
|
|
|
this.handleTrackStreamingStatusChanged);
|
|
|
|
dispatch(trackStreamingStatusChanged(_videoTrack.jitsiTrack,
|
|
|
|
_videoTrack.jitsiTrack.getTrackStreamingStatus()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove listeners for track streaming status update.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
componentWillUnmount() {
|
|
|
|
// TODO: after converting this component to a react function component,
|
|
|
|
// use a custom hook to update local track streaming status.
|
|
|
|
const { _videoTrack, dispatch, _sourceNameSignalingEnabled } = this.props;
|
|
|
|
|
|
|
|
if (_sourceNameSignalingEnabled && _videoTrack && !_videoTrack.local) {
|
|
|
|
_videoTrack.jitsiTrack.off(JitsiTrackEvents.TRACK_STREAMING_STATUS_CHANGED,
|
|
|
|
this.handleTrackStreamingStatusChanged);
|
|
|
|
dispatch(trackStreamingStatusChanged(_videoTrack.jitsiTrack,
|
|
|
|
_videoTrack.jitsiTrack.getTrackStreamingStatus()));
|
|
|
|
}
|
2020-11-09 20:59:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-05-25 01:37:08 +00:00
|
|
|
* Stops listening for track streaming status updates on the old track and starts
|
2020-11-09 20:59:13 +00:00
|
|
|
* listening instead on the new track.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2021-01-21 20:46:47 +00:00
|
|
|
componentDidUpdate(prevProps: Props, prevState: State) {
|
|
|
|
if (prevState.displayMode !== this.state.displayMode) {
|
|
|
|
this._onDisplayModeChanged();
|
|
|
|
}
|
2022-04-26 20:33:50 +00:00
|
|
|
|
|
|
|
// TODO: after converting this component to a react function component,
|
|
|
|
// use a custom hook to update local track streaming status.
|
|
|
|
const { _videoTrack, dispatch, _sourceNameSignalingEnabled } = this.props;
|
|
|
|
|
|
|
|
if (_sourceNameSignalingEnabled
|
|
|
|
&& prevProps._videoTrack?.jitsiTrack?.getSourceName() !== _videoTrack?.jitsiTrack?.getSourceName()) {
|
|
|
|
if (prevProps._videoTrack && !prevProps._videoTrack.local) {
|
|
|
|
prevProps._videoTrack.jitsiTrack.off(JitsiTrackEvents.TRACK_STREAMING_STATUS_CHANGED,
|
|
|
|
this.handleTrackStreamingStatusChanged);
|
|
|
|
dispatch(trackStreamingStatusChanged(prevProps._videoTrack.jitsiTrack,
|
|
|
|
prevProps._videoTrack.jitsiTrack.getTrackStreamingStatus()));
|
|
|
|
}
|
|
|
|
if (_videoTrack && !_videoTrack.local) {
|
|
|
|
_videoTrack.jitsiTrack.on(JitsiTrackEvents.TRACK_STREAMING_STATUS_CHANGED,
|
|
|
|
this.handleTrackStreamingStatusChanged);
|
|
|
|
dispatch(trackStreamingStatusChanged(_videoTrack.jitsiTrack,
|
|
|
|
_videoTrack.jitsiTrack.getTrackStreamingStatus()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle track streaming status change event by
|
|
|
|
* by dispatching an action to update track streaming status for the given track in app state.
|
|
|
|
*
|
|
|
|
* @param {JitsiTrack} jitsiTrack - The track with streaming status updated.
|
|
|
|
* @param {JitsiTrackStreamingStatus} streamingStatus - The updated track streaming status.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
handleTrackStreamingStatusChanged(jitsiTrack, streamingStatus) {
|
|
|
|
this.props.dispatch(trackStreamingStatusChanged(jitsiTrack, streamingStatus));
|
2021-01-21 20:46:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles display mode changes.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onDisplayModeChanged() {
|
2021-12-15 13:18:41 +00:00
|
|
|
const input = getDisplayModeInput(this.props, this.state);
|
2021-01-21 20:46:47 +00:00
|
|
|
|
|
|
|
this._maybeSendScreenSharingIssueEvents(input);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends screen sharing issue event if an issue is detected.
|
|
|
|
*
|
|
|
|
* @param {Object} input - The input used to compute the thumbnail display mode.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_maybeSendScreenSharingIssueEvents(input) {
|
|
|
|
const {
|
|
|
|
_isAudioOnly,
|
2022-04-12 13:19:10 +00:00
|
|
|
_isScreenSharing,
|
|
|
|
_thumbnailType
|
2021-01-21 20:46:47 +00:00
|
|
|
} = this.props;
|
|
|
|
const { displayMode } = this.state;
|
2022-04-12 13:19:10 +00:00
|
|
|
const isTileType = _thumbnailType === THUMBNAIL_TYPE.TILE;
|
2021-01-21 20:46:47 +00:00
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
if (!(DISPLAY_VIDEO === displayMode)
|
2022-04-12 13:19:10 +00:00
|
|
|
&& isTileType
|
2021-01-21 20:46:47 +00:00
|
|
|
&& _isScreenSharing
|
|
|
|
&& !_isAudioOnly) {
|
|
|
|
sendAnalytics(createScreenSharingIssueEvent({
|
|
|
|
source: 'thumbnail',
|
|
|
|
...input
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#getDerivedStateFromProps()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
static getDerivedStateFromProps(props: Props, prevState: State) {
|
|
|
|
if (!props._videoTrack && prevState.canPlayEventReceived) {
|
|
|
|
const newState = {
|
|
|
|
...prevState,
|
|
|
|
canPlayEventReceived: false
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
...newState,
|
2021-12-15 13:18:41 +00:00
|
|
|
displayMode: computeDisplayModeFromInput(getDisplayModeInput(props, newState))
|
2021-01-21 20:46:47 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
const newDisplayMode = computeDisplayModeFromInput(getDisplayModeInput(props, prevState));
|
2021-01-21 20:46:47 +00:00
|
|
|
|
|
|
|
if (newDisplayMode !== prevState.displayMode) {
|
|
|
|
return {
|
|
|
|
...prevState,
|
|
|
|
displayMode: newDisplayMode
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2021-11-04 21:10:43 +00:00
|
|
|
_clearDoubleClickTimeout: () => void;
|
2021-10-25 09:16:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the first click timeout.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_clearDoubleClickTimeout() {
|
|
|
|
clearTimeout(this._firstTap);
|
|
|
|
this._firstTap = undefined;
|
|
|
|
}
|
|
|
|
|
2021-11-01 09:39:19 +00:00
|
|
|
_showPopover: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows popover.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_showPopover() {
|
|
|
|
this.setState({
|
|
|
|
popoverVisible: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
_hidePopover: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hides popover.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_hidePopover() {
|
2022-04-12 13:19:10 +00:00
|
|
|
const { _thumbnailType } = this.props;
|
2022-03-29 08:45:09 +00:00
|
|
|
|
2022-04-12 13:19:10 +00:00
|
|
|
if (_thumbnailType === THUMBNAIL_TYPE.VERTICAL) {
|
2022-03-29 08:45:09 +00:00
|
|
|
this.setState({
|
|
|
|
isHovered: false
|
|
|
|
});
|
|
|
|
}
|
2021-11-01 09:39:19 +00:00
|
|
|
this.setState({
|
|
|
|
popoverVisible: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
/**
|
|
|
|
* Returns an object with the styles for thumbnail.
|
|
|
|
*
|
|
|
|
* @returns {Object} - The styles for the thumbnail.
|
|
|
|
*/
|
|
|
|
_getStyles(): Object {
|
2021-10-26 08:46:01 +00:00
|
|
|
const { canPlayEventReceived } = this.state;
|
|
|
|
const {
|
2021-12-01 10:40:40 +00:00
|
|
|
_disableTileEnlargement,
|
2021-10-26 08:46:01 +00:00
|
|
|
_height,
|
2022-04-29 14:32:16 +00:00
|
|
|
_isVirtualScreenshareParticipant,
|
2021-10-26 08:46:01 +00:00
|
|
|
_isHidden,
|
|
|
|
_isScreenSharing,
|
|
|
|
_participant,
|
2022-04-12 13:19:10 +00:00
|
|
|
_thumbnailType,
|
2022-03-02 12:39:50 +00:00
|
|
|
_videoObjectPosition,
|
2021-12-20 09:32:31 +00:00
|
|
|
_videoTrack,
|
2021-10-26 08:46:01 +00:00
|
|
|
_width,
|
|
|
|
horizontalOffset,
|
|
|
|
style
|
|
|
|
} = this.props;
|
|
|
|
|
2022-04-12 13:19:10 +00:00
|
|
|
const isTileType = _thumbnailType === THUMBNAIL_TYPE.TILE;
|
2021-12-20 09:32:31 +00:00
|
|
|
const jitsiVideoTrack = _videoTrack?.jitsiTrack;
|
|
|
|
const track = jitsiVideoTrack?.track;
|
|
|
|
const isPortraitVideo = ((track && track.getSettings()?.aspectRatio) || 1) < 1;
|
2021-11-24 03:26:22 +00:00
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
let styles: {
|
2021-10-26 08:46:01 +00:00
|
|
|
avatar: Object,
|
2021-01-21 20:46:47 +00:00
|
|
|
thumbnail: Object,
|
2021-10-26 08:46:01 +00:00
|
|
|
video: Object
|
2021-01-21 20:46:47 +00:00
|
|
|
} = {
|
|
|
|
thumbnail: {},
|
2021-10-26 08:46:01 +00:00
|
|
|
avatar: {},
|
|
|
|
video: {}
|
2021-01-21 20:46:47 +00:00
|
|
|
};
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
const avatarSize = Math.min(_height / 2, _width - 30);
|
2021-03-26 20:23:05 +00:00
|
|
|
let { left } = style || {};
|
|
|
|
|
|
|
|
if (typeof left === 'number' && horizontalOffset) {
|
|
|
|
left += horizontalOffset;
|
2020-11-09 20:59:13 +00:00
|
|
|
}
|
|
|
|
|
2021-10-26 08:46:01 +00:00
|
|
|
let videoStyles = null;
|
2022-04-12 13:19:10 +00:00
|
|
|
const doNotStretchVideo = (isPortraitVideo && isTileType)
|
2021-12-16 13:33:30 +00:00
|
|
|
|| _disableTileEnlargement
|
|
|
|
|| _isScreenSharing;
|
2021-10-26 08:46:01 +00:00
|
|
|
|
2022-04-29 14:32:16 +00:00
|
|
|
if (canPlayEventReceived || _participant.local || _isVirtualScreenshareParticipant) {
|
2021-12-16 13:33:30 +00:00
|
|
|
videoStyles = {
|
|
|
|
objectFit: doNotStretchVideo ? 'contain' : 'cover'
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
videoStyles = {
|
|
|
|
display: 'none'
|
|
|
|
};
|
2021-10-26 08:46:01 +00:00
|
|
|
}
|
|
|
|
|
2022-03-02 12:39:50 +00:00
|
|
|
if (videoStyles.objectFit === 'cover') {
|
|
|
|
videoStyles.objectPosition = _videoObjectPosition;
|
|
|
|
}
|
|
|
|
|
2021-03-26 20:23:05 +00:00
|
|
|
styles = {
|
|
|
|
thumbnail: {
|
|
|
|
...style,
|
|
|
|
left,
|
|
|
|
height: `${_height}px`,
|
|
|
|
minHeight: `${_height}px`,
|
|
|
|
minWidth: `${_width}px`,
|
|
|
|
width: `${_width}px`
|
|
|
|
},
|
|
|
|
avatar: {
|
|
|
|
height: `${avatarSize}px`,
|
|
|
|
width: `${avatarSize}px`
|
2021-10-26 08:46:01 +00:00
|
|
|
},
|
|
|
|
video: videoStyles
|
2021-03-26 20:23:05 +00:00
|
|
|
};
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
if (_isHidden) {
|
|
|
|
styles.thumbnail.display = 'none';
|
|
|
|
}
|
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
return styles;
|
|
|
|
}
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
_onClick: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* On click handler.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onClick() {
|
2022-04-12 13:19:10 +00:00
|
|
|
const { _participant, dispatch, _stageFilmstripLayout } = this.props;
|
2021-01-21 20:46:47 +00:00
|
|
|
const { id, pinned } = _participant;
|
|
|
|
|
2022-04-12 13:19:10 +00:00
|
|
|
if (_stageFilmstripLayout) {
|
2022-04-12 06:57:01 +00:00
|
|
|
dispatch(togglePinStageParticipant(id));
|
2022-04-12 13:19:10 +00:00
|
|
|
} else {
|
|
|
|
dispatch(pinParticipant(pinned ? null : id));
|
2022-03-29 08:45:09 +00:00
|
|
|
}
|
2021-01-21 20:46:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_onMouseEnter: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mouse enter handler.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onMouseEnter() {
|
|
|
|
this.setState({ isHovered: true });
|
|
|
|
}
|
|
|
|
|
2022-02-02 20:33:30 +00:00
|
|
|
/**
|
|
|
|
* Mouse move handler.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onMouseMove() {
|
|
|
|
if (!this.state.isHovered) {
|
|
|
|
// Workaround for the use case where the layout changes (for example the participant pane is closed)
|
|
|
|
// and as a result the mouse appears on top of the thumbnail. In these use cases the mouse enter
|
|
|
|
// event on the thumbnail is not triggered in Chrome.
|
|
|
|
this.setState({ isHovered: true });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
_onMouseLeave: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mouse leave handler.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onMouseLeave() {
|
|
|
|
this.setState({ isHovered: false });
|
|
|
|
}
|
|
|
|
|
2021-06-30 16:12:12 +00:00
|
|
|
_onTouchStart: () => void;
|
|
|
|
|
|
|
|
/**
|
2021-10-25 09:16:03 +00:00
|
|
|
* Handler for touch start.
|
2021-06-30 16:12:12 +00:00
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onTouchStart() {
|
2021-11-01 09:39:19 +00:00
|
|
|
this.timeoutHandle = setTimeout(this._showPopover, SHOW_TOOLBAR_CONTEXT_MENU_AFTER);
|
2021-10-25 09:16:03 +00:00
|
|
|
|
|
|
|
if (this._firstTap) {
|
|
|
|
this._clearDoubleClickTimeout();
|
|
|
|
this._onClick();
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this._firstTap = setTimeout(this._clearDoubleClickTimeout, 300);
|
2021-06-30 16:12:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_onTouchEnd: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancel showing popover context menu after x miliseconds if the no. Of miliseconds is not reached yet,
|
|
|
|
* or just clears the timeout.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onTouchEnd() {
|
|
|
|
clearTimeout(this.timeoutHandle);
|
|
|
|
}
|
|
|
|
|
|
|
|
_onTouchMove: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancel showing Context menu after x miliseconds if the number of miliseconds is not reached
|
|
|
|
* before a touch move(drag), or just clears the timeout.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onTouchMove() {
|
|
|
|
clearTimeout(this.timeoutHandle);
|
|
|
|
}
|
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
/**
|
|
|
|
* Renders a fake participant (youtube video) thumbnail.
|
|
|
|
*
|
|
|
|
* @param {string} id - The id of the participant.
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
_renderFakeParticipant() {
|
2021-07-20 08:30:12 +00:00
|
|
|
const { _isMobile, _participant: { avatarURL } } = this.props;
|
2021-01-21 20:46:47 +00:00
|
|
|
const styles = this._getStyles();
|
|
|
|
const containerClassName = this._getContainerClassName();
|
2020-11-09 20:59:13 +00:00
|
|
|
|
|
|
|
return (
|
2021-01-21 20:46:47 +00:00
|
|
|
<span
|
|
|
|
className = { containerClassName }
|
|
|
|
id = 'sharedVideoContainer'
|
|
|
|
onClick = { this._onClick }
|
2021-07-20 08:30:12 +00:00
|
|
|
{ ...(_isMobile ? {} : {
|
|
|
|
onMouseEnter: this._onMouseEnter,
|
2022-02-02 20:33:30 +00:00
|
|
|
onMouseMove: this._onMouseMove,
|
2021-07-20 08:30:12 +00:00
|
|
|
onMouseLeave: this._onMouseLeave
|
|
|
|
}) }
|
2021-01-21 20:46:47 +00:00
|
|
|
style = { styles.thumbnail }>
|
2021-04-16 09:43:34 +00:00
|
|
|
{avatarURL ? (
|
|
|
|
<img
|
|
|
|
className = 'sharedVideoAvatar'
|
|
|
|
src = { avatarURL } />
|
|
|
|
)
|
|
|
|
: this._renderAvatar(styles.avatar)}
|
2021-01-21 20:46:47 +00:00
|
|
|
</span>
|
2020-11-09 20:59:13 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the avatar.
|
|
|
|
*
|
2021-01-21 20:46:47 +00:00
|
|
|
* @param {Object} styles - The styles that will be applied to the avatar.
|
2020-11-09 20:59:13 +00:00
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
2021-01-21 20:46:47 +00:00
|
|
|
_renderAvatar(styles) {
|
2020-11-09 20:59:13 +00:00
|
|
|
const { _participant } = this.props;
|
|
|
|
const { id } = _participant;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className = 'avatar-container'
|
2021-01-21 20:46:47 +00:00
|
|
|
style = { styles }>
|
2020-11-09 20:59:13 +00:00
|
|
|
<Avatar
|
|
|
|
className = 'userAvatar'
|
|
|
|
participantId = { id } />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
/**
|
|
|
|
* Returns the container class name.
|
|
|
|
*
|
|
|
|
* @returns {string} - The class name that will be used for the container.
|
|
|
|
*/
|
|
|
|
_getContainerClassName() {
|
|
|
|
let className = 'videocontainer';
|
|
|
|
const { displayMode } = this.state;
|
2020-11-09 20:59:13 +00:00
|
|
|
const {
|
2021-12-15 13:18:41 +00:00
|
|
|
_isDominantSpeakerDisabled,
|
2020-11-09 20:59:13 +00:00
|
|
|
_participant,
|
2021-12-20 08:44:22 +00:00
|
|
|
_raisedHand,
|
2022-04-12 13:19:10 +00:00
|
|
|
_thumbnailType,
|
2021-12-15 13:18:41 +00:00
|
|
|
classes
|
2020-11-09 20:59:13 +00:00
|
|
|
} = this.props;
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
className += ` ${DISPLAY_MODE_TO_CLASS_NAME[displayMode]}`;
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2021-12-20 08:44:22 +00:00
|
|
|
if (_raisedHand) {
|
|
|
|
className += ` ${classes.raisedHand}`;
|
|
|
|
}
|
|
|
|
|
2022-03-29 08:45:09 +00:00
|
|
|
if (!_isDominantSpeakerDisabled && _participant?.dominantSpeaker) {
|
2021-12-15 13:18:41 +00:00
|
|
|
className += ` ${classes.activeSpeaker} dominant-speaker`;
|
|
|
|
}
|
2022-04-12 13:19:10 +00:00
|
|
|
if (_thumbnailType !== THUMBNAIL_TYPE.TILE && _participant?.pinned) {
|
2022-03-29 08:45:09 +00:00
|
|
|
className += ' videoContainerFocused';
|
|
|
|
}
|
2021-06-30 16:12:12 +00:00
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
return className;
|
2020-11-09 20:59:13 +00:00
|
|
|
}
|
|
|
|
|
2022-03-11 13:00:49 +00:00
|
|
|
_onGifMouseEnter: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Keep showing the GIF for the current participant.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onGifMouseEnter() {
|
|
|
|
const { dispatch, _participant: { id } } = this.props;
|
|
|
|
|
|
|
|
dispatch(showGif(id));
|
|
|
|
}
|
|
|
|
|
|
|
|
_onGifMouseLeave: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Keep showing the GIF for the current participant.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onGifMouseLeave() {
|
|
|
|
const { dispatch, _participant: { id } } = this.props;
|
|
|
|
|
|
|
|
dispatch(hideGif(id));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders GIF.
|
|
|
|
*
|
|
|
|
* @returns {Component}
|
|
|
|
*/
|
|
|
|
_renderGif() {
|
|
|
|
const { _gifSrc, classes } = this.props;
|
|
|
|
|
|
|
|
return _gifSrc && (
|
2022-03-30 13:08:19 +00:00
|
|
|
<div className = { classes.gif }>
|
2022-03-11 13:00:49 +00:00
|
|
|
<img
|
|
|
|
alt = 'GIF'
|
|
|
|
src = { _gifSrc } />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-01-21 20:46:47 +00:00
|
|
|
_onCanPlay: Object => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Canplay event listener.
|
|
|
|
*
|
|
|
|
* @param {SyntheticEvent} event - The event.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onCanPlay(event) {
|
|
|
|
this.setState({ canPlayEventReceived: true });
|
|
|
|
|
|
|
|
const {
|
|
|
|
_isTestModeEnabled,
|
|
|
|
_videoTrack
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
if (_videoTrack && _isTestModeEnabled) {
|
|
|
|
this._onTestingEvent(event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_onTestingEvent: Object => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event handler for testing events.
|
|
|
|
*
|
|
|
|
* @param {SyntheticEvent} event - The event.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onTestingEvent(event) {
|
|
|
|
const {
|
|
|
|
_videoTrack,
|
|
|
|
dispatch
|
|
|
|
} = this.props;
|
|
|
|
const jitsiVideoTrack = _videoTrack?.jitsiTrack;
|
|
|
|
|
|
|
|
dispatch(updateLastTrackVideoMediaEvent(jitsiVideoTrack, event.type));
|
|
|
|
}
|
2020-11-09 20:59:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders a remote participant's 'thumbnail.
|
|
|
|
*
|
2021-12-15 13:18:41 +00:00
|
|
|
* @param {boolean} local - Whether or not it's the local participant.
|
2020-11-09 20:59:13 +00:00
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
2021-12-15 13:18:41 +00:00
|
|
|
_renderParticipant(local = false) {
|
2020-11-09 20:59:13 +00:00
|
|
|
const {
|
2021-12-15 13:18:41 +00:00
|
|
|
_audioTrack,
|
|
|
|
_disableLocalVideoFlip,
|
2022-04-12 13:19:10 +00:00
|
|
|
_gifSrc,
|
2021-07-20 08:30:12 +00:00
|
|
|
_isMobile,
|
2021-12-15 13:18:41 +00:00
|
|
|
_isMobilePortrait,
|
|
|
|
_isScreenSharing,
|
2021-01-21 20:46:47 +00:00
|
|
|
_isTestModeEnabled,
|
2021-12-15 13:18:41 +00:00
|
|
|
_localFlipX,
|
2020-11-09 20:59:13 +00:00
|
|
|
_participant,
|
2022-04-12 13:19:10 +00:00
|
|
|
_thumbnailType,
|
2021-03-26 20:23:05 +00:00
|
|
|
_videoTrack,
|
2022-03-11 13:00:49 +00:00
|
|
|
classes,
|
2022-03-29 08:45:09 +00:00
|
|
|
stageFilmstrip
|
2020-11-09 20:59:13 +00:00
|
|
|
} = this.props;
|
2021-12-15 13:18:41 +00:00
|
|
|
const { id } = _participant || {};
|
|
|
|
const { isHovered, popoverVisible } = this.state;
|
2021-01-21 20:46:47 +00:00
|
|
|
const styles = this._getStyles();
|
2021-12-15 13:18:41 +00:00
|
|
|
let containerClassName = this._getContainerClassName();
|
|
|
|
const videoTrackClassName
|
|
|
|
= !_disableLocalVideoFlip && _videoTrack && !_isScreenSharing && _localFlipX ? 'flipVideoX' : '';
|
2021-01-21 20:46:47 +00:00
|
|
|
const jitsiVideoTrack = _videoTrack?.jitsiTrack;
|
|
|
|
const videoTrackId = jitsiVideoTrack && jitsiVideoTrack.getId();
|
|
|
|
const videoEventListeners = {};
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
if (local) {
|
|
|
|
if (_isMobilePortrait) {
|
|
|
|
styles.thumbnail.height = styles.thumbnail.width;
|
|
|
|
containerClassName = `${containerClassName} self-view-mobile-portrait`;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (_videoTrack && _isTestModeEnabled) {
|
|
|
|
VIDEO_TEST_EVENTS.forEach(attribute => {
|
|
|
|
videoEventListeners[attribute] = this._onTestingEvent;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
videoEventListeners.onCanPlay = this._onCanPlay;
|
2021-01-21 20:46:47 +00:00
|
|
|
}
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
const video = _videoTrack && <VideoTrack
|
|
|
|
className = { local ? videoTrackClassName : '' }
|
|
|
|
eventHandlers = { videoEventListeners }
|
|
|
|
id = { local ? 'localVideo_container' : `remoteVideo_${videoTrackId || ''}` }
|
|
|
|
muted = { local ? undefined : true }
|
|
|
|
style = { styles.video }
|
|
|
|
videoTrack = { _videoTrack } />;
|
2021-01-21 20:46:47 +00:00
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
return (
|
2021-01-21 20:46:47 +00:00
|
|
|
<span
|
|
|
|
className = { containerClassName }
|
2022-03-29 08:45:09 +00:00
|
|
|
id = { local
|
|
|
|
? `localVideoContainer${stageFilmstrip ? '_stage' : ''}`
|
|
|
|
: `participant_${id}${stageFilmstrip ? '_stage' : ''}`
|
|
|
|
}
|
2021-07-20 08:30:12 +00:00
|
|
|
{ ...(_isMobile
|
|
|
|
? {
|
|
|
|
onTouchEnd: this._onTouchEnd,
|
|
|
|
onTouchMove: this._onTouchMove,
|
|
|
|
onTouchStart: this._onTouchStart
|
|
|
|
}
|
|
|
|
: {
|
2021-10-25 11:19:13 +00:00
|
|
|
onClick: this._onClick,
|
2021-07-20 08:30:12 +00:00
|
|
|
onMouseEnter: this._onMouseEnter,
|
2022-02-02 20:33:30 +00:00
|
|
|
onMouseMove: this._onMouseMove,
|
2021-07-20 08:30:12 +00:00
|
|
|
onMouseLeave: this._onMouseLeave
|
|
|
|
}
|
|
|
|
) }
|
2021-01-21 20:46:47 +00:00
|
|
|
style = { styles.thumbnail }>
|
2022-03-11 13:00:49 +00:00
|
|
|
{!_gifSrc && (local
|
2021-12-15 13:18:41 +00:00
|
|
|
? <span id = 'localVideoWrapper'>{video}</span>
|
2022-03-11 13:00:49 +00:00
|
|
|
: video)}
|
2021-12-15 13:18:41 +00:00
|
|
|
<div className = { classes.containerBackground } />
|
|
|
|
<div
|
|
|
|
className = { clsx(classes.indicatorsContainer,
|
|
|
|
classes.indicatorsTopContainer,
|
2022-04-12 13:19:10 +00:00
|
|
|
_thumbnailType === THUMBNAIL_TYPE.TILE && 'tile-view-mode'
|
2021-12-15 13:18:41 +00:00
|
|
|
) }>
|
|
|
|
<ThumbnailTopIndicators
|
|
|
|
hidePopover = { this._hidePopover }
|
|
|
|
indicatorsClassName = { classes.indicatorsBackground }
|
|
|
|
isHovered = { isHovered }
|
|
|
|
local = { local }
|
|
|
|
participantId = { id }
|
|
|
|
popoverVisible = { popoverVisible }
|
2022-04-12 13:19:10 +00:00
|
|
|
showPopover = { this._showPopover }
|
|
|
|
thumbnailType = { _thumbnailType } />
|
2020-11-09 20:59:13 +00:00
|
|
|
</div>
|
2021-12-15 13:18:41 +00:00
|
|
|
<div
|
|
|
|
className = { clsx(classes.indicatorsContainer,
|
|
|
|
classes.indicatorsBottomContainer,
|
2022-04-12 13:19:10 +00:00
|
|
|
_thumbnailType === THUMBNAIL_TYPE.TILE && 'tile-view-mode'
|
2021-12-15 13:18:41 +00:00
|
|
|
) }>
|
|
|
|
<ThumbnailBottomIndicators
|
|
|
|
className = { classes.indicatorsBackground }
|
2022-05-12 22:47:38 +00:00
|
|
|
isVirtualScreenshareParticipant = { false }
|
2021-12-15 13:18:41 +00:00
|
|
|
local = { local }
|
2022-04-12 13:19:10 +00:00
|
|
|
participantId = { id }
|
|
|
|
thumbnailType = { _thumbnailType } />
|
2020-11-09 20:59:13 +00:00
|
|
|
</div>
|
2022-03-11 13:00:49 +00:00
|
|
|
{!_gifSrc && this._renderAvatar(styles.avatar) }
|
2021-12-15 13:18:41 +00:00
|
|
|
{ !local && (
|
|
|
|
<div className = 'presence-label-container'>
|
|
|
|
<PresenceLabel
|
|
|
|
className = 'presence-label'
|
|
|
|
participantID = { id } />
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
<ThumbnailAudioIndicator _audioTrack = { _audioTrack } />
|
2022-03-11 13:00:49 +00:00
|
|
|
{this._renderGif()}
|
|
|
|
<div
|
|
|
|
className = { clsx(classes.borderIndicator,
|
|
|
|
_gifSrc && classes.borderIndicatorOnTop,
|
|
|
|
'raised-hand-border') } />
|
|
|
|
<div
|
|
|
|
className = { clsx(classes.borderIndicator,
|
|
|
|
_gifSrc && classes.borderIndicatorOnTop,
|
|
|
|
'active-speaker-indicator') } />
|
2022-03-30 13:08:19 +00:00
|
|
|
{_gifSrc && (
|
|
|
|
<div
|
|
|
|
className = { clsx(classes.borderIndicator, classes.borderIndicatorOnTop) }
|
|
|
|
onMouseEnter = { this._onGifMouseEnter }
|
|
|
|
onMouseLeave = { this._onGifMouseLeave } />
|
|
|
|
)}
|
2021-01-21 20:46:47 +00:00
|
|
|
</span>
|
2020-11-09 20:59:13 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
2022-04-29 14:32:16 +00:00
|
|
|
const { _participant, _isVirtualScreenshareParticipant } = this.props;
|
2020-11-09 20:59:13 +00:00
|
|
|
|
|
|
|
if (!_participant) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2021-01-06 23:09:31 +00:00
|
|
|
const { isFakeParticipant, local } = _participant;
|
2020-11-09 20:59:13 +00:00
|
|
|
|
|
|
|
if (local) {
|
2021-12-15 13:18:41 +00:00
|
|
|
return this._renderParticipant(true);
|
2020-11-09 20:59:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (isFakeParticipant) {
|
|
|
|
return this._renderFakeParticipant();
|
|
|
|
}
|
|
|
|
|
2022-04-29 14:32:16 +00:00
|
|
|
if (_isVirtualScreenshareParticipant) {
|
2022-04-04 18:57:58 +00:00
|
|
|
const { isHovered } = this.state;
|
2022-04-28 22:25:45 +00:00
|
|
|
const { _videoTrack, _isMobile, classes, _thumbnailType } = this.props;
|
2022-04-04 18:57:58 +00:00
|
|
|
|
|
|
|
return (
|
2022-04-29 14:32:16 +00:00
|
|
|
<VirtualScreenshareParticipant
|
2022-04-04 18:57:58 +00:00
|
|
|
classes = { classes }
|
|
|
|
containerClassName = { this._getContainerClassName() }
|
|
|
|
isHovered = { isHovered }
|
2022-05-12 22:47:38 +00:00
|
|
|
isLocal = { local }
|
2022-04-04 18:57:58 +00:00
|
|
|
isMobile = { _isMobile }
|
|
|
|
onClick = { this._onClick }
|
|
|
|
onMouseEnter = { this._onMouseEnter }
|
|
|
|
onMouseLeave = { this._onMouseLeave }
|
|
|
|
onMouseMove = { this._onMouseMove }
|
|
|
|
onTouchEnd = { this._onTouchEnd }
|
|
|
|
onTouchMove = { this._onTouchMove }
|
|
|
|
onTouchStart = { this._onTouchStart }
|
|
|
|
participantId = { _participant.id }
|
|
|
|
styles = { this._getStyles() }
|
2022-04-28 22:25:45 +00:00
|
|
|
thumbnailType = { _thumbnailType }
|
2022-04-04 18:57:58 +00:00
|
|
|
videoTrack = { _videoTrack } />
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
return this._renderParticipant();
|
2020-11-09 20:59:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the redux state to the associated props for this component.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
|
|
|
* @param {Object} ownProps - The own props of the component.
|
|
|
|
* @private
|
|
|
|
* @returns {Props}
|
|
|
|
*/
|
|
|
|
function _mapStateToProps(state, ownProps): Object {
|
2022-03-29 08:45:09 +00:00
|
|
|
const { participantID, stageFilmstrip } = ownProps;
|
2020-11-09 20:59:13 +00:00
|
|
|
|
2021-07-09 12:36:19 +00:00
|
|
|
const participant = getParticipantByIdOrUndefined(state, participantID);
|
|
|
|
const id = participant?.id;
|
2020-11-09 20:59:13 +00:00
|
|
|
const isLocal = participant?.local ?? true;
|
2021-01-21 20:46:47 +00:00
|
|
|
const tracks = state['features/base/tracks'];
|
2022-04-04 18:57:58 +00:00
|
|
|
const sourceNameSignalingEnabled = getSourceNameSignalingFeatureFlag(state);
|
|
|
|
|
|
|
|
let _videoTrack;
|
|
|
|
|
2022-04-29 14:32:16 +00:00
|
|
|
if (sourceNameSignalingEnabled && participant?.isVirtualScreenshareParticipant) {
|
|
|
|
_videoTrack = getVirtualScreenshareParticipantTrack(tracks, id);
|
2022-04-04 18:57:58 +00:00
|
|
|
} else {
|
|
|
|
_videoTrack = isLocal
|
|
|
|
? getLocalVideoTrack(tracks) : getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, participantID);
|
|
|
|
}
|
2020-11-09 20:59:13 +00:00
|
|
|
const _audioTrack = isLocal
|
2021-01-21 20:46:47 +00:00
|
|
|
? getLocalAudioTrack(tracks) : getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.AUDIO, participantID);
|
2022-04-12 13:19:10 +00:00
|
|
|
const _currentLayout = getCurrentLayout(state);
|
2020-11-09 20:59:13 +00:00
|
|
|
let size = {};
|
2021-09-09 13:14:09 +00:00
|
|
|
let _isMobilePortrait = false;
|
2021-01-21 20:46:47 +00:00
|
|
|
const {
|
2021-11-26 15:39:34 +00:00
|
|
|
defaultLocalDisplayName,
|
2021-01-21 20:46:47 +00:00
|
|
|
disableLocalVideoFlip,
|
2021-12-01 10:40:40 +00:00
|
|
|
disableTileEnlargement,
|
2021-01-21 20:46:47 +00:00
|
|
|
iAmRecorder,
|
|
|
|
iAmSipGateway
|
|
|
|
} = state['features/base/config'];
|
|
|
|
const { localFlipX } = state['features/base/settings'];
|
2021-07-20 08:30:12 +00:00
|
|
|
const _isMobile = isMobileBrowser();
|
2022-03-29 08:45:09 +00:00
|
|
|
const activeParticipants = getActiveParticipantsIds(state);
|
2022-04-12 13:19:10 +00:00
|
|
|
const tileType = getThumbnailTypeFromLayout(_currentLayout, stageFilmstrip);
|
|
|
|
|
|
|
|
switch (tileType) {
|
|
|
|
case THUMBNAIL_TYPE.VERTICAL:
|
|
|
|
case THUMBNAIL_TYPE.HORIZONTAL: {
|
2020-11-09 20:59:13 +00:00
|
|
|
const {
|
|
|
|
horizontalViewDimensions = {
|
|
|
|
local: {},
|
|
|
|
remote: {}
|
2021-03-26 20:23:05 +00:00
|
|
|
},
|
|
|
|
verticalViewDimensions = {
|
|
|
|
local: {},
|
2022-02-24 12:20:37 +00:00
|
|
|
remote: {},
|
|
|
|
gridView: {}
|
2020-11-09 20:59:13 +00:00
|
|
|
}
|
|
|
|
} = state['features/filmstrip'];
|
2022-02-24 12:20:37 +00:00
|
|
|
const _verticalViewGrid = showGridInVerticalView(state);
|
2021-03-26 20:23:05 +00:00
|
|
|
const { local, remote }
|
2022-04-12 13:19:10 +00:00
|
|
|
= tileType === THUMBNAIL_TYPE.VERTICAL
|
2021-03-26 20:23:05 +00:00
|
|
|
? verticalViewDimensions : horizontalViewDimensions;
|
2022-02-24 12:20:37 +00:00
|
|
|
const { width, height } = (isLocal ? local : remote) ?? {};
|
2020-11-09 20:59:13 +00:00
|
|
|
|
|
|
|
size = {
|
|
|
|
_width: width,
|
|
|
|
_height: height
|
|
|
|
};
|
|
|
|
|
2022-02-24 12:20:37 +00:00
|
|
|
if (_verticalViewGrid) {
|
|
|
|
const { width: _width, height: _height } = verticalViewDimensions.gridView.thumbnailSize;
|
|
|
|
|
|
|
|
size = {
|
|
|
|
_width,
|
|
|
|
_height
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-09-09 13:14:09 +00:00
|
|
|
_isMobilePortrait = _isMobile && state['features/base/responsive-ui'].aspectRatio === ASPECT_RATIO_NARROW;
|
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-04-12 13:19:10 +00:00
|
|
|
case THUMBNAIL_TYPE.TILE: {
|
2022-03-29 08:45:09 +00:00
|
|
|
const { thumbnailSize } = state['features/filmstrip'].tileViewDimensions;
|
|
|
|
const {
|
|
|
|
stageFilmstripDimensions = {
|
|
|
|
thumbnailSize: {}
|
|
|
|
}
|
|
|
|
} = state['features/filmstrip'];
|
2020-11-09 20:59:13 +00:00
|
|
|
|
|
|
|
size = {
|
2022-03-29 08:45:09 +00:00
|
|
|
_width: thumbnailSize?.width,
|
|
|
|
_height: thumbnailSize?.height
|
2020-11-09 20:59:13 +00:00
|
|
|
};
|
2022-03-29 08:45:09 +00:00
|
|
|
|
|
|
|
if (stageFilmstrip) {
|
|
|
|
const { width: _width, height: _height } = stageFilmstripDimensions.thumbnailSize;
|
|
|
|
|
|
|
|
size = {
|
|
|
|
_width,
|
|
|
|
_height
|
|
|
|
};
|
|
|
|
}
|
2020-11-09 20:59:13 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-03 21:55:33 +00:00
|
|
|
if (ownProps.width) {
|
|
|
|
size._width = ownProps.width;
|
|
|
|
}
|
|
|
|
|
2022-03-11 13:00:49 +00:00
|
|
|
const { gifUrl: gifSrc } = getGifForParticipant(state, id);
|
|
|
|
const mode = getGifDisplayMode(state);
|
2022-04-12 06:57:01 +00:00
|
|
|
const participantId = isLocal ? getLocalParticipant(state).id : participantID;
|
2022-03-11 13:00:49 +00:00
|
|
|
|
2020-11-09 20:59:13 +00:00
|
|
|
return {
|
|
|
|
_audioTrack,
|
2022-04-29 14:32:16 +00:00
|
|
|
_currentLayout,
|
2021-11-26 15:39:34 +00:00
|
|
|
_defaultLocalDisplayName: defaultLocalDisplayName,
|
2021-01-21 20:46:47 +00:00
|
|
|
_disableLocalVideoFlip: Boolean(disableLocalVideoFlip),
|
2021-12-01 10:40:40 +00:00
|
|
|
_disableTileEnlargement: Boolean(disableTileEnlargement),
|
2022-04-12 06:57:01 +00:00
|
|
|
_isActiveParticipant: activeParticipants.find(pId => pId === participantId),
|
2021-01-21 20:46:47 +00:00
|
|
|
_isHidden: isLocal && iAmRecorder && !iAmSipGateway,
|
|
|
|
_isAudioOnly: Boolean(state['features/base/audio-only'].enabled),
|
|
|
|
_isCurrentlyOnLargeVideo: state['features/large-video']?.participantId === id,
|
2020-11-09 20:59:13 +00:00
|
|
|
_isDominantSpeakerDisabled: interfaceConfig.DISABLE_DOMINANT_SPEAKER_INDICATOR,
|
2021-07-20 08:30:12 +00:00
|
|
|
_isMobile,
|
2021-09-09 13:14:09 +00:00
|
|
|
_isMobilePortrait,
|
2021-01-21 20:46:47 +00:00
|
|
|
_isScreenSharing: _videoTrack?.videoType === 'desktop',
|
|
|
|
_isTestModeEnabled: isTestModeEnabled(state),
|
2021-07-09 12:36:19 +00:00
|
|
|
_isVideoPlayable: id && isVideoPlayable(state, id),
|
2022-04-29 14:32:16 +00:00
|
|
|
_isVirtualScreenshareParticipant: sourceNameSignalingEnabled && participant?.isVirtualScreenshareParticipant,
|
2021-01-21 20:46:47 +00:00
|
|
|
_localFlipX: Boolean(localFlipX),
|
2022-04-29 14:32:16 +00:00
|
|
|
_multipleVideoSupport: getMultipleVideoSupportFeatureFlag(state),
|
2020-11-09 20:59:13 +00:00
|
|
|
_participant: participant,
|
2021-12-20 08:44:22 +00:00
|
|
|
_raisedHand: hasRaisedHand(participant),
|
2022-04-12 13:19:10 +00:00
|
|
|
_stageFilmstripLayout: isStageFilmstripAvailable(state),
|
|
|
|
_stageParticipantsVisible: _currentLayout === LAYOUTS.STAGE_FILMSTRIP_VIEW,
|
|
|
|
_thumbnailType: tileType,
|
2022-03-04 23:17:46 +00:00
|
|
|
_videoObjectPosition: getVideoObjectPosition(state, participant?.id),
|
2020-11-09 20:59:13 +00:00
|
|
|
_videoTrack,
|
2022-03-11 13:00:49 +00:00
|
|
|
...size,
|
2022-04-26 20:33:50 +00:00
|
|
|
_gifSrc: mode === 'chat' ? null : gifSrc,
|
|
|
|
_sourceNameSignalingEnabled: sourceNameSignalingEnabled
|
2020-11-09 20:59:13 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
export default connect(_mapStateToProps)(withStyles(defaultStyles)(Thumbnail));
|