chore: rename setPlayerStatus to setPlayerPauseState

This commit is contained in:
KrzysztofMoch
2023-09-21 07:25:21 +02:00
parent 01ce04c7ac
commit 421712825b
7 changed files with 10 additions and 29 deletions

View File

@@ -728,11 +728,10 @@ class VideoPlayer extends Component {
}
const {paused} = this.state;
const {pause, play, setPlayerStatus} = this.video.current;
const {pause, play} = this.video.current;
const shouldPlay = paused === true || paused === undefined;
shouldPlay ? play() : pause();
// OR setPlayerStatus(shouldPlay);
this.setState({paused: !shouldPlay});
}}>

View File

@@ -235,11 +235,10 @@ class VideoPlayer extends Component {
return;
}
const {play, pause, setPlayerStatus} = this.video.current;
const {play, pause} = this.video.current;
const shouldPlay = !this.state.paused;
shouldPlay ? play() : pause();
// OR setPlayerStatus(shouldPlay)
this.setState({paused: shouldPlay});
}}>