about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-04-08 18:18:41 -0500
committerGitHub <noreply@github.com>2018-04-08 18:18:41 -0500
commit695b53b796767e307d8ce0f5d11c2a82cb85bfd5 (patch)
treeee429d766124b1419237ef170a07450b3034a573
parent8a082d8735cb5851cd1749b9fc151fa3db2d3788 (diff)
parent0fb5ea5d15b4d110ae725c7f232a6d78c05995cf (diff)
Merge pull request #414 from ThibG/glitch-soc/fixes/fix-video-playback
Fix video playback in glitch-soc detailed statuses
-rw-r--r--app/javascript/flavours/glitch/features/status/components/detailed_status.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.js b/app/javascript/flavours/glitch/features/status/components/detailed_status.js
index 538aa3d28..9e42481c5 100644
--- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js
+++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js
@@ -35,9 +35,9 @@ export default class DetailedStatus extends ImmutablePureComponent {
     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 () {
     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')) {
         media = <AttachmentList media={status.get('media_attachments')} />;
       } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
+        const video = status.getIn(['media_attachments', 0]);
         media = (
           <Video
+            preview={video.get('preview_url')}
+            src={video.get('url')}
             sensitive={status.get('sensitive')}
-            media={status.getIn(['media_attachments', 0])}
             letterbox={settings.getIn(['media', 'letterbox'])}
             fullwidth={settings.getIn(['media', 'fullwidth'])}
-            onOpenVideo={this.props.onOpenVideo}
+            onOpenVideo={this.handleOpenVideo}
             autoplay
           />
         );