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