[Perf] Avatar: Temporarly disable video avatars
This commit is contained in:
parent
24d0289401
commit
78f37836b2
@ -6,10 +6,10 @@ import { withGlobal } from '../../../global';
|
|||||||
|
|
||||||
import type { ApiChat, ApiUser } from '../../../api/types';
|
import type { ApiChat, ApiUser } from '../../../api/types';
|
||||||
|
|
||||||
|
import { GROUP_CALL_THUMB_VIDEO_DISABLED } from '../../../config';
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import { selectChat, selectUser } from '../../../global/selectors';
|
import { selectChat, selectUser } from '../../../global/selectors';
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
import { ENABLE_THUMBNAIL_VIDEO } from '../../../config';
|
|
||||||
|
|
||||||
import Avatar from '../../common/Avatar';
|
import Avatar from '../../common/Avatar';
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ const GroupCallParticipantVideo: FC<OwnProps & StateProps> = ({
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
<Avatar user={user} chat={chat} className="thumbnail-avatar" />
|
<Avatar user={user} chat={chat} className="thumbnail-avatar" />
|
||||||
{ENABLE_THUMBNAIL_VIDEO && (
|
{!GROUP_CALL_THUMB_VIDEO_DISABLED && (
|
||||||
<div className="thumbnail-wrapper">
|
<div className="thumbnail-wrapper">
|
||||||
<video className="thumbnail" muted autoPlay playsInline srcObject={streams?.[type]} />
|
<video className="thumbnail" muted autoPlay playsInline srcObject={streams?.[type]} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import type { AnimationLevel } from '../../types';
|
|||||||
import { ApiMediaFormat } from '../../api/types';
|
import { ApiMediaFormat } from '../../api/types';
|
||||||
|
|
||||||
import { ANIMATION_LEVEL_MAX, IS_TEST } from '../../config';
|
import { ANIMATION_LEVEL_MAX, IS_TEST } from '../../config';
|
||||||
|
import { VIDEO_AVATARS_DISABLED } from '../../util/environment';
|
||||||
import {
|
import {
|
||||||
getChatAvatarHash,
|
getChatAvatarHash,
|
||||||
getChatTitle,
|
getChatTitle,
|
||||||
@ -87,8 +88,10 @@ const Avatar: FC<OwnProps> = ({
|
|||||||
let imageHash: string | undefined;
|
let imageHash: string | undefined;
|
||||||
let videoHash: string | undefined;
|
let videoHash: string | undefined;
|
||||||
|
|
||||||
const shouldShowVideo = isIntersecting && animationLevel === ANIMATION_LEVEL_MAX && withVideo && user?.isPremium
|
const shouldShowVideo = (
|
||||||
&& user?.hasVideoAvatar;
|
!VIDEO_AVATARS_DISABLED && animationLevel === ANIMATION_LEVEL_MAX
|
||||||
|
&& isIntersecting && withVideo && user?.isPremium && user?.hasVideoAvatar
|
||||||
|
);
|
||||||
const profilePhoto = user?.fullInfo?.profilePhoto;
|
const profilePhoto = user?.fullInfo?.profilePhoto;
|
||||||
const shouldLoadVideo = shouldShowVideo && profilePhoto?.isVideo;
|
const shouldLoadVideo = shouldShowVideo && profilePhoto?.isVideo;
|
||||||
|
|
||||||
|
|||||||
@ -223,7 +223,7 @@ export const MAX_UPLOAD_FILEPART_SIZE = 524288;
|
|||||||
// Group calls
|
// Group calls
|
||||||
export const GROUP_CALL_VOLUME_MULTIPLIER = 100;
|
export const GROUP_CALL_VOLUME_MULTIPLIER = 100;
|
||||||
export const GROUP_CALL_DEFAULT_VOLUME = 100 * GROUP_CALL_VOLUME_MULTIPLIER;
|
export const GROUP_CALL_DEFAULT_VOLUME = 100 * GROUP_CALL_VOLUME_MULTIPLIER;
|
||||||
export const ENABLE_THUMBNAIL_VIDEO = false;
|
export const GROUP_CALL_THUMB_VIDEO_DISABLED = true;
|
||||||
|
|
||||||
export const DEFAULT_LIMITS: Record<ApiLimitType, readonly [number, number]> = {
|
export const DEFAULT_LIMITS: Record<ApiLimitType, readonly [number, number]> = {
|
||||||
uploadMaxFileparts: [4000, 8000],
|
uploadMaxFileparts: [4000, 8000],
|
||||||
|
|||||||
@ -118,6 +118,9 @@ export const MESSAGE_LIST_SENSITIVE_AREA = IS_SCROLL_PATCH_NEEDED ? 300 : 750;
|
|||||||
|
|
||||||
export const MAX_BUFFER_SIZE = (IS_ANDROID || IS_IOS ? 512 : 2000) * 1024 ** 2; // 512 OR 2000 MB
|
export const MAX_BUFFER_SIZE = (IS_ANDROID || IS_IOS ? 512 : 2000) * 1024 ** 2; // 512 OR 2000 MB
|
||||||
|
|
||||||
|
// TODO Turn on later as `!IS_IOS && !IS_ANDROID`
|
||||||
|
export const VIDEO_AVATARS_DISABLED = true;
|
||||||
|
|
||||||
function isLastEmojiVersionSupported() {
|
function isLastEmojiVersionSupported() {
|
||||||
const ALLOWABLE_CALCULATION_ERROR_SIZE = 5;
|
const ALLOWABLE_CALCULATION_ERROR_SIZE = 5;
|
||||||
const inlineEl = document.createElement('span');
|
const inlineEl = document.createElement('span');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user