Search code examples
react-nativeexporeact-native-image-pickerimagepicker

Expo-Image-Picker in React Native


Is there a way to limit video recording time using ImagePicker.launchCameraAsync()?

My code:

captureVideoObject = async () => {
        return await ImagePicker.launchCameraAsync({
            mediaTypes: ImagePicker.MediaTypeOptions.Videos,
            allowsEditing: true,
            quality: 1,
            aspect: [16, 9],
        });
    }

No way around for durationLimit as react-native-image-picker does?


Solution

  • As of expo-image-picker v8.3.0, ImagePicker.launchCameraAsync() comes with inbuilt video controls, of which you can monitor the video recording duration via it's GUI but not programmatically. Alternatively, you can achieve limiting video duration programmatically with expo-camera