While selecting a video from third-party apps like whats-app and other social media apps we are getting media does not exist error. To select a video from the gallery we are using react-native-image-crop-picker version 0.37.3 for complete error, msg refer attached image enter image description here here is the code for ImagePicker

ImagePicker.openPicker({
                width: Dimens.compressionWidth,
            // height: Dimens.compressionHeightForSnap,
            width: width,
             height: width,
            cropping: cropit,
            cropperCircleOverlay: false,
            sortOrder: 'none',
            compressImageMaxWidth: 2000,
            compressImageMaxHeight: 2000,
            compressImageQuality: Platform.OS == 'android' ? 1 : 0.8,
            // compressVideoPreset: '1280x720',
            compressVideoPreset: 'HEVC3840x2160',
            includeExif: true,
            hideBottomControls: false,
            cropperStatusBarColor: 'white',
            avoidEmptySpaceAroundImage: false,
            cropperToolbarColor: 'white',
            cropperActiveWidgetColor: 'white',
            cropperToolbarWidgetColor: Colors.primary,
            mediaType: type,
            forceJpg: false
        });

we are using react-native: 0.66.4 react": "17.0.2"

We tried to add permission for the Android app refer manifest code below

<uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="31"
        tools:ignore="ScopedStorage" />
     <uses-permission
        android:name='android.permission.READ_MEDIA_IMAGES'/>
     <uses-permission
        android:name='android.permission.READ_MEDIA_VIDEO'/>
     <uses-permission
        android:name='android.permission.READ_MEDIA_AUDIO'/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

So what we expect is user should be able to select a video from all available folders in the gallery this issue is only happening on Android devices. But if we select the same video from a recent folder, it works properly without any issues. This issue is only happening on video selection we are able to select images from the social media image folder via gallery.

0

There are 0 best solutions below