From 55e0e4dcfa7f67cdc28ea53738dff46344a9ed04 Mon Sep 17 00:00:00 2001 From: Charlie Martin Date: Sat, 4 Aug 2018 17:28:33 -0400 Subject: [PATCH] Remove flash between poster and video This resolves https://github.com/react-native-community/react-native-video/issues/1128 --- Video.js | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/Video.js b/Video.js index 5c6cd1d3cf..f351c3ff3f 100644 --- a/Video.js +++ b/Video.js @@ -248,35 +248,21 @@ export default class Video extends Component { onAudioBecomingNoisy: this._onAudioBecomingNoisy, }); - if (this.props.poster && this.state.showPoster) { - const posterStyle = { - position: 'absolute', - left: 0, - top: 0, - right: 0, - bottom: 0, - resizeMode: this.props.posterResizeMode || 'contain' - }; - - return ( - - - - - ); - } + const posterStyle = { + ...StyleSheet.absoluteFillObject, + resizeMode: this.props.posterResizeMode || 'contain', + }; return ( - + + + {this.props.poster && + this.state.showPoster && ( + + + + )} + ); } }