theta-client-react-native 1.12.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -1
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +533 -33
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +201 -50
- package/ios/ConvertUtil.swift +570 -102
- package/ios/ThetaClientReactNative.m +25 -15
- package/ios/ThetaClientReactNative.swift +296 -120
- package/lib/commonjs/capture/capture.js +12 -1
- package/lib/commonjs/capture/capture.js.map +1 -1
- package/lib/commonjs/capture/continuous-capture.js +2 -1
- package/lib/commonjs/capture/continuous-capture.js.map +1 -1
- package/lib/commonjs/capture/index.js +11 -0
- package/lib/commonjs/capture/index.js.map +1 -1
- package/lib/commonjs/capture/time-shift-manual-capture.js +168 -0
- package/lib/commonjs/capture/time-shift-manual-capture.js.map +1 -0
- package/lib/commonjs/theta-repository/access-point.js +5 -1
- package/lib/commonjs/theta-repository/access-point.js.map +1 -1
- package/lib/commonjs/theta-repository/libs/convert-utils.js +22 -0
- package/lib/commonjs/theta-repository/libs/convert-utils.js.map +1 -0
- package/lib/commonjs/theta-repository/libs/index.js +11 -0
- package/lib/commonjs/theta-repository/libs/index.js.map +1 -1
- package/lib/commonjs/theta-repository/notify-controller.js +16 -7
- package/lib/commonjs/theta-repository/notify-controller.js.map +1 -1
- package/lib/commonjs/theta-repository/options/index.js +166 -12
- package/lib/commonjs/theta-repository/options/index.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-access-info.js +30 -0
- package/lib/commonjs/theta-repository/options/option-access-info.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js +2 -0
- package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-aperture.js +24 -0
- package/lib/commonjs/theta-repository/options/option-aperture.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-camera-control-source.js +2 -0
- package/lib/commonjs/theta-repository/options/option-camera-control-source.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-camera-lock-config.js +2 -0
- package/lib/commonjs/theta-repository/options/option-camera-lock-config.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-camera-lock.js +27 -0
- package/lib/commonjs/theta-repository/options/option-camera-lock.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-camera-power.js +3 -0
- package/lib/commonjs/theta-repository/options/option-camera-power.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-compass-direction-ref.js +30 -0
- package/lib/commonjs/theta-repository/options/option-compass-direction-ref.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-exposure-compensation.js +64 -0
- package/lib/commonjs/theta-repository/options/option-exposure-compensation.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-file-format.js +29 -1
- package/lib/commonjs/theta-repository/options/option-file-format.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-gps-tag-recording.js +18 -0
- package/lib/commonjs/theta-repository/options/option-gps-tag-recording.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-microphone-noise-reduction.js +23 -0
- package/lib/commonjs/theta-repository/options/option-microphone-noise-reduction.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-mobile-network-setting.js +32 -0
- package/lib/commonjs/theta-repository/options/option-mobile-network-setting.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-network-type.js +18 -2
- package/lib/commonjs/theta-repository/options/option-network-type.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-off-delay-usb.js +61 -0
- package/lib/commonjs/theta-repository/options/option-off-delay-usb.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-preview-format.js +12 -6
- package/lib/commonjs/theta-repository/options/option-preview-format.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction-rotation-support.js +6 -0
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction-rotation-support.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-usb-connection.js +23 -0
- package/lib/commonjs/theta-repository/options/option-usb-connection.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-wlan-antenna-config.js +20 -0
- package/lib/commonjs/theta-repository/options/option-wlan-antenna-config.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-wlan-frequency-cl-mode.js +2 -0
- package/lib/commonjs/theta-repository/options/option-wlan-frequency-cl-mode.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-wlan-frequency.js +8 -2
- package/lib/commonjs/theta-repository/options/option-wlan-frequency.js.map +1 -1
- package/lib/commonjs/theta-repository/options/options.js +44 -62
- package/lib/commonjs/theta-repository/options/options.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-files.js +5 -1
- package/lib/commonjs/theta-repository/theta-files.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-info.js +3 -1
- package/lib/commonjs/theta-repository/theta-info.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-repository.js +116 -17
- package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-state/capture-status.js +6 -1
- package/lib/commonjs/theta-repository/theta-state/capture-status.js.map +1 -1
- package/lib/module/capture/capture.js +12 -1
- package/lib/module/capture/capture.js.map +1 -1
- package/lib/module/capture/continuous-capture.js +2 -1
- package/lib/module/capture/continuous-capture.js.map +1 -1
- package/lib/module/capture/index.js +1 -0
- package/lib/module/capture/index.js.map +1 -1
- package/lib/module/capture/time-shift-manual-capture.js +160 -0
- package/lib/module/capture/time-shift-manual-capture.js.map +1 -0
- package/lib/module/theta-repository/access-point.js +5 -1
- package/lib/module/theta-repository/access-point.js.map +1 -1
- package/lib/module/theta-repository/libs/convert-utils.js +16 -0
- package/lib/module/theta-repository/libs/convert-utils.js.map +1 -0
- package/lib/module/theta-repository/libs/index.js +1 -0
- package/lib/module/theta-repository/libs/index.js.map +1 -1
- package/lib/module/theta-repository/notify-controller.js +16 -7
- package/lib/module/theta-repository/notify-controller.js.map +1 -1
- package/lib/module/theta-repository/options/index.js +16 -2
- package/lib/module/theta-repository/options/index.js.map +1 -1
- package/lib/module/theta-repository/options/option-access-info.js +24 -0
- package/lib/module/theta-repository/options/option-access-info.js.map +1 -0
- package/lib/module/theta-repository/options/option-ai-auto-thumbnail.js +2 -0
- package/lib/module/theta-repository/options/option-ai-auto-thumbnail.js.map +1 -1
- package/lib/module/theta-repository/options/option-aperture.js +18 -0
- package/lib/module/theta-repository/options/option-aperture.js.map +1 -0
- package/lib/module/theta-repository/options/option-camera-control-source.js +2 -0
- package/lib/module/theta-repository/options/option-camera-control-source.js.map +1 -1
- package/lib/module/theta-repository/options/option-camera-lock-config.js +2 -0
- package/lib/module/theta-repository/options/option-camera-lock-config.js.map +1 -0
- package/lib/module/theta-repository/options/option-camera-lock.js +21 -0
- package/lib/module/theta-repository/options/option-camera-lock.js.map +1 -0
- package/lib/module/theta-repository/options/option-camera-power.js +3 -0
- package/lib/module/theta-repository/options/option-camera-power.js.map +1 -1
- package/lib/module/theta-repository/options/option-compass-direction-ref.js +24 -0
- package/lib/module/theta-repository/options/option-compass-direction-ref.js.map +1 -0
- package/lib/module/theta-repository/options/option-exposure-compensation.js +58 -0
- package/lib/module/theta-repository/options/option-exposure-compensation.js.map +1 -0
- package/lib/module/theta-repository/options/option-file-format.js +29 -1
- package/lib/module/theta-repository/options/option-file-format.js.map +1 -1
- package/lib/module/theta-repository/options/option-gps-tag-recording.js +12 -0
- package/lib/module/theta-repository/options/option-gps-tag-recording.js.map +1 -0
- package/lib/module/theta-repository/options/option-microphone-noise-reduction.js +17 -0
- package/lib/module/theta-repository/options/option-microphone-noise-reduction.js.map +1 -0
- package/lib/module/theta-repository/options/option-mobile-network-setting.js +26 -0
- package/lib/module/theta-repository/options/option-mobile-network-setting.js.map +1 -0
- package/lib/module/theta-repository/options/option-network-type.js +18 -2
- package/lib/module/theta-repository/options/option-network-type.js.map +1 -1
- package/lib/module/theta-repository/options/option-off-delay-usb.js +54 -0
- package/lib/module/theta-repository/options/option-off-delay-usb.js.map +1 -0
- package/lib/module/theta-repository/options/option-preview-format.js +12 -6
- package/lib/module/theta-repository/options/option-preview-format.js.map +1 -1
- package/lib/module/theta-repository/options/option-top-bottom-correction-rotation-support.js +2 -0
- package/lib/module/theta-repository/options/option-top-bottom-correction-rotation-support.js.map +1 -0
- package/lib/module/theta-repository/options/option-usb-connection.js +17 -0
- package/lib/module/theta-repository/options/option-usb-connection.js.map +1 -0
- package/lib/module/theta-repository/options/option-wlan-antenna-config.js +14 -0
- package/lib/module/theta-repository/options/option-wlan-antenna-config.js.map +1 -0
- package/lib/module/theta-repository/options/option-wlan-frequency-cl-mode.js +2 -0
- package/lib/module/theta-repository/options/option-wlan-frequency-cl-mode.js.map +1 -0
- package/lib/module/theta-repository/options/option-wlan-frequency.js +8 -2
- package/lib/module/theta-repository/options/option-wlan-frequency.js.map +1 -1
- package/lib/module/theta-repository/options/options.js +43 -61
- package/lib/module/theta-repository/options/options.js.map +1 -1
- package/lib/module/theta-repository/theta-files.js +5 -1
- package/lib/module/theta-repository/theta-files.js.map +1 -1
- package/lib/module/theta-repository/theta-info.js +3 -1
- package/lib/module/theta-repository/theta-info.js.map +1 -1
- package/lib/module/theta-repository/theta-repository.js +115 -19
- package/lib/module/theta-repository/theta-repository.js.map +1 -1
- package/lib/module/theta-repository/theta-state/capture-status.js +6 -1
- package/lib/module/theta-repository/theta-state/capture-status.js.map +1 -1
- package/lib/typescript/capture/capture.d.ts +11 -0
- package/lib/typescript/capture/capture.d.ts.map +1 -1
- package/lib/typescript/capture/continuous-capture.d.ts.map +1 -1
- package/lib/typescript/capture/index.d.ts +1 -0
- package/lib/typescript/capture/index.d.ts.map +1 -1
- package/lib/typescript/capture/time-shift-manual-capture.d.ts +70 -0
- package/lib/typescript/capture/time-shift-manual-capture.d.ts.map +1 -0
- package/lib/typescript/theta-repository/access-point.d.ts +11 -3
- package/lib/typescript/theta-repository/access-point.d.ts.map +1 -1
- package/lib/typescript/theta-repository/libs/convert-utils.d.ts +3 -0
- package/lib/typescript/theta-repository/libs/convert-utils.d.ts.map +1 -0
- package/lib/typescript/theta-repository/libs/index.d.ts +1 -0
- package/lib/typescript/theta-repository/libs/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/notify-controller.d.ts +3 -1
- package/lib/typescript/theta-repository/notify-controller.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/index.d.ts +16 -2
- package/lib/typescript/theta-repository/options/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-access-info.d.ts +91 -0
- package/lib/typescript/theta-repository/options/option-access-info.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-ai-auto-thumbnail.d.ts +2 -0
- package/lib/typescript/theta-repository/options/option-ai-auto-thumbnail.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-aperture.d.ts +18 -0
- package/lib/typescript/theta-repository/options/option-aperture.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts +3 -1
- package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts +2 -0
- package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-camera-lock-config.d.ts +26 -0
- package/lib/typescript/theta-repository/options/option-camera-lock-config.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-camera-lock.d.ts +21 -0
- package/lib/typescript/theta-repository/options/option-camera-lock.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-camera-power.d.ts +3 -0
- package/lib/typescript/theta-repository/options/option-camera-power.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-compass-direction-ref.d.ts +24 -0
- package/lib/typescript/theta-repository/options/option-compass-direction-ref.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-ethernet-config.d.ts +8 -4
- package/lib/typescript/theta-repository/options/option-ethernet-config.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-exposure-compensation.d.ts +58 -0
- package/lib/typescript/theta-repository/options/option-exposure-compensation.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-file-format.d.ts +42 -0
- package/lib/typescript/theta-repository/options/option-file-format.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-gps-tag-recording.d.ts +12 -0
- package/lib/typescript/theta-repository/options/option-gps-tag-recording.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-microphone-noise-reduction.d.ts +17 -0
- package/lib/typescript/theta-repository/options/option-microphone-noise-reduction.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-mobile-network-setting.d.ts +34 -0
- package/lib/typescript/theta-repository/options/option-mobile-network-setting.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-network-type.d.ts +17 -1
- package/lib/typescript/theta-repository/options/option-network-type.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-off-delay-usb.d.ts +36 -0
- package/lib/typescript/theta-repository/options/option-off-delay-usb.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-preview-format.d.ts +12 -6
- package/lib/typescript/theta-repository/options/option-preview-format.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-top-bottom-correction-rotation-support.d.ts +19 -0
- package/lib/typescript/theta-repository/options/option-top-bottom-correction-rotation-support.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-usb-connection.d.ts +17 -0
- package/lib/typescript/theta-repository/options/option-usb-connection.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-wlan-antenna-config.d.ts +14 -0
- package/lib/typescript/theta-repository/options/option-wlan-antenna-config.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-wlan-frequency-cl-mode.d.ts +20 -0
- package/lib/typescript/theta-repository/options/option-wlan-frequency-cl-mode.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts +7 -1
- package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/options.d.ts +131 -63
- package/lib/typescript/theta-repository/options/options.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-files.d.ts +4 -0
- package/lib/typescript/theta-repository/theta-files.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-info.d.ts +9 -1
- package/lib/typescript/theta-repository/theta-info.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-repository.d.ts +54 -13
- package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-state/capture-status.d.ts +5 -0
- package/lib/typescript/theta-repository/theta-state/capture-status.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/capture/capture.ts +11 -0
- package/src/capture/continuous-capture.ts +2 -4
- package/src/capture/index.ts +1 -0
- package/src/capture/time-shift-manual-capture.ts +203 -0
- package/src/theta-repository/access-point.ts +11 -3
- package/src/theta-repository/libs/convert-utils.ts +27 -0
- package/src/theta-repository/libs/index.ts +1 -0
- package/src/theta-repository/notify-controller.ts +18 -8
- package/src/theta-repository/options/index.ts +16 -2
- package/src/theta-repository/options/option-access-info.ts +108 -0
- package/src/theta-repository/options/option-ai-auto-thumbnail.ts +2 -0
- package/src/theta-repository/options/option-aperture.ts +18 -0
- package/src/theta-repository/options/option-auto-bracket.ts +3 -7
- package/src/theta-repository/options/option-camera-control-source.ts +3 -0
- package/src/theta-repository/options/option-camera-lock-config.ts +25 -0
- package/src/theta-repository/options/option-camera-lock.ts +22 -0
- package/src/theta-repository/options/option-camera-power.ts +3 -0
- package/src/theta-repository/options/option-compass-direction-ref.ts +25 -0
- package/src/theta-repository/options/option-ethernet-config.ts +8 -4
- package/src/theta-repository/options/option-exposure-compensation.ts +59 -0
- package/src/theta-repository/options/option-file-format.ts +29 -0
- package/src/theta-repository/options/option-gps-tag-recording.ts +13 -0
- package/src/theta-repository/options/option-microphone-noise-reduction.ts +18 -0
- package/src/theta-repository/options/option-mobile-network-setting.ts +38 -0
- package/src/theta-repository/options/option-network-type.ts +17 -1
- package/src/theta-repository/options/option-off-delay-usb.ts +57 -0
- package/src/theta-repository/options/option-preview-format.ts +12 -6
- package/src/theta-repository/options/option-top-bottom-correction-rotation-support.ts +19 -0
- package/src/theta-repository/options/option-usb-connection.ts +18 -0
- package/src/theta-repository/options/option-wlan-antenna-config.ts +15 -0
- package/src/theta-repository/options/option-wlan-frequency-cl-mode.ts +19 -0
- package/src/theta-repository/options/option-wlan-frequency.ts +7 -1
- package/src/theta-repository/options/options.ts +133 -71
- package/src/theta-repository/theta-files.ts +4 -0
- package/src/theta-repository/theta-info.ts +9 -1
- package/src/theta-repository/theta-repository.ts +117 -30
- package/src/theta-repository/theta-state/capture-status.ts +5 -0
- package/theta-client-react-native.podspec +1 -1
|
@@ -29,6 +29,9 @@ class ThetaClientReactNativeModule(
|
|
|
29
29
|
var timeShiftCaptureBuilder: TimeShiftCapture.Builder? = null
|
|
30
30
|
var timeShiftCapture: TimeShiftCapture? = null
|
|
31
31
|
var timeShiftCapturing: TimeShiftCapturing? = null
|
|
32
|
+
var timeShiftManualCaptureBuilder: TimeShiftManualCapture.Builder? = null
|
|
33
|
+
var timeShiftManualCapture: TimeShiftManualCapture? = null
|
|
34
|
+
var timeShiftManualCapturing: TimeShiftManualCapturing? = null
|
|
32
35
|
var videoCaptureBuilder: VideoCapture.Builder? = null
|
|
33
36
|
var videoCapture: VideoCapture? = null
|
|
34
37
|
var videoCapturing: VideoCapturing? = null
|
|
@@ -88,6 +91,21 @@ class ThetaClientReactNativeModule(
|
|
|
88
91
|
override fun getConstants(): MutableMap<String, Any> =
|
|
89
92
|
hashMapOf("DEFAULT_EVENT_NAME" to EVENT_NAME)
|
|
90
93
|
|
|
94
|
+
|
|
95
|
+
val apiLogListener = { message: String ->
|
|
96
|
+
val params = Arguments.createMap()
|
|
97
|
+
params.putString(KEY_NOTIFY_PARAM_MESSAGE, message)
|
|
98
|
+
sendNotifyEvent(
|
|
99
|
+
toNotify(NOTIFY_API_LOG, params)
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@ReactMethod
|
|
104
|
+
fun setApiLogListener(enabled: Boolean, promise: Promise) {
|
|
105
|
+
com.ricoh360.thetaclient.setApiLogListener(if (enabled) apiLogListener else null)
|
|
106
|
+
promise.resolve(null)
|
|
107
|
+
}
|
|
108
|
+
|
|
91
109
|
/**
|
|
92
110
|
* initialize Theta repository with endpoint
|
|
93
111
|
* @param endpoint endpoint to connect THETA
|
|
@@ -105,6 +123,9 @@ class ThetaClientReactNativeModule(
|
|
|
105
123
|
timeShiftCaptureBuilder = null
|
|
106
124
|
timeShiftCapture = null
|
|
107
125
|
timeShiftCapturing = null
|
|
126
|
+
timeShiftManualCaptureBuilder = null
|
|
127
|
+
timeShiftManualCapture = null
|
|
128
|
+
timeShiftManualCapturing = null
|
|
108
129
|
videoCaptureBuilder = null
|
|
109
130
|
videoCapture = null
|
|
110
131
|
videoCapturing = null
|
|
@@ -302,7 +323,9 @@ class ThetaClientReactNativeModule(
|
|
|
302
323
|
}
|
|
303
324
|
val fileList = mutableListOf<String>()
|
|
304
325
|
for (index in 0..(fileUrls.size() - 1)) {
|
|
305
|
-
|
|
326
|
+
fileUrls.getString(index)?.let {
|
|
327
|
+
fileList.add(it)
|
|
328
|
+
}
|
|
306
329
|
}
|
|
307
330
|
launch {
|
|
308
331
|
try {
|
|
@@ -451,6 +474,7 @@ class ThetaClientReactNativeModule(
|
|
|
451
474
|
"data:image/jpeg;base64," +
|
|
452
475
|
packet.first.copyOfRange(0, packet.second).toBase64()
|
|
453
476
|
)
|
|
477
|
+
param.putInt("dataSize", packet.second)
|
|
454
478
|
reactApplicationContext
|
|
455
479
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
456
480
|
.emit(EVENT_NAME, param)
|
|
@@ -690,6 +714,127 @@ class ThetaClientReactNativeModule(
|
|
|
690
714
|
timeShiftCapturing?.cancelCapture()
|
|
691
715
|
}
|
|
692
716
|
|
|
717
|
+
/**
|
|
718
|
+
* getTimeShiftManualCaptureBuilder - get manual time-shift builder from repository
|
|
719
|
+
*/
|
|
720
|
+
@ReactMethod
|
|
721
|
+
fun getTimeShiftManualCaptureBuilder(promise: Promise) {
|
|
722
|
+
val theta = theta
|
|
723
|
+
if (theta == null) {
|
|
724
|
+
promise.reject(Exception(messageNotInit))
|
|
725
|
+
return
|
|
726
|
+
}
|
|
727
|
+
timeShiftManualCaptureBuilder = theta.getTimeShiftManualCaptureBuilder()
|
|
728
|
+
promise.resolve(true)
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* buildTimeShiftManualCapture - build manual time-shift
|
|
733
|
+
* @param options option to execute manual time-shift
|
|
734
|
+
* @param promise Promise for buildTimeShiftManualCapture
|
|
735
|
+
*/
|
|
736
|
+
@ReactMethod
|
|
737
|
+
fun buildTimeShiftManualCapture(options: ReadableMap, promise: Promise) {
|
|
738
|
+
if (theta == null) {
|
|
739
|
+
promise.reject(Exception(messageNotInit))
|
|
740
|
+
return
|
|
741
|
+
}
|
|
742
|
+
if (timeShiftManualCaptureBuilder == null) {
|
|
743
|
+
promise.reject(Exception("no timeShiftManualCaptureBuilder"))
|
|
744
|
+
return
|
|
745
|
+
}
|
|
746
|
+
timeShiftManualCapture = null
|
|
747
|
+
timeShiftManualCapturing = null
|
|
748
|
+
launch {
|
|
749
|
+
try {
|
|
750
|
+
timeShiftManualCaptureBuilder?.let {
|
|
751
|
+
setCaptureBuilderParams(optionMap = options, builder = it)
|
|
752
|
+
setTimeShiftManualCaptureBuilderParams(optionMap = options, builder = it)
|
|
753
|
+
timeShiftManualCapture = it.build()
|
|
754
|
+
}
|
|
755
|
+
promise.resolve(true)
|
|
756
|
+
} catch (t: Throwable) {
|
|
757
|
+
promise.reject(t)
|
|
758
|
+
} finally {
|
|
759
|
+
timeShiftManualCaptureBuilder = null
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* startTimeShiftManualCapture - start manual time-shift
|
|
766
|
+
* @param promise promise for startTimeShiftManualCapture
|
|
767
|
+
*/
|
|
768
|
+
@ReactMethod
|
|
769
|
+
fun startTimeShiftManualCapture(promise: Promise) {
|
|
770
|
+
if (theta == null) {
|
|
771
|
+
promise.reject(Exception(messageNotInit))
|
|
772
|
+
return
|
|
773
|
+
}
|
|
774
|
+
if (timeShiftManualCapture == null) {
|
|
775
|
+
promise.reject(Exception("no timeShiftManualCapture"))
|
|
776
|
+
return
|
|
777
|
+
}
|
|
778
|
+
class StartCaptureCallback : TimeShiftManualCapture.StartCaptureCallback {
|
|
779
|
+
override fun onCaptureCompleted(fileUrl: String?) {
|
|
780
|
+
promise.resolve(fileUrl)
|
|
781
|
+
timeShiftManualCapturing = null
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
override fun onProgress(completion: Float) {
|
|
785
|
+
sendNotifyEvent(
|
|
786
|
+
toNotify(NOTIFY_TIMESHIFT_MANUAL_PROGRESS, toCaptureProgressNotifyParam(value = completion))
|
|
787
|
+
)
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
override fun onCapturing(status: CapturingStatusEnum) {
|
|
791
|
+
super.onCapturing(status)
|
|
792
|
+
sendNotifyEvent(
|
|
793
|
+
toNotify(NOTIFY_TIMESHIFT_MANUAL_CAPTURING, toCapturingNotifyParam(status = status))
|
|
794
|
+
)
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
override fun onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
798
|
+
promise.reject(exception)
|
|
799
|
+
timeShiftManualCapturing = null
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
override fun onStopFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
803
|
+
sendNotifyEvent(
|
|
804
|
+
toNotify(
|
|
805
|
+
NOTIFY_TIMESHIFT_MANUAL_STOP_ERROR,
|
|
806
|
+
toMessageNotifyParam(exception.message ?: exception.toString())
|
|
807
|
+
)
|
|
808
|
+
)
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
timeShiftManualCapturing = timeShiftManualCapture?.startCapture(StartCaptureCallback())
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* startTimeShiftManualSecondCapture - start manual time-shift second capture
|
|
816
|
+
* @param promise promise for startTimeShiftManualSecondCapture
|
|
817
|
+
*/
|
|
818
|
+
@ReactMethod
|
|
819
|
+
fun startTimeShiftManualSecondCapture(promise: Promise) {
|
|
820
|
+
if (theta == null) {
|
|
821
|
+
throw Exception(messageNotInit)
|
|
822
|
+
}
|
|
823
|
+
timeShiftManualCapturing?.startSecondCapture()
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* cancelTimeShiftManualCapture - stop manual time-shift
|
|
828
|
+
* @param promise promise for cancelTimeShiftManualCapture
|
|
829
|
+
*/
|
|
830
|
+
@ReactMethod
|
|
831
|
+
fun cancelTimeShiftManualCapture(promise: Promise) {
|
|
832
|
+
if (theta == null) {
|
|
833
|
+
throw Exception(messageNotInit)
|
|
834
|
+
}
|
|
835
|
+
timeShiftManualCapturing?.cancelCapture()
|
|
836
|
+
}
|
|
837
|
+
|
|
693
838
|
/**
|
|
694
839
|
* getVideoCaptureBuilder - get video capture builder
|
|
695
840
|
* @param promise promise to set result
|
|
@@ -1548,6 +1693,27 @@ class ThetaClientReactNativeModule(
|
|
|
1548
1693
|
}
|
|
1549
1694
|
}
|
|
1550
1695
|
|
|
1696
|
+
/**
|
|
1697
|
+
* reboot - reboot THETA via repository
|
|
1698
|
+
* @param promise promise to set result
|
|
1699
|
+
*/
|
|
1700
|
+
@ReactMethod
|
|
1701
|
+
fun reboot(promise: Promise) {
|
|
1702
|
+
val theta = theta
|
|
1703
|
+
if (theta == null) {
|
|
1704
|
+
promise.reject(Exception(messageNotInit))
|
|
1705
|
+
return
|
|
1706
|
+
}
|
|
1707
|
+
launch {
|
|
1708
|
+
try {
|
|
1709
|
+
theta.reboot()
|
|
1710
|
+
promise.resolve(true)
|
|
1711
|
+
} catch (t: Throwable) {
|
|
1712
|
+
promise.reject(t)
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1551
1717
|
/**
|
|
1552
1718
|
* reset - reset THETA via repository
|
|
1553
1719
|
* @param promise promise to set result
|
|
@@ -1714,22 +1880,12 @@ class ThetaClientReactNativeModule(
|
|
|
1714
1880
|
|
|
1715
1881
|
/**
|
|
1716
1882
|
* setAccessPointDynamically - set access point with dhcp
|
|
1717
|
-
* @param
|
|
1718
|
-
* @param ssidStealth ssid is stealth or not
|
|
1719
|
-
* @param authMode auth mode to connect
|
|
1720
|
-
* @param password password to connect with auth
|
|
1721
|
-
* @param connectionPriority connection priority
|
|
1722
|
-
* @param proxy Proxy information to be used for the access point.
|
|
1883
|
+
* @param params parameters of setAccessPointDynamically
|
|
1723
1884
|
* @param promise promise to set result
|
|
1724
1885
|
*/
|
|
1725
1886
|
@ReactMethod
|
|
1726
1887
|
fun setAccessPointDynamically(
|
|
1727
|
-
|
|
1728
|
-
ssidStealth: Boolean,
|
|
1729
|
-
authMode: String,
|
|
1730
|
-
password: String,
|
|
1731
|
-
connectionPriority: Int,
|
|
1732
|
-
proxy: ReadableMap?,
|
|
1888
|
+
params: ReadableMap,
|
|
1733
1889
|
promise: Promise
|
|
1734
1890
|
) {
|
|
1735
1891
|
val theta = theta
|
|
@@ -1739,13 +1895,14 @@ class ThetaClientReactNativeModule(
|
|
|
1739
1895
|
}
|
|
1740
1896
|
launch {
|
|
1741
1897
|
try {
|
|
1898
|
+
val accessPointParams = toSetAccessPointParams(params)
|
|
1742
1899
|
theta.setAccessPointDynamically(
|
|
1743
|
-
ssid,
|
|
1744
|
-
ssidStealth,
|
|
1745
|
-
|
|
1746
|
-
password,
|
|
1747
|
-
connectionPriority,
|
|
1748
|
-
|
|
1900
|
+
accessPointParams.ssid,
|
|
1901
|
+
accessPointParams.ssidStealth,
|
|
1902
|
+
accessPointParams.authMode,
|
|
1903
|
+
accessPointParams.password,
|
|
1904
|
+
accessPointParams.connectionPriority,
|
|
1905
|
+
accessPointParams.proxy,
|
|
1749
1906
|
)
|
|
1750
1907
|
promise.resolve(true)
|
|
1751
1908
|
} catch (t: Throwable) {
|
|
@@ -1756,28 +1913,12 @@ class ThetaClientReactNativeModule(
|
|
|
1756
1913
|
|
|
1757
1914
|
/**
|
|
1758
1915
|
* setAccessPointStatically - set access point with static connection info
|
|
1759
|
-
* @param
|
|
1760
|
-
* @param ssidStealth ssid is stealth or not
|
|
1761
|
-
* @param authMode auth mode to connect
|
|
1762
|
-
* @param password password to connect with auth
|
|
1763
|
-
* @param connectionPriority connection priority
|
|
1764
|
-
* @param ipAddress static ipaddress to connect
|
|
1765
|
-
* @param subnetMask subnet mask for ip address
|
|
1766
|
-
* @param defaultGateway default gateway address
|
|
1916
|
+
* @param params parameters of setAccessPointStatically
|
|
1767
1917
|
* @param promise promise to set result
|
|
1768
|
-
* @param proxy Proxy information to be used for the access point.
|
|
1769
1918
|
*/
|
|
1770
1919
|
@ReactMethod
|
|
1771
1920
|
fun setAccessPointStatically(
|
|
1772
|
-
|
|
1773
|
-
ssidStealth: Boolean,
|
|
1774
|
-
authMode: String,
|
|
1775
|
-
password: String,
|
|
1776
|
-
connectionPriority: Int,
|
|
1777
|
-
ipAddress: String,
|
|
1778
|
-
subnetMask: String,
|
|
1779
|
-
defaultGateway: String,
|
|
1780
|
-
proxy: ReadableMap?,
|
|
1921
|
+
params: ReadableMap,
|
|
1781
1922
|
promise: Promise
|
|
1782
1923
|
) {
|
|
1783
1924
|
val theta = theta
|
|
@@ -1787,16 +1928,20 @@ class ThetaClientReactNativeModule(
|
|
|
1787
1928
|
}
|
|
1788
1929
|
launch {
|
|
1789
1930
|
try {
|
|
1931
|
+
val accessPointParams = toSetAccessPointParams(params)
|
|
1932
|
+
val staticallyParams = toSetAccessPointStaticallyParams(params)
|
|
1790
1933
|
theta.setAccessPointStatically(
|
|
1791
|
-
ssid,
|
|
1792
|
-
ssidStealth,
|
|
1793
|
-
|
|
1794
|
-
password,
|
|
1795
|
-
connectionPriority,
|
|
1796
|
-
ipAddress,
|
|
1797
|
-
subnetMask,
|
|
1798
|
-
defaultGateway,
|
|
1799
|
-
|
|
1934
|
+
accessPointParams.ssid,
|
|
1935
|
+
accessPointParams.ssidStealth,
|
|
1936
|
+
accessPointParams.authMode,
|
|
1937
|
+
accessPointParams.password,
|
|
1938
|
+
accessPointParams.connectionPriority,
|
|
1939
|
+
staticallyParams.ipAddress,
|
|
1940
|
+
staticallyParams.subnetMask,
|
|
1941
|
+
staticallyParams.defaultGateway,
|
|
1942
|
+
accessPointParams.dns1,
|
|
1943
|
+
accessPointParams.dns2,
|
|
1944
|
+
accessPointParams.proxy
|
|
1800
1945
|
)
|
|
1801
1946
|
promise.resolve(true)
|
|
1802
1947
|
} catch (t: Throwable) {
|
|
@@ -1889,8 +2034,9 @@ class ThetaClientReactNativeModule(
|
|
|
1889
2034
|
try {
|
|
1890
2035
|
val optionNameList = mutableListOf<ThetaRepository.OptionNameEnum>()
|
|
1891
2036
|
for (index in 0..(optionNames.size() - 1)) {
|
|
1892
|
-
|
|
1893
|
-
|
|
2037
|
+
optionNames.getString(index)?.let {
|
|
2038
|
+
optionNameList.add(ThetaRepository.OptionNameEnum.valueOf(it))
|
|
2039
|
+
}
|
|
1894
2040
|
}
|
|
1895
2041
|
val options = theta.getMySetting(optionNameList)
|
|
1896
2042
|
promise.resolve(toResult(options = options))
|
|
@@ -2109,8 +2255,9 @@ class ThetaClientReactNativeModule(
|
|
|
2109
2255
|
try {
|
|
2110
2256
|
val pluginList = mutableListOf<String>()
|
|
2111
2257
|
for (index in 0..(plugins.size() - 1)) {
|
|
2112
|
-
|
|
2113
|
-
|
|
2258
|
+
plugins.getString(index)?.let {
|
|
2259
|
+
pluginList.add(it)
|
|
2260
|
+
}
|
|
2114
2261
|
}
|
|
2115
2262
|
theta.setPluginOrders(pluginList)
|
|
2116
2263
|
promise.resolve(true)
|
|
@@ -2195,6 +2342,9 @@ class ThetaClientReactNativeModule(
|
|
|
2195
2342
|
const val NOTIFY_TIMESHIFT_PROGRESS = "TIME-SHIFT-PROGRESS"
|
|
2196
2343
|
const val NOTIFY_TIMESHIFT_STOP_ERROR = "TIME-SHIFT-STOP-ERROR"
|
|
2197
2344
|
const val NOTIFY_TIMESHIFT_CAPTURING = "TIME-SHIFT-CAPTURING"
|
|
2345
|
+
const val NOTIFY_TIMESHIFT_MANUAL_PROGRESS = "TIME-SHIFT-MANUAL-PROGRESS"
|
|
2346
|
+
const val NOTIFY_TIMESHIFT_MANUAL_STOP_ERROR = "TIME-SHIFT-MANUAL-STOP-ERROR"
|
|
2347
|
+
const val NOTIFY_TIMESHIFT_MANUAL_CAPTURING = "TIME-SHIFT-MANUAL-CAPTURING"
|
|
2198
2348
|
const val NOTIFY_VIDEO_CAPTURE_STOP_ERROR = "VIDEO-CAPTURE-STOP-ERROR"
|
|
2199
2349
|
const val NOTIFY_VIDEO_CAPTURE_CAPTURING = "VIDEO-CAPTURE-CAPTURING"
|
|
2200
2350
|
const val NOTIFY_VIDEO_CAPTURE_STARTED = "VIDEO-CAPTURE-STARTED"
|
|
@@ -2217,5 +2367,6 @@ class ThetaClientReactNativeModule(
|
|
|
2217
2367
|
const val NOTIFY_EVENT_WEBSOCKET_EVENT = "EVENT-WEBSOCKET-EVENT"
|
|
2218
2368
|
const val NOTIFY_EVENT_WEBSOCKET_CLOSE = "EVENT-WEBSOCKET-CLOSE"
|
|
2219
2369
|
const val NOTIFY_CONVERT_VIDEO_FORMATS_PROGRESS = "CONVERT-VIDEO-FORMATS-PROGRESS"
|
|
2370
|
+
const val NOTIFY_API_LOG = "API-LOG"
|
|
2220
2371
|
}
|
|
2221
2372
|
}
|