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