Merge pull request #348 from akinwale/issue333

Issue #333 media switch fix
This commit is contained in:
Jeremy Kauffman 2017-07-12 17:19:00 -04:00 committed by GitHub
commit 7c7bbcd064

View file

@ -14,6 +14,21 @@ class Video extends React.PureComponent {
};
}
componentWillReceiveProps(nextProps) {
// reset playing state upon change path action
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,