Browse Source

Merge pull request #414 from ThibG/glitch-soc/fixes/fix-video-playback

Fix video playback in glitch-soc detailed statuses
closed-social-glitch-2
David Yip 6 years ago
committed by GitHub
parent
commit
695b53b796
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      app/javascript/flavours/glitch/features/status/components/detailed_status.js

+ 7
- 5
app/javascript/flavours/glitch/features/status/components/detailed_status.js View File

@ -35,9 +35,9 @@ export default class DetailedStatus extends ImmutablePureComponent {
e.stopPropagation(); e.stopPropagation();
} }
// handleOpenVideo = startTime => {
// this.props.onOpenVideo(this.props.status.getIn(['media_attachments', 0]), startTime);
// }
handleOpenVideo = startTime => {
this.props.onOpenVideo(this.props.status.getIn(['media_attachments', 0]), startTime);
}
render () { render () {
const status = this.props.status.get('reblog') ? this.props.status.get('reblog') : this.props.status; const status = this.props.status.get('reblog') ? this.props.status.get('reblog') : this.props.status;
@ -53,13 +53,15 @@ export default class DetailedStatus extends ImmutablePureComponent {
if (status.get('media_attachments').some(item => item.get('type') === 'unknown')) { if (status.get('media_attachments').some(item => item.get('type') === 'unknown')) {
media = <AttachmentList media={status.get('media_attachments')} />; media = <AttachmentList media={status.get('media_attachments')} />;
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') { } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
const video = status.getIn(['media_attachments', 0]);
media = ( media = (
<Video <Video
preview={video.get('preview_url')}
src={video.get('url')}
sensitive={status.get('sensitive')} sensitive={status.get('sensitive')}
media={status.getIn(['media_attachments', 0])}
letterbox={settings.getIn(['media', 'letterbox'])} letterbox={settings.getIn(['media', 'letterbox'])}
fullwidth={settings.getIn(['media', 'fullwidth'])} fullwidth={settings.getIn(['media', 'fullwidth'])}
onOpenVideo={this.props.onOpenVideo}
onOpenVideo={this.handleOpenVideo}
autoplay autoplay
/> />
); );

Loading…
Cancel
Save