Compare commits
2 commits
8cd6ba97b6
...
060eaa8d94
Author | SHA1 | Date | |
---|---|---|---|
060eaa8d94 | |||
c3ba872553 |
2 changed files with 7 additions and 3 deletions
|
@ -1139,13 +1139,17 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const height = scaleYDimension(videoInfo.w || 400, 400, videoInfo.h || 400);
|
// FIXME
|
||||||
|
const videoW = videoInfo?.w ?? 400;
|
||||||
|
const videoH = videoInfo?.h ?? 400;
|
||||||
|
const maxW = scrollRef.current?.querySelector(`[data-message-id]>div>div:nth-child(2)`)?.clientWidth ?? 400;
|
||||||
|
const height = videoW <= maxW ? videoH : scaleYDimension(videoW, maxW, videoH);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Attachment>
|
<Attachment>
|
||||||
<AttachmentBox
|
<AttachmentBox
|
||||||
style={{
|
style={{
|
||||||
height: toRem(height < 48 ? 48 : height),
|
height: toRem(Math.max(48, Math.min(480, height))),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<VideoContent
|
<VideoContent
|
||||||
|
|
|
@ -116,7 +116,7 @@ export const VideoContent = as<'div', VideoContentProps>(
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
{srcState.status === AsyncStatus.Success && (
|
{srcState.status === AsyncStatus.Success && (
|
||||||
<Box className={css.AbsoluteContainer}>
|
<Box className={css.AbsoluteContainer} style={{position: 'unset'}}>
|
||||||
<Video
|
<Video
|
||||||
title={body}
|
title={body}
|
||||||
src={srcState.data}
|
src={srcState.data}
|
||||||
|
|
Loading…
Reference in a new issue