Volume key is not working after taking photo.

Volume key is not working after updating to iOS 14.

Especially Getting image with UIImagePicker.



If I want to get normal condition, then I'll restart my device.



Check my code for presenting UIImagePicker under.



Code Block
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera) {
let imagePicker = UIImagePickerController()
imagePicker.sourceType = UIImagePickerControllerSourceType.camera
imagePicker.modalPresentationStyle = .overCurrentContext
imagePicker.allowsEditing = false
if imagePicker.delegate == nil {
imagePicker.delegate = self
}
self.navigationController?.present(imagePicker, animated: true, completion: nil)
}

I probably miss something:

Volume key is not working after updating to iOS 14.
Especially Getting image with UIImagePicker.

What is the link between the 2 ?

Now to your code. When you paste code, please use Paste and match Style, to avoid all the extra blank lines.
Code Block
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera) {
let imagePicker = UIImagePickerController()
imagePicker.sourceType = UIImagePickerControllerSourceType.camera
imagePicker.modalPresentationStyle = .overCurrentContext
imagePicker.allowsEditing = false
if imagePicker.delegate == nil {
imagePicker.delegate = self
}
self.navigationController?.present(imagePicker, animated: true, completion: nil)
}

You don't set mediaType. Is it on purpose ?
Code Block
let mediaTypes = ["public.image"] // Or any type you want to select
picker.mediaTypes = mediaTypes

Test on line 6 appears superfluous, could keep line 7 alone.

Did you implement
Code Block
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { }

Thanks to answer it. But my problem is still happens.



  1. You don't set mediaType. Is it on purpose ?


It was just missing, My mistake. After added the codes on under your description, But nothin happens.
My volume key is not working after "taking pictures".




2. Did you implement?

Code Block
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { }

Sure I did it. Getting Image was not my problem.
Oh And when imagePicker take photo even shutter sound is missing too.
Taking photo with silence... That is quite weirdo.

I would add some log to understand what's going on.

Check sound volume (see here how to access it: https://stackoverflow.com/questions/3651252/how-to-get-audio-volume-level-and-volume-changed-notifications-on-ios), both before calling picker, during shot after closing in didFinishPickingMediaWithInfo:

I would also remove the test for nil.

Code Block
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera) {
let imagePicker = UIImagePickerController()
imagePicker.sourceType = UIImagePickerControllerSourceType.camera
let mediaTypes = ["public.image"] // Or any type you want to select
imagePicker.mediaTypes = mediaTypes
imagePicker.modalPresentationStyle = .overCurrentContext
imagePicker.allowsEditing = false
// if imagePicker.delegate == nil { // commented out
imagePicker.delegate = self
// }
self.navigationController?.present(imagePicker, animated: true, completion: nil)
}

I am also having this issue. Has there been any update on it? I tried all the solutions but my volume button is still not working after while trimming a video in UIImagePickerController

My project name was Korean ... plus And It happens on iOS 14 If your project name char is 2bytes, then That Issue will happens on iOS 14.

Check the link: https://developer.apple.com/forums/thread/670932

Volume key is not working after taking photo.
 
 
Q