Merge branch 'external-video-height' into 'develop'
Fix external video embed height See merge request soapbox-pub/soapbox-fe!1322
This commit is contained in:
commit
a777378016
|
@ -129,7 +129,15 @@ class DetailedStatus extends ImmutablePureComponent<IDetailedStatus, IDetailedSt
|
||||||
const video = firstAttachment;
|
const video = firstAttachment;
|
||||||
if (video.external_video_id && status.card?.html) {
|
if (video.external_video_id && status.card?.html) {
|
||||||
const { mediaWrapperWidth } = this.state;
|
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 = (
|
media = (
|
||||||
<div className='status-card horizontal interactive status-card--video'>
|
<div className='status-card horizontal interactive status-card--video'>
|
||||||
<div
|
<div
|
||||||
|
|
Loading…
Reference in New Issue