diff --git a/src/app/organisms/room/RoomTimeline.tsx b/src/app/organisms/room/RoomTimeline.tsx index 483356d..22fba03 100644 --- a/src/app/organisms/room/RoomTimeline.tsx +++ b/src/app/organisms/room/RoomTimeline.tsx @@ -1139,13 +1139,17 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli 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 ( ( )} {srcState.status === AsyncStatus.Success && ( - +