disable drop bg, pin and focus for grid items

This commit is contained in:
Ramón Souza 2023-05-12 10:34:35 -03:00
parent 1d27aaa35b
commit 102063ca60
4 changed files with 12 additions and 7 deletions

View File

@ -326,7 +326,8 @@ class VideoList extends Component {
userId={userId}
name={name}
focused={false}
onVideoItemMount={(videoRef) => {
isStream={false}
onVideoItemMount={() => {
this.handleCanvasResize();
}}
onVideoItemUnmount={onVideoItemUnmount}
@ -352,6 +353,7 @@ class VideoList extends Component {
userId={userId}
name={name}
focused={isFocused}
isStream={true}
onHandleVideoFocus={handleVideoFocus}
onVideoItemMount={(videoRef) => {
this.handleCanvasResize();

View File

@ -22,7 +22,7 @@ const VideoListItem = (props) => {
const {
name, voiceUser, isFullscreenContext, layoutContextDispatch, user, onHandleVideoFocus,
cameraId, numOfStreams, focused, onVideoItemMount, onVideoItemUnmount, onVirtualBgDrop,
makeDragOperations, dragging, draggingOver, isRTL
makeDragOperations, dragging, draggingOver, isRTL, isStream,
} = props;
const [videoDataLoaded, setVideoDataLoaded] = useState(false);
@ -115,6 +115,7 @@ const VideoListItem = (props) => {
focused={focused}
onHandleMirror={() => setIsMirrored((value) => !value)}
isRTL={isRTL}
isStream={isStream}
/>
);
@ -139,6 +140,7 @@ const VideoListItem = (props) => {
focused={focused}
onHandleMirror={() => setIsMirrored((value) => !value)}
isRTL={isRTL}
isStream={isStream}
/>
<UserStatus
voiceUser={voiceUser}
@ -185,6 +187,7 @@ const VideoListItem = (props) => {
focused={focused}
onHandleMirror={() => setIsMirrored((value) => !value)}
isRTL={isRTL}
isStream={isStream}
/>
<UserStatus
voiceUser={voiceUser}

View File

@ -24,7 +24,7 @@ const intlMessages = defineMessages({
const ENABLE_WEBCAM_BACKGROUND_UPLOAD = Meteor.settings.public.virtualBackgrounds.enableVirtualBackgroundUpload;
const DragAndDrop = (props) => {
const { children, intl, readFile, onVirtualBgDrop: onAction } = props;
const { children, intl, readFile, onVirtualBgDrop: onAction, isStream } = props;
const [dragging, setDragging] = useState(false);
const [draggingOver, setDraggingOver] = useState(false);
@ -106,7 +106,7 @@ const DragAndDrop = (props) => {
};
const makeDragOperations = useCallback((userId) => {
if (!userId || Auth.userID !== userId || !ENABLE_WEBCAM_BACKGROUND_UPLOAD) return {};
if (!userId || Auth.userID !== userId || !ENABLE_WEBCAM_BACKGROUND_UPLOAD || !isStream) return {};
const startAndSaveVirtualBackground = (file) => handleStartAndSaveVirtualBackground(file);

View File

@ -51,7 +51,7 @@ const intlMessages = defineMessages({
const UserActions = (props) => {
const {
name, cameraId, numOfStreams, onHandleVideoFocus, user, focused, onHandleMirror,
isVideoSqueezed, videoContainer, isRTL,
isVideoSqueezed, videoContainer, isRTL, isStream,
} = props;
const intl = useIntl();
@ -93,7 +93,7 @@ const UserActions = (props) => {
dataTest: 'mirrorWebcamBtn',
});
if (numOfStreams > 2) {
if (numOfStreams > 2 && isStream) {
menuItems.push({
key: `${cameraId}-focus`,
label: intl.formatMessage(intlMessages[`${isFocusedIntlKey}Label`]),
@ -103,7 +103,7 @@ const UserActions = (props) => {
});
}
if (VideoService.isVideoPinEnabledForCurrentUser()) {
if (VideoService.isVideoPinEnabledForCurrentUser() && isStream) {
menuItems.push({
key: `${cameraId}-pin`,
label: intl.formatMessage(intlMessages[`${isPinnedIntlKey}Label`]),