expo-image-picker: set initial capture mode (photo/video) for a combined native camera
f
francesco cappelli
launchCameraAsync
already lets you open the native camera with bothphoto and video capture available (
mediaTypes: ["images", "videos"]
on iOS correctly surfaces the OS camera's own built-in photo/video
toggle). What's missing: there's no way to control which mode that
combined camera opens into — it always opens in the OS default (photo),
even when the app already knows the user's intent (e.g. two separate
"take a photo" / "take a video" buttons that both open the same
combined camera for its native toggle).
iOS's
UIImagePickerController
already exposes exactly this via apublic property,
cameraCaptureMode: .photo | .video
— `expo-image-picker
just doesn't read/set it from
ImagePickerOptions` anywhereyet.
Proposed API
: `ImagePickerOptions.cameraCaptureMode?: 'photo' |
'video'
, applied when
mediaTypes includes both
images` andvideos
. iOS-only — Android's launchCameraAsync
maps a single mediatype to a single intent action (
ACTION_IMAGE_CAPTURE
/ACTION_VIDEO_CAPTURE
), there's no combined-camera intent in AOSP toapply this to.
Happy to put together the PR (types + Swift + tests + docs) — opened
a GitHub issue first per the contributing guide, but the repo's own
template says feature requests get closed there and redirected here,
so following that.
(Original GitHub issue, auto-closed per repo policy: