Insta360Develop / CameraSDK-iOS

iOS SDK to control Insta360 cameras.
33 stars 5 forks source link

Notifications about capture state #8

Open scana opened 2 years ago

scana commented 2 years ago

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)
          })
Insta360Testing commented 2 years ago

I am looking for a developer that can help me coding an app to manage an INSTA360. Can you help me?

Tianweihaihaihai commented 1 year ago

pls update to the lastest verison 2.9.42