 		NSLog("PluginRTCVideoCaptureController#stopCapture Capture stopped");
 	}
 	
-	func switchCamera() -> Bool {
-		return self.startCapture()
-	}
-	
 	fileprivate func findDevice() -> AVCaptureDevice? {
 		
 		var device : AVCaptureDevice?;
 		
-		// TODO facingMode ConstrainDOMString NSDictionary
-		// TODO check deviceId
+		// facingMode ConstrainDOMString NSDictionary
 		// Check the video contraints: examine facingMode and deviceId
 		// and pick a default if neither are specified.
 		var position = AVCaptureDevice.Position.front;

				// TODO fail
				return nil;
			}
		}
		
		// TODO deviceId ConstrainDOMString NSDictionary
		let deviceId = self.getConstrainDOMStringValue(constraint: "deviceId");
		
		if (deviceId.count > 0) {
			device = AVCaptureDevice(uniqueID: deviceId)
			if (!device!.isConnected) {

		return captureDevices[0] as? AVCaptureDevice
	}
	
	fileprivate func findFormatForDevice(device: AVCaptureDevice) -> AVCaptureDevice.Format? {
		
		var selectedFormat: AVCaptureDevice.Format? = nil
		let formats: NSArray = RTCCameraVideoCapturer.supportedFormats(for: device) as NSArray
		
		let widthRange: NSDictionary = getConstrainRangeValues(constraint: "width"),
			minWidth = widthRange.object(forKey: "min") as! Int32,
			maxWidth = widthRange.object(forKey: "max") as! Int32
			
		let heightRange: NSDictionary = getConstrainRangeValues(constraint: "height"),
			minHeight = heightRange.object(forKey: "min") as! Int32,
			maxHeight = heightRange.object(forKey: "max") as! Int32
		
		let frameRateRange: NSDictionary = getConstrainRangeValues(constraint: "frameRate"),
			minFrameRate = frameRateRange.object(forKey: "min") as! Float64,
			maxFrameRate = frameRateRange.object(forKey: "max") as! Float64

		let aspectRatioRange: NSDictionary = getConstrainRangeValues(constraint: "aspectRatio"),
			minAspectRatio = aspectRatioRange.object(forKey: "min") as! Float32,
			maxAspectRatio = aspectRatioRange.object(forKey: "max") as! Float32
		

		NSLog("PluginRTCVideoCaptureController#findFormatForDevice contraints width:%i/%i, height:%i%i, aspectRatio: %f%i, frameRateRanges:%f/%f", minWidth, maxWidth, minHeight, maxHeight, minAspectRatio, maxAspectRatio, minFrameRate, maxFrameRate);
		
		for format: Any in formats {
			
