RN-image-crop-picker: How to use Photo & Video camera and select video and photos from gallery?

2.4k Views Asked by At

Good Evening Peers, I am using react-native-image-crop-picker as the library to select photos and videos.

And when I try to open the camera to show both photo and video option I only get the photo option, Not to sure where to go from here.

    ImagePicker.openCamera({
         mediaType: 'any',
         width: Dimensions.get('window').width,
         height: Dimensions.get('window').width,
    }).then(image => {
         console.log(image);
    });

I thank you guys in advance!

1

There are 1 best solutions below

0
Ashish Saini On

Hope this help : https://github.com/ivpusic/react-native-image-crop-picker

from camera :

ImagePicker.openCamera({
  mediaType: 'video',
}).then(image => {
  console.log(image);
});

"photo", "video" are the mediaTypes