From 6ea65833fe907c8fba752d4497bb4c00ba098e41 Mon Sep 17 00:00:00 2001 From: Jens Andersson Date: Thu, 20 Jun 2019 09:24:12 +0100 Subject: [PATCH] Make sure to hide poster for Windows, even though onReadyForDisplay is not implemented --- Video.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Video.js b/Video.js index d9e91cd0..474d7b26 100644 --- a/Video.js +++ b/Video.js @@ -87,7 +87,9 @@ export default class Video extends Component { }; _hidePoster = () => { - this.setState({showPoster: false}); + if (this.state.showPoster) { + this.setState({showPoster: false}); + } } _onLoadStart = (event) => { @@ -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(); - } + this._hidePoster(); if (this.props.onReadyForDisplay) { this.props.onReadyForDisplay(event.nativeEvent); }