Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting MIME type before picking data #26

Open
Elamuruga opened this issue Jan 21, 2021 · 3 comments
Open

Setting MIME type before picking data #26

Elamuruga opened this issue Jan 21, 2021 · 3 comments

Comments

@Elamuruga
Copy link

Elamuruga commented Jan 21, 2021

@samsymons @jgritman @ScottPetit @jotaemepereira Is it possible to display a list of data in the picker view which matches our preferable MIME-type. i.e) We need to fetch only .mov means we need to display .mov files alone in the list. If this feature is available it will be very very useful. Could you please help me with this? Thanks in advance

@ScottPetit
Copy link
Contributor

@Elamuruga So as you've described isn't exactly possible using Apples APIs. I pushed up a new branch https://github.com/helpscout/HSAttachmentPicker/tree/feature/customizing-document-image-types that adds public access to what is passed to the UIImagePickerViewController and PHPickerConfiguration. You could set
picker.mediaTypes = [(NSString*)kUTTypeMovie] on iOS 13 and picker.pickerFilters = [PHPickerFilter.videosFilter] on iOS 14 to only show video types. I'll see about getting a PR open from that branch.

@Elamuruga
Copy link
Author

@Elamuruga So as you've described isn't exactly possible using Apples APIs. I pushed up a new branch https://github.com/helpscout/HSAttachmentPicker/tree/feature/customizing-document-image-types that adds public access to what is passed to the UIImagePickerViewController and PHPickerConfiguration. You could set
picker.mediaTypes = [(NSString*)kUTTypeMovie] on iOS 13 and picker.pickerFilters = [PHPickerFilter.videosFilter] on iOS 14 to only show video types. I'll see about getting a PR open from that branch.

@ScottPetit Thank you a lot for your immediate response. The same approach we can follow to filter image, audio, camera for image and camera to take video, etc.. know? Could you please help me with this? If it is please verify this branch and merge this to in master it will be very useful. Thanks in advance

@ScottPetit
Copy link
Contributor

@Elamuruga no this doesn't apply to camera capture and I'm not sure that's possible with the API that's currently being used. If so feel free to open a PR to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants