import ImagePicker from 'react-native-image-picker';
const options = {
title: 'Select Image',
takePhotoButtonTitle:'take a photo',
chooseFromlibraryButtonTitle:'choose from gallery',
quality:1
};
class Upload extends Component <{}>{
static navigationOptions = { header: null }
constructor(){
super()
this.state ={
ImageSource:null
}
}
selectPhoto(){
ImagePicker.showImagePicker(options, (response) => {
console.log('Response = ', response);
if (response.didCancel) {
console.log('User cancelled image picker');
} else if (response.error) {
console.log('ImagePicker Error: ', response.error);
} else {
let source = { uri: response.uri };
this.setState({
ImageSource: source,
});
}
});
}
- how to show videos with image in react native and by using video soucr uri state still only shows the image 2.and if using mediatypes all still is shows the image how to fix this