Make sure to hide poster for Windows, even though onReadyForDisplay is not implemented

This commit is contained in:
Jens Andersson 2019-06-20 09:24:12 +01:00
parent cb3e8c8281
commit 6ea65833fe

View File

@ -87,8 +87,10 @@ export default class Video extends Component {
};
_hidePoster = () => {
if (this.state.showPoster) {
this.setState({showPoster: false});
}
}
_onLoadStart = (event) => {
if (this.props.onLoadStart) {
@ -97,6 +99,10 @@ export default class Video extends Component {
};
_onLoad = (event) => {
// Need to hide poster here for windows as onReadyForDisplay is not implemented
if (Platform.OS === 'windows') {
this._hidePoster();
}
if (this.props.onLoad) {
this.props.onLoad(event.nativeEvent);
}
@ -163,9 +169,7 @@ export default class Video extends Component {
};
_onReadyForDisplay = (event) => {
if (this.state.showPoster) {
this._hidePoster();
}
if (this.props.onReadyForDisplay) {
this.props.onReadyForDisplay(event.nativeEvent);
}