Skip to content

Commit

Permalink
Merge branch 'main' into WEB-1998-recording-design-parity
Browse files Browse the repository at this point in the history
  • Loading branch information
amar-1995 committed Aug 23, 2023
2 parents 66e166b + 0fd7d45 commit 71d02a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ import {
useHMSStore,
useRecordingStreaming,
} from '@100mslive/react-sdk';
import {
BrbIcon,
CrossIcon,
DragHandleIcon,
EmojiIcon,
HandIcon,
PeopleIcon,
RecordIcon,
SettingsIcon,
} from '@100mslive/react-icons';
import { CrossIcon, DragHandleIcon, EmojiIcon, PeopleIcon, RecordIcon, SettingsIcon } from '@100mslive/react-icons';
import { Box, Loading, Tooltip } from '../../../../';
import { Sheet } from '../../../../Sheet';
import IconButton from '../../../IconButton';
Expand All @@ -31,10 +22,8 @@ import { ChangeNameModal } from '.././ChangeNameModal';
import { MuteAllModal } from '.././MuteAllModal';
import { useSidepaneToggle } from '../../AppData/useSidepane';
import { useDropdownList } from '../../hooks/useDropdownList';
import { useIsFeatureEnabled } from '../../hooks/useFeatures';
import { useMyMetadata } from '../../hooks/useMetadata';
import { getFormattedCount } from '../../../common/utils';
import { FEATURE_LIST, SIDE_PANE_OPTIONS } from '../../../common/constants';
import { SIDE_PANE_OPTIONS } from '../../../common/constants';

const VirtualBackground = React.lazy(() => import('../../../plugins/VirtualBackground/VirtualBackground'));

Expand All @@ -57,9 +46,6 @@ export const MwebOptions = () => {
const { isBrowserRecordingOn, isStreamingOn, isHLSRunning } = useRecordingStreaming();

const [openModals, setOpenModals] = useState(new Set());
const { isHandRaised, isBRBOn, toggleHandRaise, toggleBRB } = useMyMetadata();
const isHandRaiseEnabled = useIsFeatureEnabled(FEATURE_LIST.HAND_RAISE);
const isBRBEnabled = useIsFeatureEnabled(FEATURE_LIST.BRB);

const [openOptionsSheet, setOpenOptionsSheet] = useState(false);
const [openSettingsSheet, setOpenSettingsSheet] = useState(false);
Expand All @@ -68,7 +54,6 @@ export const MwebOptions = () => {
const [isRecordingLoading, setIsRecordingLoading] = useState(false);
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
const peerCount = useHMSStore(selectPeerCount);

const emojiCardRef = useRef(null);
const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);

Expand Down Expand Up @@ -142,32 +127,6 @@ export const MwebOptions = () => {
<ActionTile.Title>Participants</ActionTile.Title>
</ActionTile.Root>

{isHandRaiseEnabled ? (
<ActionTile.Root
active={isHandRaised}
onClick={() => {
toggleHandRaise();
setOpenOptionsSheet(false);
}}
>
<HandIcon />
<ActionTile.Title>Raise Hand</ActionTile.Title>
</ActionTile.Root>
) : null}

{isBRBEnabled ? (
<ActionTile.Root
active={isBRBOn}
onClick={() => {
toggleBRB();
setOpenOptionsSheet(false);
}}
>
<BrbIcon />
<ActionTile.Title>Be Right Back</ActionTile.Title>
</ActionTile.Root>
) : null}

{isVideoOn ? (
<Suspense fallback="">
<VirtualBackground asActionTile onVBClick={() => setOpenOptionsSheet(false)} />
Expand Down
9 changes: 8 additions & 1 deletion packages/roomkit-react/src/Prebuilt/components/VideoTile.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Fragment, useCallback, useMemo, useState } from 'react';
import { useMedia } from 'react-use';
import {
selectAudioTrackByPeerID,
selectIsPeerAudioEnabled,
Expand All @@ -15,11 +16,13 @@ import TileMenu from './TileMenu/TileMenu';
import { useBorderAudioLevel } from '../../AudioLevel';
import { Avatar } from '../../Avatar';
import { VideoTileStats } from '../../Stats';
import { config as cssConfig } from '../../Theme';
import { Video } from '../../Video';
import { StyledVideoTile } from '../../VideoTile';
import { getVideoTileLabel } from './peerTileUtils';
import { useAppConfig } from './AppData/useAppConfig';
import { useIsHeadless, useUISettings } from './AppData/useUISettings';
import { useShowStreamingUI } from '../common/hooks';
import { UI_SETTINGS } from '../common/constants';

const Tile = ({
Expand Down Expand Up @@ -48,6 +51,8 @@ const Tile = ({
const borderAudioRef = useBorderAudioLevel(audioTrack?.id);
const isVideoDegraded = track?.degraded;
const isLocal = localPeerID === peerId;
const isMobile = useMedia(cssConfig.media.md);
const showStreamingUI = useShowStreamingUI();
const label = getVideoTileLabel({
peerName,
track,
Expand Down Expand Up @@ -142,7 +147,9 @@ const Tile = ({
/>
) : null}
<PeerMetadata peerId={peerId} />
<TileConnection hideLabel={hideLabel} name={label} isTile peerId={peerId} width={width} />
{showStreamingUI && isMobile ? null : (
<TileConnection hideLabel={hideLabel} name={label} isTile peerId={peerId} width={width} />
)}
</StyledVideoTile.Container>
) : null}
</StyledVideoTile.Root>
Expand Down

0 comments on commit 71d02a8

Please sign in to comment.