Hello - what would be the equivalent of the following code from Android SDK?
enum class CaptureStatus { ... }
var currentCaptureStatus: CaptureStatus? = null
InstaCameraManager.getInstance().setCaptureStatusListener(
object : ICaptureStatusListener {
override fun onCaptureStarting() {
currentCaptureStatus = CaptureStatus.STARTING_RECORDING
}
override fun onCaptureWorking() {
currentCaptureStatus = CaptureStatus.RECORDING
}
override fun onCaptureStopping() {
currentCaptureStatus = CaptureStatus.STOPPING_RECORDING
}
override fun onCaptureFinish(p0: Array<out String>?) {
currentCaptureStatus = CaptureStatus.NOT_RECORDING
}
}
)
The following piece of code returns the result but we have observed around 1 second delay (camera reports status earlier than it really starts to record):
INSCameraManager.socket().commandManager.getCurrentCaptureStatus(completion: {error, status in
let isRecording = status?.state == INSCameraCaptureState.timelapseCapture || status?.state == INSCameraCaptureState.normalCapture
callback.isRecording(isRecording)
})
Hello - what would be the equivalent of the following code from Android SDK?
The following piece of code returns the result but we have observed around 1 second delay (camera reports status earlier than it really starts to record):