imaginary-cloud / CameraManager

Simple Swift class to provide all the configurations you need to create custom camera view in your app
MIT License
1.37k stars 323 forks source link

(edit) The owner of this repo is M.I.A. (/edit) Blacked out exposure after re-opening viewcontroller #233

Open ded opened 4 years ago

ded commented 4 years ago

Hi there, Using your Hello world example from the README, and [your pretty straight forward documentation], I'm experiencing an issue where the exposure / capture gets very blurry, and/or darkened after opening an instance multiple times over from a typical present() (using the iOS 13 card style - you know, the kind where you can dismiss by swiping down).

Here are my settings:

class PersonalVideoViewController: UIViewController {
  @IBOutlet weak var videoView: UIView! // from storyboard
  override func viewDidLoad() {
    cameraManager.cameraDevice = .front // this is a requirement, not going to change this.
    cameraManager.cameraOutputQuality = .high // changing this didn't make a difference
    cameraManager.flashMode = .off // changing this didn't make a difference
    cameraManager.showAccessPermissionPopupAutomatically = false
    cameraManager.exposureMode = .autoExpose // changing this didn't make a difference
    let _ = self.cameraManager.addPreviewLayerToView(self.videoView, newCameraOutputMode: .videoWithMic)
  }
}

I've created a screen recording illustrating the issue as an attempt to integrate into our application.

https://www.dropbox.com/home/Development/video?preview=Video+Jul+16%2C+8+25+35+PM.mp4

Notice it's called as a self.present(myVideoController). I attempt to adjust some exposure settings during the first pass. Then dismiss... then re-open. The problem worsens. Then I attempt to increase the exposure (because it got too dark), then everything gets too blurry. I dismiss it... re-open... and then the screen start back at a very-dark underexposed image again.

To give a concession that I'm willing to sacrifice — The complete black screen as it's booting up seems pretty normal to me (this happens on Instagram too when you open their camera — so that's ok).

Any ideas why I would be experiencing this?

ded commented 4 years ago

Here is how it's being presented from the base controller. As mentioned. Nothing crazy.


let storyboard = UIStoryboard(name: "Settings", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "PersonalVideoViewController") as! PersonalVideoViewController
self.present(vc, animated: true, completion: nil)

iPhone XS 13.5.1

ded commented 4 years ago

Circling back. Hello.

ded commented 4 years ago

Is this thing working?

ded commented 4 years ago

Would you mind at least letting people know you no longer plan on maintaining the project? It might help others to move on to alternative options.

ded commented 4 years ago

Anyone else here? Is this guy on vacation?

ded commented 4 years ago

Submitting issues here is obviously pointless and a waste of time.

gamafranco commented 4 years ago

Pull requests work better.

Sent from my iPhone

On 25 Jul 2020, at 19:37, Dustin Diaz notifications@github.com wrote:

 Submitting issues here is obviously pointless and a waste of time.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ded commented 4 years ago

I understand how open source works. I’ve reported a bug on a library you wrote. It’s common decency to at least reply with “I’m sorry I don’t have an answer right now” instead of waiting 10 days to leave a snarky remark to one of your supporters.

gamafranco commented 4 years ago

It’s all in the tone Dustin. No answer doesn’t give you the right to start offending people.

Sent from my iPhone

On 26 Jul 2020, at 02:32, Dustin Diaz notifications@github.com wrote:

 I understand how open source works. I’ve reported a bug on a library you wrote. It’s common decency to at least reply with “I’m sorry I don’t have an answer right now” instead of waiting 10 days to leave a snarky remark to one of your supporters.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

tesddev commented 2 years ago

Would have loved if this issue was solved.

tesddev commented 2 years ago

So after not giving up on this library, I got a workaround for it. All you need do is call resumeCaptureSession() on the cameraManager in your viewWillAppear(); and stopCaptureSession() in your viewWillDisappear().


override func viewWillAppear(_ animated: Bool) {
        self.cameraManager.resumeCaptureSession()
}

and also in your viewWillDisappear


override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        cameraManager.stopCaptureSession()
}