Calling lobby: show your blurred avatar instead of other person's
This commit is contained in:
parent
4d95f83007
commit
957a1e0d07
4 changed files with 26 additions and 29 deletions
|
@ -130,6 +130,7 @@ export const CallManager = ({
|
||||||
hasLocalVideo={hasLocalVideo}
|
hasLocalVideo={hasLocalVideo}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
isGroupCall={false}
|
isGroupCall={false}
|
||||||
|
me={me}
|
||||||
onCallCanceled={cancelCall}
|
onCallCanceled={cancelCall}
|
||||||
onJoinCall={() => {
|
onJoinCall={() => {
|
||||||
startCall({
|
startCall({
|
||||||
|
|
|
@ -13,16 +13,6 @@ import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
const i18n = setupI18n('en', enMessages);
|
const i18n = setupI18n('en', enMessages);
|
||||||
|
|
||||||
const conversation = {
|
|
||||||
id: '3051234567',
|
|
||||||
avatarPath: undefined,
|
|
||||||
color: 'ultramarine' as ColorType,
|
|
||||||
title: 'Rick Sanchez',
|
|
||||||
name: 'Rick Sanchez',
|
|
||||||
phoneNumber: '3051234567',
|
|
||||||
profileName: 'Rick Sanchez',
|
|
||||||
};
|
|
||||||
|
|
||||||
const camera = {
|
const camera = {
|
||||||
deviceId: 'dfbe6effe70b0611ba0fdc2a9ea3f39f6cb110e6687948f7e5f016c111b7329c',
|
deviceId: 'dfbe6effe70b0611ba0fdc2a9ea3f39f6cb110e6687948f7e5f016c111b7329c',
|
||||||
groupId: '63ee218d2446869e40adfc958ff98263e51f74382b0143328ee4826f20a76f47',
|
groupId: '63ee218d2446869e40adfc958ff98263e51f74382b0143328ee4826f20a76f47',
|
||||||
|
@ -35,11 +25,14 @@ const camera = {
|
||||||
|
|
||||||
const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
||||||
availableCameras: overrideProps.availableCameras || [camera],
|
availableCameras: overrideProps.availableCameras || [camera],
|
||||||
conversation,
|
conversation: {
|
||||||
|
title: 'Rick Sanchez',
|
||||||
|
},
|
||||||
hasLocalAudio: boolean('hasLocalAudio', overrideProps.hasLocalAudio || false),
|
hasLocalAudio: boolean('hasLocalAudio', overrideProps.hasLocalAudio || false),
|
||||||
hasLocalVideo: boolean('hasLocalVideo', overrideProps.hasLocalVideo || false),
|
hasLocalVideo: boolean('hasLocalVideo', overrideProps.hasLocalVideo || false),
|
||||||
i18n,
|
i18n,
|
||||||
isGroupCall: boolean('isGroupCall', overrideProps.isGroupCall || false),
|
isGroupCall: boolean('isGroupCall', overrideProps.isGroupCall || false),
|
||||||
|
me: overrideProps.me || { color: 'ultramarine' as ColorType },
|
||||||
onCallCanceled: action('on-call-canceled'),
|
onCallCanceled: action('on-call-canceled'),
|
||||||
onJoinCall: action('on-join-call'),
|
onJoinCall: action('on-join-call'),
|
||||||
setLocalAudio: action('set-local-audio'),
|
setLocalAudio: action('set-local-audio'),
|
||||||
|
@ -53,24 +46,27 @@ const story = storiesOf('Components/CallingLobby', module);
|
||||||
|
|
||||||
story.add('Default', () => {
|
story.add('Default', () => {
|
||||||
const props = createProps();
|
const props = createProps();
|
||||||
return (
|
return <CallingLobby {...props} />;
|
||||||
<CallingLobby
|
|
||||||
{...props}
|
|
||||||
conversation={{
|
|
||||||
...conversation,
|
|
||||||
avatarPath: 'https://www.stevensegallery.com/600/600',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
story.add('No Camera', () => {
|
story.add('No Camera, no avatar', () => {
|
||||||
const props = createProps({
|
const props = createProps({
|
||||||
availableCameras: [],
|
availableCameras: [],
|
||||||
});
|
});
|
||||||
return <CallingLobby {...props} />;
|
return <CallingLobby {...props} />;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
story.add('No Camera, local avatar', () => {
|
||||||
|
const props = createProps({
|
||||||
|
availableCameras: [],
|
||||||
|
me: {
|
||||||
|
color: 'ultramarine' as ColorType,
|
||||||
|
avatarPath: '/fixtures/kitten-4-112-112.jpg',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return <CallingLobby {...props} />;
|
||||||
|
});
|
||||||
|
|
||||||
story.add('Local Video', () => {
|
story.add('Local Video', () => {
|
||||||
const props = createProps({
|
const props = createProps({
|
||||||
hasLocalVideo: true,
|
hasLocalVideo: true,
|
||||||
|
|
|
@ -19,14 +19,16 @@ import { ColorType } from '../types/Colors';
|
||||||
export type PropsType = {
|
export type PropsType = {
|
||||||
availableCameras: Array<MediaDeviceInfo>;
|
availableCameras: Array<MediaDeviceInfo>;
|
||||||
conversation: {
|
conversation: {
|
||||||
avatarPath?: string;
|
|
||||||
color?: ColorType;
|
|
||||||
title: string;
|
title: string;
|
||||||
};
|
};
|
||||||
hasLocalAudio: boolean;
|
hasLocalAudio: boolean;
|
||||||
hasLocalVideo: boolean;
|
hasLocalVideo: boolean;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
isGroupCall: boolean;
|
isGroupCall: boolean;
|
||||||
|
me: {
|
||||||
|
avatarPath?: string;
|
||||||
|
color?: ColorType;
|
||||||
|
};
|
||||||
onCallCanceled: () => void;
|
onCallCanceled: () => void;
|
||||||
onJoinCall: () => void;
|
onJoinCall: () => void;
|
||||||
setLocalAudio: (_: SetLocalAudioType) => void;
|
setLocalAudio: (_: SetLocalAudioType) => void;
|
||||||
|
@ -43,6 +45,7 @@ export const CallingLobby = ({
|
||||||
hasLocalVideo,
|
hasLocalVideo,
|
||||||
i18n,
|
i18n,
|
||||||
isGroupCall = false,
|
isGroupCall = false,
|
||||||
|
me,
|
||||||
onCallCanceled,
|
onCallCanceled,
|
||||||
onJoinCall,
|
onJoinCall,
|
||||||
setLocalAudio,
|
setLocalAudio,
|
||||||
|
@ -131,10 +134,7 @@ export const CallingLobby = ({
|
||||||
{hasLocalVideo && availableCameras.length > 0 ? (
|
{hasLocalVideo && availableCameras.length > 0 ? (
|
||||||
<video ref={localVideoRef} autoPlay />
|
<video ref={localVideoRef} autoPlay />
|
||||||
) : (
|
) : (
|
||||||
<CallBackgroundBlur
|
<CallBackgroundBlur avatarPath={me.avatarPath} color={me.color}>
|
||||||
avatarPath={conversation.avatarPath}
|
|
||||||
color={conversation.color}
|
|
||||||
>
|
|
||||||
<div className="module-calling-lobby__video-off--icon" />
|
<div className="module-calling-lobby__video-off--icon" />
|
||||||
<span className="module-calling-lobby__video-off--text">
|
<span className="module-calling-lobby__video-off--text">
|
||||||
{i18n('calling__your-video-is-off')}
|
{i18n('calling__your-video-is-off')}
|
||||||
|
|
|
@ -14418,7 +14418,7 @@
|
||||||
"rule": "React-useRef",
|
"rule": "React-useRef",
|
||||||
"path": "ts/components/CallingLobby.tsx",
|
"path": "ts/components/CallingLobby.tsx",
|
||||||
"line": " const localVideoRef = React.useRef(null);",
|
"line": " const localVideoRef = React.useRef(null);",
|
||||||
"lineNumber": 54,
|
"lineNumber": 57,
|
||||||
"reasonCategory": "usageTrusted",
|
"reasonCategory": "usageTrusted",
|
||||||
"updated": "2020-10-26T19:12:24.410Z",
|
"updated": "2020-10-26T19:12:24.410Z",
|
||||||
"reasonDetail": "Used to get the local video element for rendering."
|
"reasonDetail": "Used to get the local video element for rendering."
|
||||||
|
@ -15160,4 +15160,4 @@
|
||||||
"reasonCategory": "falseMatch",
|
"reasonCategory": "falseMatch",
|
||||||
"updated": "2020-09-08T23:07:22.682Z"
|
"updated": "2020-09-08T23:07:22.682Z"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Reference in a new issue