Skip to main content

Pick Photos & Videos

Pick Photos & Videos

Use this component to pick photos & videos from the device's MediaGallery/PhotoGallery or FileSystem.

To get started using it, you must use KmpMediaPicker. All functions are thread safe and main thread safe.

Below are the functions available:


_7
KmpMediaPicker.pickPhotoFromGallery{
_7
val photoPath = it // on success returns the file path of where the photo is stored
_7
}
_7
_7
KmpMediaPicker.pickVideoFromGallery{
_7
val videoPath = it // on success returns the file path of where the video is stored
_7
}

Android Setup

On android please add the following into your manifest file


_2
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
_2
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

iOS Setup

Add the following into your device's info.plist file:


_2
<key>NSPhotoLibraryUsageDescription</key>
_2
<string>Reason for why your app needs access to the photo gallery</string>