         return .portrait
     }
     
-
-    
+    
+    override func viewWillAppear(_ animated: Bool) {
+        
+        NotificationCenter.default.addObserver(self, selector: #selector(volumeChanged), name: NSNotification.Name("AVSystemController_SystemVolumeDidChangeNotification"), object: nil)
+        let mpv = MPVolumeView(frame: CGRect(x: -20, y: -20, width: 0, height: 0))
+        mpv.isHidden = false
+        
+        self.view.addSubview(mpv)
+        
+    }
+    
+    override func viewWillDisappear(_ animated: Bool) {
+        NotificationCenter.default.removeObserver(self)
+        
+    }
+    
+    func volumeChanged() -> Void {
+        btnTakePicAction("")
+    }
     
     override func viewDidLoad() {
         super.viewDidLoad()
-
-        
-    
+        
+        
+        
         let devices = AVCaptureDevice.devices().filter{ ($0 as AnyObject).hasMediaType(AVMediaTypeVideo) && ($0 as AnyObject).position == AVCaptureDevicePosition.back }
         captureDevice = devices.first as? AVCaptureDevice
         if (captureDevice?.isFlashModeSupported(.auto))!{

    let focusView = UIView(frame: CGRect(x: 0, y: 0, width: 60, height: 60))
    let btnThumbnail =  UIButton()
    let btnFlashMode = UIButton()

	open var successCallBack:((String?) -> Void)?
    open var cancelCallBack:(() -> Void)?
    open var childDir:String?
    

        
        let cameraPreview = UIView(frame: CGRect(x:0.0, y:0, width:view.bounds.size.width, height:view.bounds.size.height))
        cameraPreview.layer.addSublayer(previewLayer!)
        cameraPreview.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(touchFocus)))
        
        let line = CustomLine()
        line.frame = (previewLayer?.frame)!
