Skip to content

Commit

Permalink
delay 0.2 sec before start camera
Browse files Browse the repository at this point in the history
  • Loading branch information
heart committed Nov 9, 2020
1 parent f344672 commit da5bd57
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sources/CarBode/CameraPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public class CameraPreview: UIView {
self.backgroundColor = UIColor.gray

DispatchQueue.global().async {
Thread.sleep(forTimeInterval: 0.2)
session.startRunning()
DispatchQueue.main.async {
let previewLayer = AVCaptureVideoPreviewLayer(session: session)
Expand Down

0 comments on commit da5bd57

Please sign in to comment.