Skip to content

Commit

Permalink
Merge pull request #1167 from cmmartin/patch-2
Browse files Browse the repository at this point in the history
Remove flash between poster and video
  • Loading branch information
cobarx authored Sep 27, 2018
2 parents 2e3ded7 + 55e0e4d commit 95cea76
Showing 1 changed file with 13 additions and 27 deletions.
40 changes: 13 additions & 27 deletions Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<View style={nativeProps.style}>
<RCTVideo
ref={this._assignRoot}
{...nativeProps}
/>
<Image
style={posterStyle}
source={{uri: this.props.poster}}
/>
</View>
);
}
const posterStyle = {
...StyleSheet.absoluteFillObject,
resizeMode: this.props.posterResizeMode || 'contain',
};

return (
<RCTVideo
ref={this._assignRoot}
{...nativeProps}
/>
<React.Fragment>
<RCTVideo ref={this._assignRoot} {...nativeProps} />
{this.props.poster &&
this.state.showPoster && (
<View style={nativeProps.style}>
<Image style={posterStyle} source={{ uri: this.props.poster }} />
</View>
)}
</React.Fragment>
);
}
}
Expand Down

0 comments on commit 95cea76

Please sign in to comment.