From 5f8155482ab494e9b509f61baad7e3d5303176f1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 13 Apr 2017 17:01:09 +0200 Subject: [PATCH] Add overlay style to buttons, continue video after expanding it --- .../components/extended_video_player.jsx | 30 +++++++++++++++++-- .../components/components/icon_button.jsx | 28 ++++++++++++++--- .../components/components/media_gallery.jsx | 8 ++--- .../components/components/video_player.jsx | 26 ++++++++-------- .../containers/status_container.jsx | 4 +-- .../components/features/status/index.jsx | 4 +-- .../features/ui/components/video_modal.jsx | 7 +++-- app/assets/stylesheets/components.scss | 12 ++++++++ 8 files changed, 88 insertions(+), 31 deletions(-) diff --git a/app/assets/javascripts/components/components/extended_video_player.jsx b/app/assets/javascripts/components/components/extended_video_player.jsx index 603f005f9..a64515583 100644 --- a/app/assets/javascripts/components/components/extended_video_player.jsx +++ b/app/assets/javascripts/components/components/extended_video_player.jsx @@ -4,16 +4,42 @@ const ExtendedVideoPlayer = React.createClass({ propTypes: { src: React.PropTypes.string.isRequired, + time: React.PropTypes.number, controls: React.PropTypes.bool.isRequired, muted: React.PropTypes.bool.isRequired }, mixins: [PureRenderMixin], + handleLoadedData () { + if (this.props.time) { + this.video.currentTime = this.props.time; + } + }, + + componentDidMount () { + this.video.addEventListener('loadeddata', this.handleLoadedData); + }, + + componentWillUnmount () { + this.video.removeEventListener('loadeddata', this.handleLoadedData); + }, + + setRef (c) { + this.video = c; + }, + render () { return ( -
-