diff --git a/app/assets/javascripts/components/components/status.jsx b/app/assets/javascripts/components/components/status.jsx index 8cdbd5625d..020d90a126 100644 --- a/app/assets/javascripts/components/components/status.jsx +++ b/app/assets/javascripts/components/components/status.jsx @@ -5,6 +5,7 @@ import PureRenderMixin from 'react-addons-pure-render-mixin'; import IconButton from './icon_button'; import DisplayName from './display_name'; import MediaGallery from './media_gallery'; +import VideoPlayer from './video_player'; import { hashHistory } from 'react-router'; const Status = React.createClass({ @@ -65,7 +66,11 @@ const Status = React.createClass({ } if (status.get('media_attachments').size > 0) { - media = ; + if (status.getIn(['media_attachments', 0, 'type']) === 'video') { + media = ; + } else { + media = ; + } } return ( diff --git a/app/assets/javascripts/components/components/video_player.jsx b/app/assets/javascripts/components/components/video_player.jsx new file mode 100644 index 0000000000..e680fb206e --- /dev/null +++ b/app/assets/javascripts/components/components/video_player.jsx @@ -0,0 +1,21 @@ +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PureRenderMixin from 'react-addons-pure-render-mixin'; + +const VideoPlayer = React.createClass({ + propTypes: { + media: ImmutablePropTypes.map.isRequired + }, + + mixins: [PureRenderMixin], + + render () { + return ( +
+
+ ); + } + +}); + +export default VideoPlayer; diff --git a/app/views/api/statuses/show.rabl b/app/views/api/statuses/show.rabl index 047436b611..2f30f68cca 100644 --- a/app/views/api/statuses/show.rabl +++ b/app/views/api/statuses/show.rabl @@ -18,7 +18,7 @@ child :account do end child :media_attachments, object_root: false do - attributes :id, :remote_url + attributes :id, :remote_url, :type node(:url) { |media| full_asset_url(media.file.url) } node(:preview_url) { |media| full_asset_url(media.file.url(:small)) }