From 877586a00ae43a5f8257ad43e0024d53335b0c71 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 12 Jul 2017 13:40:36 +0100 Subject: [PATCH 1/2] Issue #333 media switch fix --- ui/js/component/video/view.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/js/component/video/view.jsx b/ui/js/component/video/view.jsx index 10df6ea9a..4d52883ab 100644 --- a/ui/js/component/video/view.jsx +++ b/ui/js/component/video/view.jsx @@ -14,6 +14,13 @@ class Video extends React.PureComponent { }; } + componentWillReceiveProps(nextProps) { + // reset playing state upon change path action + if (this.state.isPlaying) { + this.state.isPlaying = false; + } + } + startPlaying() { this.setState({ isPlaying: true, From 0198c991e3b4d6a93f10aaac55a35f6391ffbd6f Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 12 Jul 2017 21:56:18 +0100 Subject: [PATCH 2/2] check that fileInfo outpoint is different before resetting media play state --- ui/js/component/video/view.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/js/component/video/view.jsx b/ui/js/component/video/view.jsx index 4d52883ab..f5cd375bd 100644 --- a/ui/js/component/video/view.jsx +++ b/ui/js/component/video/view.jsx @@ -16,11 +16,19 @@ class Video extends React.PureComponent { componentWillReceiveProps(nextProps) { // reset playing state upon change path action - if (this.state.isPlaying) { + if (!this.isMediaSame(nextProps) && this.state.isPlaying) { this.state.isPlaying = false; } } + isMediaSame(nextProps) { + return ( + this.props.fileInfo && + nextProps.fileInfo && + this.props.fileInfo.outpoint === nextProps.fileInfo.outpoint + ); + } + startPlaying() { this.setState({ isPlaying: true,