employ onPlaybackRateChange instead to smooth the poster disappearance (#411)
This commit is contained in:
8
Video.js
8
Video.js
@@ -58,10 +58,6 @@ export default class Video extends Component {
|
||||
};
|
||||
|
||||
_onProgress = (event) => {
|
||||
if (this.state.showPoster) {
|
||||
this.setState({showPoster: false});
|
||||
}
|
||||
|
||||
if (this.props.onProgress) {
|
||||
this.props.onProgress(event.nativeEvent);
|
||||
}
|
||||
@@ -126,6 +122,10 @@ export default class Video extends Component {
|
||||
};
|
||||
|
||||
_onPlaybackRateChange = (event) => {
|
||||
if (this.state.showPoster && (event.nativeEvent.playbackRate === 1)) {
|
||||
this.setState({showPoster: false});
|
||||
}
|
||||
|
||||
if (this.props.onPlaybackRateChange) {
|
||||
this.props.onPlaybackRateChange(event.nativeEvent);
|
||||
}
|
||||
|
Reference in New Issue
Block a user