Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: vb picker #2075

Merged
merged 23 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/100ms-web/src/components/Preview/PreviewJoin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const Container = styled("div", {
px: "$10",
});

export const PreviewTile = ({ name, error }) => {
export const PreviewTile = ({ name, error, VB = false }) => {
const localPeer = useHMSStore(selectLocalPeer);
const borderAudioRef = useBorderAudioLevel(localPeer?.audioTrack);
const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
Expand All @@ -175,7 +175,7 @@ export const PreviewTile = ({ name, error }) => {
}}
ref={borderAudioRef}
>
{localPeer ? (
{localPeer || VB ? (
raviteja83 marked this conversation as resolved.
Show resolved Hide resolved
<>
<TileConnection name={name} peerId={localPeer.id} hideLabel={true} />
<Video
Expand Down
18 changes: 18 additions & 0 deletions packages/react-icons/assets/BlurPersonHighIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions packages/react-icons/assets/BlurPersonLowIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/react-icons/assets/SparkleIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions packages/react-icons/src/BlurPersonHighIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as React from 'react';
import { SVGProps } from 'react';
const SvgBlurPersonHighIcon = (props: SVGProps<SVGSVGElement>) => (
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M11.95 9.5a2.75 2.75 0 1 0 0 5.5 2.75 2.75 0 0 0 0-5.5Zm-1.65 2.75a1.65 1.65 0 1 1 3.3 0 1.65 1.65 0 0 1-3.3 0Z"
fill="#EFF0FA"
raviteja83 marked this conversation as resolved.
Show resolved Hide resolved
/>
<path
d="M9.75 16.1A2.75 2.75 0 0 0 7 18.85v1.1a.55.55 0 1 0 1.1 0v-1.1a1.65 1.65 0 0 1 1.65-1.65h4.4a1.65 1.65 0 0 1 1.65 1.65v1.1a.55.55 0 1 0 1.1 0v-1.1a2.75 2.75 0 0 0-2.75-2.75h-4.4ZM5 14c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1ZM5 10c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1ZM2.5 10c0-.28.22-.5.5-.5s.5.22.5.5-.22.5-.5.5-.5-.22-.5-.5ZM5 6c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1ZM21.5 10c0 .28-.22.5-.5.5s-.5-.22-.5-.5.22-.5.5-.5.5.22.5.5ZM15 6c0 .55-.45 1-1 1s-1-.45-1-1 .45-1 1-1 1 .45 1 1ZM14.5 3c0 .28-.22.5-.5.5s-.5-.22-.5-.5.22-.5.5-.5.5.22.5.5ZM2.5 14c0-.28.22-.5.5-.5s.5.22.5.5-.22.5-.5.5-.5-.22-.5-.5ZM10.5 3c0 .28-.22.5-.5.5s-.5-.22-.5-.5.22-.5.5-.5.5.22.5.5ZM11 6c0 .55-.45 1-1 1s-1-.45-1-1 .45-1 1-1 1 .45 1 1ZM17 14c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1ZM17 10c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1ZM17 6c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1ZM20.5 14c0-.28.22-.5.5-.5s.5.22.5.5-.22.5-.5.5-.5-.22-.5-.5Z"
fill="#EFF0FA"
/>
</svg>
);
export default SvgBlurPersonHighIcon;
21 changes: 21 additions & 0 deletions packages/react-icons/src/BlurPersonLowIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as React from 'react';
import { SVGProps } from 'react';
const SvgBlurPersonLowIcon = (props: SVGProps<SVGSVGElement>) => (
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
d="M10 3c0-.28-.22-.5-.5-.5S9 2.72 9 3s.22.5.5.5.5-.22.5-.5ZM14 3c0-.28-.22-.5-.5-.5s-.5.22-.5.5.22.5.5.5.5-.22.5-.5ZM10 6c0-.28-.22-.5-.5-.5S9 5.72 9 6s.22.5.5.5.5-.22.5-.5ZM14 6c0-.28-.22-.5-.5-.5s-.5.22-.5.5.22.5.5.5.5-.22.5-.5ZM6 5.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5ZM6 9.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5ZM5.5 14c0-.28.22-.5.5-.5s.5.22.5.5-.22.5-.5.5-.5-.22-.5-.5Z"
fill="currentColor"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M11.95 9.5a2.75 2.75 0 1 0 0 5.5 2.75 2.75 0 0 0 0-5.5Zm-1.65 2.75a1.65 1.65 0 1 1 3.3 0 1.65 1.65 0 0 1-3.3 0Z"
fill="currentColor"
/>
<path
d="M9.75 16.1A2.75 2.75 0 0 0 7 18.85v1.1a.55.55 0 1 0 1.1 0v-1.1a1.65 1.65 0 0 1 1.65-1.65h4.4a1.65 1.65 0 0 1 1.65 1.65v1.1a.55.55 0 1 0 1.1 0v-1.1a2.75 2.75 0 0 0-2.75-2.75h-4.4ZM20.5 10c0-.28.22-.5.5-.5s.5.22.5.5-.22.5-.5.5-.5-.22-.5-.5ZM20.5 14c0-.28.22-.5.5-.5s.5.22.5.5-.22.5-.5.5-.5-.22-.5-.5ZM2.5 10c0-.28.22-.5.5-.5s.5.22.5.5-.22.5-.5.5-.5-.22-.5-.5ZM2.5 14c0-.28.22-.5.5-.5s.5.22.5.5-.22.5-.5.5-.5-.22-.5-.5ZM18 9.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5ZM18 13.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5ZM17.5 6c0-.28.22-.5.5-.5s.5.22.5.5-.22.5-.5.5-.5-.22-.5-.5Z"
fill="currentColor"
/>
</svg>
);
export default SvgBlurPersonLowIcon;
14 changes: 14 additions & 0 deletions packages/react-icons/src/SparkleIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as React from 'react';
import { SVGProps } from 'react';
const SvgSparkleIcon = (props: SVGProps<SVGSVGElement>) => (
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
d="M12.098 3.903 10.44 8.944a1.734 1.734 0 0 1-1.106 1.106l-5.042 1.657 5.041 1.658a1.734 1.734 0 0 1 1.106 1.106l1.658 5.041 1.658-5.041a1.734 1.734 0 0 1 1.106-1.106l5.04-1.658-5.04-1.658a1.734 1.734 0 0 1-1.106-1.106l-1.658-5.041ZM6.027 3.903v3.469M18.168 16.043v3.469M4.292 5.637h3.469M16.434 17.778h3.468"
stroke="#EFF0FA"
strokeWidth={1.171}
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
export default SvgSparkleIcon;
3 changes: 3 additions & 0 deletions packages/react-icons/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export { default as BarIcon } from './BarIcon';
export { default as BatteryFullIcon } from './BatteryFullIcon';
export { default as BatteryPowerIcon } from './BatteryPowerIcon';
export { default as BillIcon } from './BillIcon';
export { default as BlurPersonHighIcon } from './BlurPersonHighIcon';
export { default as BlurPersonLowIcon } from './BlurPersonLowIcon';
export { default as BoltIcon } from './BoltIcon';
export { default as BookIcon } from './BookIcon';
export { default as BookmarkIcon } from './BookmarkIcon';
Expand Down Expand Up @@ -217,6 +219,7 @@ export { default as ShrinkIcon } from './ShrinkIcon';
export { default as ShuffleIcon } from './ShuffleIcon';
export { default as SlackIcon } from './SlackIcon';
export { default as SolidCheckCircleIcon } from './SolidCheckCircleIcon';
export { default as SparkleIcon } from './SparkleIcon';
export { default as SpeakerIcon } from './SpeakerIcon';
export { default as SpotlightIcon } from './SpotlightIcon';
export { default as SquareMenuIcon } from './SquareMenuIcon';
Expand Down
6 changes: 6 additions & 0 deletions packages/roomkit-react/src/Prebuilt/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const APP_DATA = {
activeScreensharePeerId: 'activeScreensharePeerId',
disableNotifications: 'disableNotifications',
pollState: 'pollState',
background: 'background',
raviteja83 marked this conversation as resolved.
Show resolved Hide resolved
backgroundType: 'backgroundType',
};
export const UI_SETTINGS = {
isAudioOnly: 'isAudioOnly',
Expand All @@ -61,6 +63,7 @@ export const SIDE_PANE_OPTIONS = {
CHAT: 'Chat',
STREAMING: 'STREAMING',
POLLS: 'POLLS',
VB: 'VB',
};

export const POLL_STATE = {
Expand Down Expand Up @@ -129,3 +132,6 @@ export const QUESTION_TYPE = {
export const ROLE_CHANGE_DECLINED = 'role_change_declined';

export const DEFAULT_PORTAL_CONTAINER = '#prebuilt-container';

// Will support all media, setting to image here to test with current plugin interface
export const VB_EFFECT = { BLUR: 'blur', BEAUTIFY: 'BEAUTIFY', NONE: 'none', MEDIA: 'image' };
KaustubhKumar05 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
SIDE_PANE_OPTIONS,
UI_MODE_GRID,
UI_SETTINGS,
VB_EFFECT,
} from '../../common/constants';

export const getAppDetails = appDetails => {
Expand Down Expand Up @@ -67,6 +68,8 @@ const initialAppData = {
[APP_DATA.minimiseInset]: false,
[APP_DATA.activeScreensharePeerId]: '',
[APP_DATA.disableNotifications]: false,
[APP_DATA.background]: VB_EFFECT.NONE,
[APP_DATA.backgroundType]: VB_EFFECT.NONE,
[APP_DATA.pollState]: {
[POLL_STATE.pollInView]: '',
[POLL_STATE.view]: '',
Expand Down
12 changes: 4 additions & 8 deletions packages/roomkit-react/src/Prebuilt/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Suspense, useEffect } from 'react';
import React, { useEffect } from 'react';
import { useMedia } from 'react-use';
import {
ConferencingScreen,
Expand All @@ -21,6 +21,8 @@ import { RaiseHand } from '../RaiseHand';
// @ts-ignore: No implicit Any
import { ScreenshareToggle } from '../ScreenShareToggle';
// @ts-ignore: No implicit Any
import { VBToggle } from '../VBToggle';
// @ts-ignore: No implicit Any
import { ChatToggle } from './ChatToggle';
// @ts-ignore: No implicit Any
import { ParticipantCount } from './ParticipantList';
Expand All @@ -31,8 +33,6 @@ import { useIsSidepaneTypeOpen, useSidepaneToggle } from '../AppData/useSidepane
import { useShowPolls } from '../AppData/useUISettings';
// @ts-ignore: No implicit Any
import { SIDE_PANE_OPTIONS } from '../../common/constants';
// @ts-ignore: No implicit Any
const VirtualBackground = React.lazy(() => import('../../plugins/VirtualBackground/VirtualBackground'));

export const Footer = ({
screenType,
Expand Down Expand Up @@ -82,11 +82,7 @@ export const Footer = ({
>
{isMobile ? <LeaveRoom screenType={screenType} /> : null}
<AudioVideoToggle />
{isMobile ? null : (
<Suspense fallback={<></>}>
<VirtualBackground />
</Suspense>
)}
{isMobile ? null : <VBToggle />}
</AppFooter.Left>
<AppFooter.Center
css={{
Expand Down
Loading
Loading