@@ -48,6 +48,7 @@ open class CameraViewController: UIViewController {
4848 var didUpdateViews = false
4949 var allowCropping = false
5050 var animationRunning = false
51+ let allowVolumeButtonCapture : Bool
5152
5253 var lastInterfaceOrientation : UIInterfaceOrientation ?
5354 open var onCompletion : CameraViewCompletion ?
@@ -158,8 +159,9 @@ open class CameraViewController: UIViewController {
158159
159160 private let allowsLibraryAccess : Bool
160161
161- public init ( croppingEnabled: Bool , allowsLibraryAccess: Bool = true , allowsSwapCameraOrientation: Bool = true , completion: @escaping CameraViewCompletion ) {
162+ public init ( croppingEnabled: Bool , allowsLibraryAccess: Bool = true , allowsSwapCameraOrientation: Bool = true , allowVolumeButtonCapture : Bool = true , completion: @escaping CameraViewCompletion ) {
162163 self . allowsLibraryAccess = allowsLibraryAccess
164+ self . allowVolumeButtonCapture = allowVolumeButtonCapture
163165 super. init ( nibName: nil , bundle: nil )
164166 onCompletion = completion
165167 allowCropping = croppingEnabled
@@ -266,6 +268,7 @@ open class CameraViewController: UIViewController {
266268 setupActions ( )
267269 checkPermissions ( )
268270 cameraView. configureFocus ( )
271+ cameraView. configureZoom ( )
269272 }
270273
271274 /**
@@ -276,7 +279,10 @@ open class CameraViewController: UIViewController {
276279 cameraView. startSession ( )
277280 addCameraObserver ( )
278281 addRotateObserver ( )
279- setupVolumeControl ( )
282+
283+ if allowVolumeButtonCapture {
284+ setupVolumeControl ( )
285+ }
280286 }
281287
282288 /**
0 commit comments