errorMessage property
Displays an error message describing why image == null
.
Implementation
String get errorMessage {
if (!models.sockets.video.isConnected) return "The video program is not connected";
switch (data.details.status) {
case CameraStatus.CAMERA_LOADING:
return "Camera is loading...";
case CameraStatus.CAMERA_STATUS_UNDEFINED:
return "Unknown error";
case CameraStatus.CAMERA_DISCONNECTED:
return "Camera is not connected";
case CameraStatus.CAMERA_DISABLED:
return "Camera is disabled.\nClick the settings icon to enabled it.";
case CameraStatus.CAMERA_NOT_RESPONDING:
return "Camera is not responding";
case CameraStatus.FRAME_TOO_LARGE:
return "Camera is reading too much detail\nReduce the quality or resolution";
case CameraStatus.CAMERA_HAS_NO_NAME:
return "Camera has no name\nChange lib/constants.py on the video Pi";
case CameraStatus.CAMERA_ENABLED:
if (data.hasFrame()) {
return "Loading feed...";
} else {
return "Starting camera...";
}
}
return "Unknown error";
}