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 (
<React.Fragment>
<RCTVideo ref={this._assignRoot} {...nativeProps} />
{this.props.poster &&
this.state.showPoster && (
<View style={nativeProps.style}>
<RCTVideo
ref={this._assignRoot}
{...nativeProps}
style={StyleSheet.absoluteFill}
/>
{this.props.poster && this.state.showPoster && (
<Image style={posterStyle} source={{ uri: this.props.poster }} />
</View>
)}
</React.Fragment>
</View>
);
}
}