I'm using react-native-video
:
<View style={styles.videoView}>
<Video
source={{ uri: strings.sourceUri+"posts/"+this.state.videoSrc }}
ref={(ref) => { this.player = ref }}
repeat={true}
resizeMode="contain"
style={styles.videoStyle}
/>
</View>
Styles
videoView: {
justifyContent:'center',
alignItems: 'center',
flex: 1,
flexDirection: 'column',
},
videoStyle: {
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
},
So I'm fetching a video from api. And I want to show it in my flatlist. But the video is either getting small if I use resizeMode="contain"
or the size gets bigger if I used resizeMode="cover"
. How can I scale my video so that it fits in the view?
I'm using react-native-camera
. What can I try next?