diff options
author | David Yip <yipdw@member.fsf.org> | 2018-04-12 00:20:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 00:20:19 -0500 |
commit | 0b326950bf8d38fd7c98a71d6bc1c93067c8ceb5 (patch) | |
tree | 744801a0a80321ea57de6fc7821904a2af9eec01 /app/javascript/flavours/glitch/components/extended_video_player.js | |
parent | 763cda91a83dd7e3eea7afb2dbe1ff149d849b87 (diff) | |
parent | 9073687f66a8e82d19a56ec85eef2c27f63412dc (diff) |
Merge pull request #416 from ThibG/glitch-soc/features/media-modal
Port various media modal improvements to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/components/extended_video_player.js')
-rw-r--r-- | app/javascript/flavours/glitch/components/extended_video_player.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/components/extended_video_player.js b/app/javascript/flavours/glitch/components/extended_video_player.js index f8bd067e8..9e2f6835a 100644 --- a/app/javascript/flavours/glitch/components/extended_video_player.js +++ b/app/javascript/flavours/glitch/components/extended_video_player.js @@ -11,6 +11,7 @@ export default class ExtendedVideoPlayer extends React.PureComponent { time: PropTypes.number, controls: PropTypes.bool.isRequired, muted: PropTypes.bool.isRequired, + onClick: PropTypes.func, }; handleLoadedData = () => { @@ -31,6 +32,12 @@ export default class ExtendedVideoPlayer extends React.PureComponent { this.video = c; } + handleClick = e => { + e.stopPropagation(); + const handler = this.props.onClick; + if (handler) handler(); + } + render () { const { src, muted, controls, alt } = this.props; @@ -46,6 +53,7 @@ export default class ExtendedVideoPlayer extends React.PureComponent { muted={muted} controls={controls} loop={!controls} + onClick={this.handleClick} /> </div> ); |