sforkowany z mirror/soapbox
external_video_id: render card html instead of hardcoding the provider
rodzic
b363c20359
commit
ebc2bf96ac
|
@ -439,8 +439,7 @@ class Status extends ImmutablePureComponent {
|
||||||
} else if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
} else if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
||||||
const video = status.getIn(['media_attachments', 0]);
|
const video = status.getIn(['media_attachments', 0]);
|
||||||
|
|
||||||
const external_id = (video.get('external_video_id'));
|
if (video.external_video_id) {
|
||||||
if (external_id) {
|
|
||||||
const { mediaWrapperWidth } = this.state;
|
const { mediaWrapperWidth } = this.state;
|
||||||
const height = mediaWrapperWidth / (video.getIn(['meta', 'original', 'width']) / video.getIn(['meta', 'original', 'height']));
|
const height = mediaWrapperWidth / (video.getIn(['meta', 'original', 'width']) / video.getIn(['meta', 'original', 'height']));
|
||||||
media = (
|
media = (
|
||||||
|
@ -449,16 +448,8 @@ class Status extends ImmutablePureComponent {
|
||||||
ref={this.setRef}
|
ref={this.setRef}
|
||||||
className='status-card__image status-card-video'
|
className='status-card__image status-card-video'
|
||||||
style={height ? { height } : {}}
|
style={height ? { height } : {}}
|
||||||
>
|
dangerouslySetInnerHTML={{ __html: status.card.html }}
|
||||||
<iframe
|
/>
|
||||||
src={`https://rumble.com/embed/${external_id}/`}
|
|
||||||
frameBorder='0'
|
|
||||||
allowFullScreen
|
|
||||||
webkitallowfullscreen='true'
|
|
||||||
mozallowfullscreen='true'
|
|
||||||
title=''
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -110,8 +110,7 @@ class DetailedStatus extends ImmutablePureComponent {
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
||||||
const video = status.getIn(['media_attachments', 0]);
|
const video = status.getIn(['media_attachments', 0]);
|
||||||
const external_id = (video.get('external_video_id'));
|
if (video.external_video_id) {
|
||||||
if (external_id) {
|
|
||||||
const { mediaWrapperWidth } = this.state;
|
const { mediaWrapperWidth } = this.state;
|
||||||
const height = mediaWrapperWidth / (video.getIn(['meta', 'original', 'width']) / video.getIn(['meta', 'original', 'height']));
|
const height = mediaWrapperWidth / (video.getIn(['meta', 'original', 'width']) / video.getIn(['meta', 'original', 'height']));
|
||||||
media = (
|
media = (
|
||||||
|
@ -120,16 +119,8 @@ class DetailedStatus extends ImmutablePureComponent {
|
||||||
ref={this.setRef}
|
ref={this.setRef}
|
||||||
className='status-card-video'
|
className='status-card-video'
|
||||||
style={{ height }}
|
style={{ height }}
|
||||||
>
|
dangerouslySetInnerHTML={{ __html: status.card.html }}
|
||||||
<iframe
|
/>
|
||||||
src={`https://rumble.com/embed/${external_id}/`}
|
|
||||||
frameborder='0'
|
|
||||||
allowFullScreen='true'
|
|
||||||
webkitallowfullscreen='true'
|
|
||||||
mozallowfullscreen='true'
|
|
||||||
title='Video'
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
Ładowanie…
Reference in New Issue