Fix external video embed height

This commit is contained in:
Alex Gleason 2022-05-06 12:11:59 -05:00
parent 5284fa5313
commit 44c234e3db
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -129,7 +129,15 @@ class DetailedStatus extends ImmutablePureComponent<IDetailedStatus, IDetailedSt
const video = firstAttachment;
if (video.external_video_id && status.card?.html) {
const { mediaWrapperWidth } = this.state;
const height = mediaWrapperWidth / Number(video.meta.getIn(['original', 'width'])) / Number(video.meta.getIn(['original', 'height']));
const getHeight = (): number => {
const width = Number(video.meta.getIn(['original', 'width']));
const height = Number(video.meta.getIn(['original', 'height']));
return Number(mediaWrapperWidth) / (width / height);
};
const height = getHeight();
media = (
<div className='status-card horizontal interactive status-card--video'>
<div