 
 open class LBXScanWrapper: NSObject,AVCaptureMetadataOutputObjectsDelegate {
     
-    let device = AVCaptureDevice.default(for: AVMediaType.video)
+    let device = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeVideo)
     
     var input:AVCaptureDeviceInput?
     var output:AVCaptureMetadataOutput

                if (port as AnyObject).isKind(of: AVCaptureInput.Port.self)
                {
                    let portTmp:AVCaptureInput.Port = port as! AVCaptureInput.Port
                    if portTmp.mediaType == mediaType
                    {
                        return connectionTmp
                    }

    //MARK: ----拍照
    open func captureImage()
    {
        let stillImageConnection:AVCaptureConnection? = connectionWithMediaType(mediaType: AVMediaTypeVideo as AVMediaType, connections: (stillImageOutput?.connections)! as [AnyObject])
        
        
        stillImageOutput?.captureStillImageAsynchronously(from: stillImageConnection!, completionHandler: { (imageDataSampleBuffer, error) -> Void in
