123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- // @flow
-
- import clsx from 'clsx';
- import React from 'react';
- import { useSelector } from 'react-redux';
-
- import { VideoTrack } from '../../../base/media';
- import { LAYOUTS, getCurrentLayout } from '../../../video-layout';
-
- 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,
-
- /**
- * Indicates whether the thumbnail is for local screenshare or not.
- */
- isLocal: boolean,
-
- /**
- * 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,
-
- /**
- * The ID of the virtual screen share participant.
- */
- participantId: string,
-
- /**
- * An object with the styles for thumbnail.
- */
- styles: Object,
-
- /**
- * The type of thumbnail.
- */
- thumbnailType: string,
-
- /**
- * JitsiTrack instance.
- */
- videoTrack: Object
- }
-
- const VirtualScreenshareParticipant = ({
- classes,
- containerClassName,
- isHovered,
- isLocal,
- isMobile,
- onClick,
- onMouseEnter,
- onMouseLeave,
- onMouseMove,
- onTouchEnd,
- onTouchMove,
- onTouchStart,
- participantId,
- styles,
- videoTrack,
- thumbnailType
- }: Props) => {
- const currentLayout = useSelector(getCurrentLayout);
- const videoTrackId = videoTrack?.jitsiTrack?.getId();
- const video = videoTrack && <VideoTrack
- id = { isLocal ? 'localScreenshare_container' : `remoteVideo_${videoTrackId || ''}` }
- 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 }
- participantId = { participantId }
- thumbnailType = { thumbnailType } />
- </div>
- <div
- className = { clsx(classes.indicatorsContainer,
- classes.indicatorsBottomContainer,
- currentLayout === LAYOUTS.TILE_VIEW && 'tile-view-mode'
- ) }>
- <ThumbnailBottomIndicators
- className = { classes.indicatorsBackground }
- currentLayout = { currentLayout }
- local = { false }
- participantId = { participantId }
- showStatusIndicators = { true } />
- </div>
- </span>);
- };
-
- export default VirtualScreenshareParticipant;
|