DBCamera icon indicating copy to clipboard operation
DBCamera copied to clipboard

Camera layer black

Open RomainPln opened this issue 10 years ago • 3 comments

Hi, I was playing around, keeping a DBCameraView controller around after removing the reset in viewDidDiseapear/Apear, and the camera somehow diseapeared, I can not reproduce the problem, any clue ?

RomainPln avatar Sep 17 '14 16:09 RomainPln

@RomainPln i'll take a look. Thanks for the suggest.

danielebogo avatar Sep 24 '14 16:09 danielebogo

which reset are you talking about? I seems to have a similar issue of camera preview layer went black too. I was working on adding overlay image functionality to the DBCameraViewController. I found out the cause was because I added another layer to the previewLayer and it blocks the main thread and somehow makes the previewLayer to go black. I solved it by delaying out that execution.

See next answer.

Hope that helps :)

@danielebogo I'm planning to send a PR for this overlay functionality as well. I think it should be useful to somebody. Please have a look. :)

hlung avatar Sep 30 '14 05:09 hlung

Sorry, after some more testing that method still doesn't solve it completely. It only works sometimes. Adding some more delay should nail it.

        [self.cameraView.previewLayer performSelector:@selector(addSublayer:)
                                           withObject:self.overlayImageView.layer
                                           afterDelay:0.5];

hlung avatar Sep 30 '14 09:09 hlung