Issue #333 media switch fix #348
1 changed files with 9 additions and 1 deletions
|
@ -16,11 +16,19 @@ class Video extends React.PureComponent {
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
// reset playing state upon change path action
|
// reset playing state upon change path action
|
||||||
if (this.state.isPlaying) {
|
if (!this.isMediaSame(nextProps) && this.state.isPlaying) {
|
||||||
this.state.isPlaying = false;
|
this.state.isPlaying = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isMediaSame(nextProps) {
|
||||||
|
return (
|
||||||
|
this.props.fileInfo &&
|
||||||
|
nextProps.fileInfo &&
|
||||||
|
this.props.fileInfo.outpoint === nextProps.fileInfo.outpoint
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
startPlaying() {
|
startPlaying() {
|
||||||
this.setState({
|
this.setState({
|
||||||
isPlaying: true,
|
isPlaying: true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue