Remove flash between poster and video
This resolves https://github.com/react-native-community/react-native-video/issues/1128
This commit is contained in:
parent
91194edbc9
commit
55e0e4dcfa
40
Video.js
40
Video.js
@ -248,35 +248,21 @@ export default class Video extends Component {
|
|||||||
onAudioBecomingNoisy: this._onAudioBecomingNoisy,
|
onAudioBecomingNoisy: this._onAudioBecomingNoisy,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.props.poster && this.state.showPoster) {
|
const posterStyle = {
|
||||||
const posterStyle = {
|
...StyleSheet.absoluteFillObject,
|
||||||
position: 'absolute',
|
resizeMode: this.props.posterResizeMode || 'contain',
|
||||||
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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RCTVideo
|
<React.Fragment>
|
||||||
ref={this._assignRoot}
|
<RCTVideo ref={this._assignRoot} {...nativeProps} />
|
||||||
{...nativeProps}
|
{this.props.poster &&
|
||||||
/>
|
this.state.showPoster && (
|
||||||
|
<View style={nativeProps.style}>
|
||||||
|
<Image style={posterStyle} source={{ uri: this.props.poster }} />
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user