Fixes bug where poster and video was displayed simultaneously

This commit is contained in:
Jens Andersson 2019-06-19 10:39:35 +01:00
parent e28ae17579
commit 6d3936de0b

View File

@ -308,15 +308,16 @@ export default class Video extends Component {
}; };
return ( return (
<React.Fragment> <View style={nativeProps.style}>
<RCTVideo ref={this._assignRoot} {...nativeProps} /> <RCTVideo
{this.props.poster && ref={this._assignRoot}
this.state.showPoster && ( {...nativeProps}
<View style={nativeProps.style}> style={StyleSheet.absoluteFill}
<Image style={posterStyle} source={{ uri: this.props.poster }} /> />
</View> {this.props.poster && this.state.showPoster && (
)} <Image style={posterStyle} source={{ uri: this.props.poster }} />
</React.Fragment> )}
</View>
); );
} }
} }