Files
jitsi-meet/react/features/filmstrip/components/web/FakeScreenShareParticipant.js
William Liang 70090fd716 feat(multi-stream) Add fake participant tile for screen share.
prioritize participants with screen shares
support local screen share track
auto pin screen share
support screen share for large video
ensure fake screen share participants are sorted
fix local screen share in vertical filmstrip
fix local screen share in tile mode
use FakeScreenShareParticipant component for screen share thumbnails
ensure changes are behind feature flag and update jsdocs
fix bug where local screen share was not rendering
update receiver constraints to include SS source names
remove fake ss participant creation on track update
fix: handle screenshare muted change and track removal
refactor: update key values for sortedFakeScreenShareParticipants
address PR comments
refactor getter for screenshare tracks
rename state to sortedRemoteFakeScreenShareParticipants
2022-04-04 14:57:58 -04:00

158 lines
3.8 KiB
JavaScript

// @flow
import clsx from 'clsx';
import React from 'react';
import { useSelector } from 'react-redux';
import { VideoTrack } from '../../../base/media';
import { getCurrentLayout, LAYOUTS } 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 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 fake screen share participant.
*/
participantId: string,
/**
* An object with the styles for thumbnail.
*/
styles: Object,
/**
* JitsiTrack instance.
*/
videoTrack: Object
}
const FakeScreenShareParticipant = ({
classes,
containerClassName,
isHovered,
isMobile,
onClick,
onMouseEnter,
onMouseLeave,
onMouseMove,
onTouchEnd,
onTouchMove,
onTouchStart,
participantId,
styles,
videoTrack
}: Props) => {
const currentLayout = useSelector(getCurrentLayout);
const videoTrackId = videoTrack?.jitsiTrack?.getId();
const video = videoTrack && <VideoTrack
id = { `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 }
isFakeScreenShareParticipant = { true }
isHovered = { isHovered }
participantId = { participantId } />
</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 = { false } />
</div>
</span>);
};
export default FakeScreenShareParticipant;