YPImagePicker icon indicating copy to clipboard operation
YPImagePicker copied to clipboard

When "config.library.mediaType = YPlibraryMediaType.photoAndVideo", I only want to choose photo or only video. How can i do.

Open Songyeyaosong opened this issue 5 years ago • 2 comments

First of all, Sorry for my poor English. When "config.library.mediaType = YPlibraryMediaType.photoAndVideo". We can both choose photo and video. But I only want to choose photo or video. So when I set config.library.mediaType = YPlibraryMediaType.photo. There is only one way to select the video that is use YPImagePicker to record a video. So how to do that when I choose the photo then I can't choose video or when I choose the video then I can't choose photo when "config.library.mediaType = YPlibraryMediaType.photoAndVideo"?

Songyeyaosong avatar Dec 10 '20 07:12 Songyeyaosong

@Songyeyaosong I don't think this library has the capability to do what you want. You would have to show a prompt to the user asking if they would like to select a photo or video and then based on that choice, present the media picker with the correct configuration. You could also fork this library and add a case photoOrVideo to YPlibraryMediaType and implement the logic yourself.

lazyvar avatar Dec 16 '20 12:12 lazyvar

    case .photo:
        config.screens = [.photo, .library]
        config.library.mediaType = .photo
    case .video:
        config.screens = [.library, .video]
        config.library.mediaType = .video

Please see if this may help you @Songyeyaosong

riazhazan avatar Mar 01 '21 06:03 riazhazan