2022-04-04 18:57:58 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import clsx from 'clsx';
|
|
|
|
import React from 'react';
|
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
|
|
|
|
import { VideoTrack } from '../../../base/media';
|
2022-09-27 07:10:28 +00:00
|
|
|
import { LAYOUTS, getCurrentLayout } from '../../../video-layout';
|
2022-04-04 18:57:58 +00:00
|
|
|
|
|
|
|
import ThumbnailBottomIndicators from './ThumbnailBottomIndicators';
|
|
|
|
import ThumbnailTopIndicators from './ThumbnailTopIndicators';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An object containing the CSS classes.
|
|
|
|
*/
|
|
|
|
classes: Object,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The class name that will be used for the container.
|
|
|
|
*/
|
|
|
|
containerClassName: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether the thumbnail is hovered or not.
|
|
|
|
*/
|
|
|
|
isHovered: boolean,
|
|
|
|
|
2022-05-12 22:47:38 +00:00
|
|
|
/**
|
|
|
|
* Indicates whether the thumbnail is for local screenshare or not.
|
|
|
|
*/
|
|
|
|
isLocal: boolean,
|
|
|
|
|
2022-04-04 18:57:58 +00:00
|
|
|
/**
|
|
|
|
* Indicates whether we are currently running in a mobile browser.
|
|
|
|
*/
|
|
|
|
isMobile: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Click handler.
|
|
|
|
*/
|
|
|
|
onClick: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mouse enter handler.
|
|
|
|
*/
|
|
|
|
onMouseEnter: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mouse leave handler.
|
|
|
|
*/
|
|
|
|
onMouseLeave: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mouse move handler.
|
|
|
|
*/
|
|
|
|
onMouseMove: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Touch end handler.
|
|
|
|
*/
|
|
|
|
onTouchEnd: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Touch move handler.
|
|
|
|
*/
|
|
|
|
onTouchMove: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Touch start handler.
|
|
|
|
*/
|
|
|
|
onTouchStart: Function,
|
|
|
|
|
|
|
|
/**
|
2022-04-29 14:32:16 +00:00
|
|
|
* The ID of the virtual screen share participant.
|
2022-04-04 18:57:58 +00:00
|
|
|
*/
|
|
|
|
participantId: string,
|
|
|
|
|
2022-11-21 09:03:03 +00:00
|
|
|
/**
|
|
|
|
* Whether or not to display a tint background over tile.
|
|
|
|
*/
|
|
|
|
shouldDisplayTintBackground: boolean,
|
|
|
|
|
2022-04-04 18:57:58 +00:00
|
|
|
/**
|
|
|
|
* An object with the styles for thumbnail.
|
|
|
|
*/
|
|
|
|
styles: Object,
|
|
|
|
|
2022-04-28 22:25:45 +00:00
|
|
|
/**
|
|
|
|
* The type of thumbnail.
|
|
|
|
*/
|
|
|
|
thumbnailType: string,
|
|
|
|
|
2022-04-04 18:57:58 +00:00
|
|
|
/**
|
|
|
|
* JitsiTrack instance.
|
|
|
|
*/
|
|
|
|
videoTrack: Object
|
|
|
|
}
|
|
|
|
|
2022-04-29 14:32:16 +00:00
|
|
|
const VirtualScreenshareParticipant = ({
|
2022-04-04 18:57:58 +00:00
|
|
|
classes,
|
|
|
|
containerClassName,
|
|
|
|
isHovered,
|
2022-05-12 22:47:38 +00:00
|
|
|
isLocal,
|
2022-04-04 18:57:58 +00:00
|
|
|
isMobile,
|
|
|
|
onClick,
|
|
|
|
onMouseEnter,
|
|
|
|
onMouseLeave,
|
|
|
|
onMouseMove,
|
|
|
|
onTouchEnd,
|
|
|
|
onTouchMove,
|
|
|
|
onTouchStart,
|
|
|
|
participantId,
|
2022-11-21 09:03:03 +00:00
|
|
|
shouldDisplayTintBackground,
|
2022-04-04 18:57:58 +00:00
|
|
|
styles,
|
2022-04-28 22:25:45 +00:00
|
|
|
videoTrack,
|
|
|
|
thumbnailType
|
2022-04-04 18:57:58 +00:00
|
|
|
}: Props) => {
|
|
|
|
const currentLayout = useSelector(getCurrentLayout);
|
|
|
|
const videoTrackId = videoTrack?.jitsiTrack?.getId();
|
|
|
|
const video = videoTrack && <VideoTrack
|
2022-05-12 22:47:38 +00:00
|
|
|
id = { isLocal ? 'localScreenshare_container' : `remoteVideo_${videoTrackId || ''}` }
|
2022-04-04 18:57:58 +00:00
|
|
|
muted = { true }
|
|
|
|
style = { styles.video }
|
|
|
|
videoTrack = { videoTrack } />;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<span
|
|
|
|
className = { containerClassName }
|
|
|
|
id = { `participant_${participantId}` }
|
|
|
|
{ ...(isMobile
|
|
|
|
? {
|
|
|
|
onTouchEnd,
|
|
|
|
onTouchMove,
|
|
|
|
onTouchStart
|
|
|
|
}
|
|
|
|
: {
|
|
|
|
onClick,
|
|
|
|
onMouseEnter,
|
|
|
|
onMouseMove,
|
|
|
|
onMouseLeave
|
|
|
|
}
|
|
|
|
) }
|
|
|
|
style = { styles.thumbnail }>
|
|
|
|
{video}
|
|
|
|
<div className = { classes.containerBackground } />
|
|
|
|
<div
|
|
|
|
className = { clsx(classes.indicatorsContainer,
|
|
|
|
classes.indicatorsTopContainer,
|
|
|
|
currentLayout === LAYOUTS.TILE_VIEW && 'tile-view-mode'
|
|
|
|
) }>
|
|
|
|
<ThumbnailTopIndicators
|
|
|
|
currentLayout = { currentLayout }
|
|
|
|
isHovered = { isHovered }
|
2022-04-28 22:25:45 +00:00
|
|
|
participantId = { participantId }
|
|
|
|
thumbnailType = { thumbnailType } />
|
2022-04-04 18:57:58 +00:00
|
|
|
</div>
|
2022-11-21 09:03:03 +00:00
|
|
|
{shouldDisplayTintBackground && <div className = { classes.tintBackground } />}
|
2022-04-04 18:57:58 +00:00
|
|
|
<div
|
|
|
|
className = { clsx(classes.indicatorsContainer,
|
|
|
|
classes.indicatorsBottomContainer,
|
|
|
|
currentLayout === LAYOUTS.TILE_VIEW && 'tile-view-mode'
|
|
|
|
) }>
|
|
|
|
<ThumbnailBottomIndicators
|
|
|
|
className = { classes.indicatorsBackground }
|
|
|
|
currentLayout = { currentLayout }
|
|
|
|
local = { false }
|
|
|
|
participantId = { participantId }
|
2022-05-12 22:47:38 +00:00
|
|
|
showStatusIndicators = { true } />
|
2022-04-04 18:57:58 +00:00
|
|
|
</div>
|
|
|
|
</span>);
|
|
|
|
};
|
|
|
|
|
2022-04-29 14:32:16 +00:00
|
|
|
export default VirtualScreenshareParticipant;
|