From 5d46b8d2855c865db1adca51f01dda54e9c1a5a7 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 7 Nov 2016 19:05:32 +0100 Subject: [PATCH] Click video player to toggle playback --- .../components/components/video_player.jsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/components/components/video_player.jsx b/app/assets/javascripts/components/components/video_player.jsx index fcf966d839..209db33a7f 100644 --- a/app/assets/javascripts/components/components/video_player.jsx +++ b/app/assets/javascripts/components/components/video_player.jsx @@ -46,11 +46,23 @@ const VideoPlayer = React.createClass({ this.setState({ muted: !this.state.muted }); }, + handleVideoClick (e) { + e.stopPropagation(); + + const node = ReactDOM.findDOMNode(this).querySelector('video'); + + if (node.paused) { + node.play(); + } else { + node.pause(); + } + }, + render () { return (
-
); }