check that fileInfo outpoint is different before resetting media play state

This commit is contained in:
Akinwale Ariwodola 2017-07-12 21:56:18 +01:00
parent 877586a00a
commit 0198c991e3

View file

@ -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,