             session.commitConfiguration()
         }
     }
-
 }

        }
    }
    
    private func createPreview() {
        session = AVCaptureSession()
        session.sessionPreset = AVCaptureSessionPresetHigh
        
        device = cameraWithPosition(currentPosition)
        
        let outputSettings = [AVVideoCodecKey:AVVideoCodecJPEG]

    public var currentPosition = AVCaptureDevicePosition.Back
    
    public func startSession() {
        dispatch_async(cameraQueue) {
            self.createSession()
            self.session?.startRunning()
        }
    }
    
