I can hear Audio but video not shown
Closed this issue · 3 comments
I am using react-native-video-controls. i was using Android 8, with the video source from a uri not from local and it works well.
but now i am using Android 9, when i play the video, i just hearing the audio but the video is not showing.
Here is my code :
<View
style={[this.state.playPreview == true ? styles.fullscreenVideo : styles.video, {
// marginTop: helpers.heightPercentage('3.75%'),
}]}>
<VideoPlayer
source={{ uri: this.state.courseDetail.videoUrlPreview }}
// source={require('./annum.mp4')}
showOnStart={false}
onBack={() => {
this.handleFullscreen()
this.setState({
playPreview: false
})
}}
onEnterFullscreen={this.handleFullscreen}
onExitFullscreen={this.handleFullscreen}
seekColor={colors.red}
controlTimeout={5000}
/>
</View>
Device i am using now :
Samsung A80 with OS version Android 9
i am using these library :
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-video": "^5.0.2",
"react-native-video-controls": "^2.4.0",
Please help me and i am sorry for my bad english
Just ran into this issue on ios. are you setting both height and width in your styles? setting one or the other didn't work for me and flex didn't work either..
You need to set a height of the parent component...the player will grow to fill this.
I am facing the same issue on the iOS platform. It is working fine on Android. What could be the wrong thing?
Code
<Modal
isVisible={showVideoPlayer}
backdropColor={colors.white}
onBackdropPress={onClose}
onBackButtonPress={onClose}
style={{ flex: 1 }}
>
<View style={{ flex: 1 }}>
<VideoPlayer
source={{uri: selectedVideoUri}}
repeat={false}
playInBackground={false}
resizeMode="contain"
disableVolume
disableFullscreen
onBack={onClose}
/>
</View>
</Modal>