theta-client-react-native 1.12.0 → 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 +573 -105
- package/ios/ThetaClientReactNative.m +25 -15
- package/ios/ThetaClientReactNative.swift +302 -121
- 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/multi-bracket-capture.js +13 -2
- package/lib/commonjs/capture/multi-bracket-capture.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/multi-bracket-capture.js +13 -2
- package/lib/module/capture/multi-bracket-capture.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/multi-bracket-capture.d.ts +13 -2
- package/lib/typescript/capture/multi-bracket-capture.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/multi-bracket-capture.ts +13 -2
- 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
|
@@ -10,6 +10,9 @@ let MESSAGE_NO_PHOTO_CAPTURE_BUILDER = "no photo capture builder."
|
|
|
10
10
|
let MESSAGE_NO_TIMESHIFT_CAPTURE = "No timeShiftCapture."
|
|
11
11
|
let MESSAGE_NO_TIMESHIFT_CAPTURE_BUILDER = "no time-shift capture builder."
|
|
12
12
|
let MESSAGE_NO_TIMESHIFT_CAPTURING = "no timeShiftCapturing."
|
|
13
|
+
let MESSAGE_NO_TIMESHIFT_MANUAL_CAPTURE = "No timeShiftManualCapture."
|
|
14
|
+
let MESSAGE_NO_TIMESHIFT_MANUAL_CAPTURE_BUILDER = "no manual time-shift capture builder."
|
|
15
|
+
let MESSAGE_NO_TIMESHIFT_MANUAL_CAPTURING = "no timeShiftManualCapturing."
|
|
13
16
|
let MESSAGE_NO_VIDEO_CAPTURE = "No videoCapture."
|
|
14
17
|
let MESSAGE_NO_VIDEO_CAPTURE_BUILDER = "no video capture builder."
|
|
15
18
|
let MESSAGE_NO_VIDEO_CAPTURING = "no videoCapturing."
|
|
@@ -32,6 +35,10 @@ let MESSAGE_NO_CONTINUOUS_CAPTURE = "No continuousCapture."
|
|
|
32
35
|
let MESSAGE_NO_CONTINUOUS_CAPTURE_BUILDER = "no continuousCaptureBuilder."
|
|
33
36
|
let MESSAGE_NO_EVENT_WEBSOCKET = "no eventWebSocket."
|
|
34
37
|
|
|
38
|
+
enum ThetaClientError: Error {
|
|
39
|
+
case invalidArgument(String)
|
|
40
|
+
}
|
|
41
|
+
|
|
35
42
|
@objc(ThetaClientReactNative)
|
|
36
43
|
class ThetaClientReactNative: RCTEventEmitter {
|
|
37
44
|
var thetaRepository: ThetaRepository?
|
|
@@ -42,6 +49,9 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
42
49
|
var timeShiftCaptureBuilder: TimeShiftCapture.Builder?
|
|
43
50
|
var timeShiftCapture: TimeShiftCapture?
|
|
44
51
|
var timeShiftCapturing: TimeShiftCapturing?
|
|
52
|
+
var timeShiftManualCaptureBuilder: TimeShiftManualCapture.Builder?
|
|
53
|
+
var timeShiftManualCapture: TimeShiftManualCapture?
|
|
54
|
+
var timeShiftManualCapturing: TimeShiftManualCapturing?
|
|
45
55
|
var videoCaptureBuilder: VideoCapture.Builder?
|
|
46
56
|
var videoCapture: VideoCapture?
|
|
47
57
|
var videoCapturing: VideoCapturing?
|
|
@@ -63,7 +73,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
63
73
|
var continuousCaptureBuilder: ContinuousCapture.Builder?
|
|
64
74
|
var continuousCapture: ContinuousCapture?
|
|
65
75
|
var eventWebSocket: EventWebSocket?
|
|
66
|
-
|
|
76
|
+
|
|
67
77
|
static let EVENT_FRAME = "ThetaFrameEvent"
|
|
68
78
|
static let EVENT_NOTIFY = "ThetaNotify"
|
|
69
79
|
|
|
@@ -71,6 +81,9 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
71
81
|
static let NOTIFY_TIMESHIFT_PROGRESS = "TIME-SHIFT-PROGRESS"
|
|
72
82
|
static let NOTIFY_TIMESHIFT_STOP_ERROR = "TIME-SHIFT-STOP-ERROR"
|
|
73
83
|
static let NOTIFY_TIMESHIFT_CAPTURING = "TIME-SHIFT-CAPTURING"
|
|
84
|
+
static let NOTIFY_TIMESHIFT_MANUAL_PROGRESS = "TIME-SHIFT-MANUAL-PROGRESS"
|
|
85
|
+
static let NOTIFY_TIMESHIFT_MANUAL_STOP_ERROR = "TIME-SHIFT-MANUAL-STOP-ERROR"
|
|
86
|
+
static let NOTIFY_TIMESHIFT_MANUAL_CAPTURING = "TIME-SHIFT-MANUAL-CAPTURING"
|
|
74
87
|
static let NOTIFY_SHOT_COUNT_SPECIFIED_INTERVAL_PROGRESS = "SHOT-COUNT-SPECIFIED-INTERVAL-PROGRESS"
|
|
75
88
|
static let NOTIFY_SHOT_COUNT_SPECIFIED_INTERVAL_STOP_ERROR = "SHOT-COUNT-SPECIFIED-INTERVAL-STOP-ERROR"
|
|
76
89
|
static let NOTIFY_SHOT_COUNT_SPECIFIED_INTERVAL_CAPTURING = "SHOT-COUNT-SPECIFIED-INTERVAL-CAPTURING"
|
|
@@ -93,24 +106,46 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
93
106
|
static let NOTIFY_EVENT_WEBSOCKET_EVENT = "EVENT-WEBSOCKET-EVENT"
|
|
94
107
|
static let NOTIFY_EVENT_WEBSOCKET_CLOSE = "EVENT-WEBSOCKET-CLOSE"
|
|
95
108
|
static let NOTIFY_CONVERT_VIDEO_FORMATS_PROGRESS = "CONVERT-VIDEO-FORMATS-PROGRESS"
|
|
109
|
+
static let NOTIFY_API_LOG = "API-LOG"
|
|
96
110
|
|
|
97
111
|
@objc
|
|
98
112
|
override func supportedEvents() -> [String]! {
|
|
99
|
-
|
|
113
|
+
[ThetaClientReactNative.EVENT_FRAME, ThetaClientReactNative.EVENT_NOTIFY]
|
|
100
114
|
}
|
|
101
115
|
|
|
102
116
|
@objc
|
|
103
117
|
override static func requiresMainQueueSetup() -> Bool {
|
|
104
|
-
|
|
118
|
+
true
|
|
105
119
|
}
|
|
106
120
|
|
|
107
121
|
@objc
|
|
108
122
|
override func constantsToExport() -> [AnyHashable: Any]! {
|
|
109
|
-
|
|
123
|
+
[
|
|
110
124
|
"DEFAULT_EVENT_NAME": ThetaClientReactNative.EVENT_FRAME,
|
|
111
125
|
]
|
|
112
126
|
}
|
|
113
127
|
|
|
128
|
+
@objc(setApiLogListener:withResolver:withRejecter:)
|
|
129
|
+
func setApiLogListener(enabled: Bool,
|
|
130
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
131
|
+
reject _: @escaping RCTPromiseRejectBlock)
|
|
132
|
+
{
|
|
133
|
+
Task {
|
|
134
|
+
if enabled {
|
|
135
|
+
try UtilKt.setApiLogListener { message in
|
|
136
|
+
self.sendEvent(withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
137
|
+
body: toNotify(
|
|
138
|
+
name: ThetaClientReactNative.NOTIFY_API_LOG,
|
|
139
|
+
params: [KEY_NOTIFY_PARAM_MESSAGE: message]
|
|
140
|
+
))
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
try UtilKt.setApiLogListener(listener: nil)
|
|
144
|
+
}
|
|
145
|
+
resolve(nil)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
114
149
|
@objc(initialize:withConfig:withTimeout:withResolver:withRejecter:)
|
|
115
150
|
func initialize(
|
|
116
151
|
endPoint: String?,
|
|
@@ -125,6 +160,9 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
125
160
|
timeShiftCaptureBuilder = nil
|
|
126
161
|
timeShiftCapture = nil
|
|
127
162
|
timeShiftCapturing = nil
|
|
163
|
+
timeShiftManualCaptureBuilder = nil
|
|
164
|
+
timeShiftManualCapture = nil
|
|
165
|
+
timeShiftManualCapturing = nil
|
|
128
166
|
videoCaptureBuilder = nil
|
|
129
167
|
videoCapture = nil
|
|
130
168
|
videoCapturing = nil
|
|
@@ -149,7 +187,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
149
187
|
stopLivePreviewResolve = nil
|
|
150
188
|
eventWebSocket?.stop(completionHandler: { _ in })
|
|
151
189
|
eventWebSocket = nil
|
|
152
|
-
|
|
190
|
+
|
|
153
191
|
Task {
|
|
154
192
|
let configParams: ThetaRepository.Config? = {
|
|
155
193
|
if let config = config as? [String: Any] {
|
|
@@ -234,7 +272,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
234
272
|
return
|
|
235
273
|
}
|
|
236
274
|
|
|
237
|
-
thetaRepository.getThetaLicense
|
|
275
|
+
thetaRepository.getThetaLicense { response, error in
|
|
238
276
|
if let error {
|
|
239
277
|
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
240
278
|
} else if let response {
|
|
@@ -459,7 +497,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
459
497
|
reject(ERROR_CODE_ERROR, MESSAGE_LIVE_PREVIEW_RUNNING, nil)
|
|
460
498
|
return
|
|
461
499
|
}
|
|
462
|
-
|
|
500
|
+
|
|
463
501
|
class FrameHandler: KotlinSuspendFunction1 {
|
|
464
502
|
let thetaClientReactNative: ThetaClientReactNative
|
|
465
503
|
static let FrameInterval = CFTimeInterval(1.0 / 10.0)
|
|
@@ -481,7 +519,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
481
519
|
let dataUrl = "data:image/jpeg;base64," + encodeString
|
|
482
520
|
thetaClientReactNative.sendEvent(
|
|
483
521
|
withName: ThetaClientReactNative.EVENT_FRAME,
|
|
484
|
-
body: ["data": dataUrl]
|
|
522
|
+
body: ["data": dataUrl, "dataSize": nsData.count]
|
|
485
523
|
)
|
|
486
524
|
}
|
|
487
525
|
}
|
|
@@ -495,17 +533,17 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
495
533
|
return
|
|
496
534
|
}
|
|
497
535
|
let frameHandler = FrameHandler(self)
|
|
498
|
-
|
|
536
|
+
|
|
499
537
|
previewing = true
|
|
500
538
|
execAndResetStopLivePreviewResolve(false)
|
|
501
|
-
|
|
539
|
+
|
|
502
540
|
thetaRepository.getLivePreview(frameHandler: frameHandler) { error in
|
|
503
541
|
self.previewing = false
|
|
504
542
|
if let error {
|
|
505
543
|
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
506
544
|
} else {
|
|
507
545
|
self.execAndResetStopLivePreviewResolve(true)
|
|
508
|
-
|
|
546
|
+
|
|
509
547
|
resolve(true)
|
|
510
548
|
}
|
|
511
549
|
}
|
|
@@ -522,7 +560,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
522
560
|
}
|
|
523
561
|
stopLivePreviewResolve = resolve
|
|
524
562
|
}
|
|
525
|
-
|
|
563
|
+
|
|
526
564
|
private func execAndResetStopLivePreviewResolve(_ flag: Bool) {
|
|
527
565
|
stopLivePreviewResolve?(flag)
|
|
528
566
|
stopLivePreviewResolve = nil
|
|
@@ -723,7 +761,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
723
761
|
)
|
|
724
762
|
)
|
|
725
763
|
}
|
|
726
|
-
|
|
764
|
+
|
|
727
765
|
func onCapturing(status: CapturingStatusEnum) {
|
|
728
766
|
client?.sendEvent(
|
|
729
767
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -733,7 +771,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
733
771
|
)
|
|
734
772
|
)
|
|
735
773
|
}
|
|
736
|
-
|
|
774
|
+
|
|
737
775
|
func onCaptureCompleted(fileUrl: String?) {
|
|
738
776
|
callback(fileUrl, nil)
|
|
739
777
|
}
|
|
@@ -768,6 +806,167 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
768
806
|
resolve(nil)
|
|
769
807
|
}
|
|
770
808
|
|
|
809
|
+
@objc(getTimeShiftManualCaptureBuilder:withRejecter:)
|
|
810
|
+
func getTimeShiftManualCaptureBuilder(
|
|
811
|
+
resolve: RCTPromiseResolveBlock,
|
|
812
|
+
reject: RCTPromiseRejectBlock
|
|
813
|
+
) {
|
|
814
|
+
guard let thetaRepository else {
|
|
815
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
816
|
+
return
|
|
817
|
+
}
|
|
818
|
+
timeShiftManualCaptureBuilder = thetaRepository.getTimeShiftManualCaptureBuilder()
|
|
819
|
+
resolve(nil)
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
@objc(buildTimeShiftManualCapture:withResolver:withRejecter:)
|
|
823
|
+
func buildTimeShiftManualCapture(
|
|
824
|
+
options: [AnyHashable: Any]?,
|
|
825
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
826
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
827
|
+
) {
|
|
828
|
+
guard let _ = thetaRepository else {
|
|
829
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
830
|
+
return
|
|
831
|
+
}
|
|
832
|
+
guard let timeShiftManualCaptureBuilder else {
|
|
833
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_TIMESHIFT_MANUAL_CAPTURE_BUILDER, nil)
|
|
834
|
+
return
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
timeShiftManualCapture = nil
|
|
838
|
+
timeShiftManualCapturing = nil
|
|
839
|
+
if let options = options as? [String: Any] {
|
|
840
|
+
setCaptureBuilderParams(params: options, builder: timeShiftManualCaptureBuilder)
|
|
841
|
+
setTimeShiftManualCaptureBuilderParams(params: options, builder: timeShiftManualCaptureBuilder)
|
|
842
|
+
}
|
|
843
|
+
timeShiftManualCaptureBuilder.build { capture, error in
|
|
844
|
+
if let error {
|
|
845
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
846
|
+
} else if let capture {
|
|
847
|
+
self.timeShiftManualCapture = capture
|
|
848
|
+
self.timeShiftManualCaptureBuilder = nil
|
|
849
|
+
resolve(true)
|
|
850
|
+
} else {
|
|
851
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_TIMESHIFT_MANUAL_CAPTURE, nil)
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
@objc(startTimeShiftManualCapture:withRejecter:)
|
|
857
|
+
func startTimeShiftManualCapture(
|
|
858
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
859
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
860
|
+
) {
|
|
861
|
+
guard let _ = thetaRepository else {
|
|
862
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
863
|
+
return
|
|
864
|
+
}
|
|
865
|
+
guard let timeShiftManualCapture else {
|
|
866
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_TIMESHIFT_MANUAL_CAPTURE, nil)
|
|
867
|
+
return
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
class Callback: TimeShiftManualCaptureStartCaptureCallback {
|
|
871
|
+
let callback: (_ url: String?, _ error: Error?) -> Void
|
|
872
|
+
weak var client: ThetaClientReactNative?
|
|
873
|
+
init(
|
|
874
|
+
_ callback: @escaping (_ url: String?, _ error: Error?) -> Void,
|
|
875
|
+
client: ThetaClientReactNative
|
|
876
|
+
) {
|
|
877
|
+
self.callback = callback
|
|
878
|
+
self.client = client
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
func onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
882
|
+
callback(nil, exception.asError())
|
|
883
|
+
client?.timeShiftManualCapturing = nil
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
func onStopFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
887
|
+
let error = exception.asError()
|
|
888
|
+
client?.sendEvent(
|
|
889
|
+
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
890
|
+
body: toNotify(
|
|
891
|
+
name: ThetaClientReactNative.NOTIFY_TIMESHIFT_MANUAL_STOP_ERROR,
|
|
892
|
+
params: toMessageNotifyParam(value: error.localizedDescription)
|
|
893
|
+
)
|
|
894
|
+
)
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
func onProgress(completion: Float) {
|
|
898
|
+
client?.sendEvent(
|
|
899
|
+
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
900
|
+
body: toNotify(
|
|
901
|
+
name: ThetaClientReactNative.NOTIFY_TIMESHIFT_MANUAL_PROGRESS,
|
|
902
|
+
params: toCaptureProgressNotifyParam(value: completion)
|
|
903
|
+
)
|
|
904
|
+
)
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
func onCapturing(status: CapturingStatusEnum) {
|
|
908
|
+
client?.sendEvent(
|
|
909
|
+
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
910
|
+
body: toNotify(
|
|
911
|
+
name: ThetaClientReactNative.NOTIFY_TIMESHIFT_MANUAL_CAPTURING,
|
|
912
|
+
params: toCapturingNotifyParam(value: status)
|
|
913
|
+
)
|
|
914
|
+
)
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
func onCaptureCompleted(fileUrl: String?) {
|
|
918
|
+
callback(fileUrl, nil)
|
|
919
|
+
client?.timeShiftManualCapturing = nil
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
timeShiftManualCapturing = timeShiftManualCapture.startCapture(
|
|
924
|
+
callback: Callback(
|
|
925
|
+
{ url, error in
|
|
926
|
+
if let error {
|
|
927
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
928
|
+
} else {
|
|
929
|
+
resolve(url)
|
|
930
|
+
}
|
|
931
|
+
}, client: self
|
|
932
|
+
))
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
@objc(startTimeShiftManualSecondCapture:withRejecter:)
|
|
936
|
+
func startTimeShiftManualSecondCapture(
|
|
937
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
938
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
939
|
+
) {
|
|
940
|
+
guard let _ = thetaRepository else {
|
|
941
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
942
|
+
return
|
|
943
|
+
}
|
|
944
|
+
guard let timeShiftManualCapturing else {
|
|
945
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_TIMESHIFT_MANUAL_CAPTURING, nil)
|
|
946
|
+
return
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
timeShiftManualCapturing.startSecondCapture()
|
|
950
|
+
resolve(nil)
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
@objc(cancelTimeShiftManualCapture:withRejecter:)
|
|
954
|
+
func cancelTimeShiftManualCapture(
|
|
955
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
956
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
957
|
+
) {
|
|
958
|
+
guard let _ = thetaRepository else {
|
|
959
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
960
|
+
return
|
|
961
|
+
}
|
|
962
|
+
guard let timeShiftManualCapturing else {
|
|
963
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_TIMESHIFT_MANUAL_CAPTURING, nil)
|
|
964
|
+
return
|
|
965
|
+
}
|
|
966
|
+
timeShiftManualCapturing.cancelCapture()
|
|
967
|
+
resolve(nil)
|
|
968
|
+
}
|
|
969
|
+
|
|
771
970
|
@objc(getVideoCaptureBuilder:withRejecter:)
|
|
772
971
|
func getVideoCaptureBuilder(
|
|
773
972
|
resolve: RCTPromiseResolveBlock,
|
|
@@ -855,7 +1054,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
855
1054
|
)
|
|
856
1055
|
)
|
|
857
1056
|
}
|
|
858
|
-
|
|
1057
|
+
|
|
859
1058
|
func onCapturing(status: CapturingStatusEnum) {
|
|
860
1059
|
client?.sendEvent(
|
|
861
1060
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -995,7 +1194,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
995
1194
|
)
|
|
996
1195
|
)
|
|
997
1196
|
}
|
|
998
|
-
|
|
1197
|
+
|
|
999
1198
|
func onCapturing(status: CapturingStatusEnum) {
|
|
1000
1199
|
client?.sendEvent(
|
|
1001
1200
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -1121,7 +1320,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1121
1320
|
)
|
|
1122
1321
|
)
|
|
1123
1322
|
}
|
|
1124
|
-
|
|
1323
|
+
|
|
1125
1324
|
func onCapturing(status: CapturingStatusEnum) {
|
|
1126
1325
|
client?.sendEvent(
|
|
1127
1326
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -1131,7 +1330,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1131
1330
|
)
|
|
1132
1331
|
)
|
|
1133
1332
|
}
|
|
1134
|
-
|
|
1333
|
+
|
|
1135
1334
|
func onCaptureCompleted(fileUrls: [String]?) {
|
|
1136
1335
|
callback(fileUrls, nil)
|
|
1137
1336
|
}
|
|
@@ -1513,7 +1712,12 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1513
1712
|
|
|
1514
1713
|
if let options = options as? [String: Any] {
|
|
1515
1714
|
setCaptureBuilderParams(params: options, builder: multiBracketCaptureBuilder)
|
|
1516
|
-
|
|
1715
|
+
do {
|
|
1716
|
+
try setMultiBracketCaptureBuilderParams(params: options, builder: multiBracketCaptureBuilder)
|
|
1717
|
+
} catch {
|
|
1718
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1719
|
+
return
|
|
1720
|
+
}
|
|
1517
1721
|
}
|
|
1518
1722
|
multiBracketCaptureBuilder.build { capture, error in
|
|
1519
1723
|
if let error {
|
|
@@ -1566,7 +1770,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1566
1770
|
)
|
|
1567
1771
|
)
|
|
1568
1772
|
}
|
|
1569
|
-
|
|
1773
|
+
|
|
1570
1774
|
func onCapturing(status: CapturingStatusEnum) {
|
|
1571
1775
|
client?.sendEvent(
|
|
1572
1776
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -1576,7 +1780,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1576
1780
|
)
|
|
1577
1781
|
)
|
|
1578
1782
|
}
|
|
1579
|
-
|
|
1783
|
+
|
|
1580
1784
|
func onCaptureCompleted(fileUrls: [String]?) {
|
|
1581
1785
|
callback(fileUrls, nil)
|
|
1582
1786
|
}
|
|
@@ -1707,7 +1911,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1707
1911
|
)
|
|
1708
1912
|
)
|
|
1709
1913
|
}
|
|
1710
|
-
|
|
1914
|
+
|
|
1711
1915
|
func onCapturing(status: CapturingStatusEnum) {
|
|
1712
1916
|
client?.sendEvent(
|
|
1713
1917
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -1717,7 +1921,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1717
1921
|
)
|
|
1718
1922
|
)
|
|
1719
1923
|
}
|
|
1720
|
-
|
|
1924
|
+
|
|
1721
1925
|
func onCaptureCompleted(fileUrls: [String]?) {
|
|
1722
1926
|
callback(fileUrls, nil)
|
|
1723
1927
|
}
|
|
@@ -1761,6 +1965,25 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1761
1965
|
}
|
|
1762
1966
|
}
|
|
1763
1967
|
|
|
1968
|
+
@objc(reboot:withRejecter:)
|
|
1969
|
+
func reboot(
|
|
1970
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1971
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1972
|
+
) {
|
|
1973
|
+
guard let thetaRepository else {
|
|
1974
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1975
|
+
return
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
thetaRepository.reboot { error in
|
|
1979
|
+
if let error {
|
|
1980
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1981
|
+
} else {
|
|
1982
|
+
resolve(true)
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1764
1987
|
@objc(reset:withRejecter:)
|
|
1765
1988
|
func reset(
|
|
1766
1989
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -1817,10 +2040,10 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1817
2040
|
}
|
|
1818
2041
|
}
|
|
1819
2042
|
}
|
|
1820
|
-
|
|
2043
|
+
|
|
1821
2044
|
@objc(
|
|
1822
2045
|
convertVideoFormats:withToLowResolution:withApplyTopBottomCorrection:withResolver:
|
|
1823
|
-
|
|
2046
|
+
withRejecter:
|
|
1824
2047
|
)
|
|
1825
2048
|
func convertVideoFormats(
|
|
1826
2049
|
fileUrl: String,
|
|
@@ -1919,21 +2142,11 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1919
2142
|
|
|
1920
2143
|
@objc(
|
|
1921
2144
|
setAccessPointDynamically:
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
withPassword:
|
|
1925
|
-
withConnectionPriority:
|
|
1926
|
-
withProxy:
|
|
1927
|
-
withResolver:
|
|
1928
|
-
withRejecter:
|
|
2145
|
+
withResolver:
|
|
2146
|
+
withRejecter:
|
|
1929
2147
|
)
|
|
1930
2148
|
func setAccessPointDynamically(
|
|
1931
|
-
|
|
1932
|
-
ssidStealth: Bool,
|
|
1933
|
-
authMode: String,
|
|
1934
|
-
password: String,
|
|
1935
|
-
connectionPriority: Int,
|
|
1936
|
-
proxy: [AnyHashable: Any]?,
|
|
2149
|
+
params: [AnyHashable: Any],
|
|
1937
2150
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
1938
2151
|
reject: @escaping RCTPromiseRejectBlock
|
|
1939
2152
|
) {
|
|
@@ -1941,60 +2154,34 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1941
2154
|
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1942
2155
|
return
|
|
1943
2156
|
}
|
|
1944
|
-
|
|
1945
|
-
let
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
thetaRepository.setAccessPointDynamically(
|
|
1960
|
-
ssid: ssid,
|
|
1961
|
-
ssidStealth: ssidStealth,
|
|
1962
|
-
authMode: authMode,
|
|
1963
|
-
password: password,
|
|
1964
|
-
connectionPriority: Int32(connectionPriority),
|
|
1965
|
-
proxy: proxyParam
|
|
1966
|
-
) { error in
|
|
1967
|
-
if let error {
|
|
1968
|
-
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1969
|
-
} else {
|
|
1970
|
-
resolve(true)
|
|
2157
|
+
do {
|
|
2158
|
+
let accessPointParams = try toSetAccessPointParams(params: params as? [String: Any] ?? [:])
|
|
2159
|
+
thetaRepository.setAccessPointDynamically(
|
|
2160
|
+
ssid: accessPointParams.ssid,
|
|
2161
|
+
ssidStealth: accessPointParams.ssidStealth,
|
|
2162
|
+
authMode: accessPointParams.authMode,
|
|
2163
|
+
password: accessPointParams.password,
|
|
2164
|
+
connectionPriority: accessPointParams.connectionPriority,
|
|
2165
|
+
proxy: accessPointParams.proxy
|
|
2166
|
+
) { error in
|
|
2167
|
+
if let error {
|
|
2168
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
2169
|
+
} else {
|
|
2170
|
+
resolve(true)
|
|
2171
|
+
}
|
|
1971
2172
|
}
|
|
2173
|
+
} catch {
|
|
2174
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1972
2175
|
}
|
|
1973
2176
|
}
|
|
1974
2177
|
|
|
1975
2178
|
@objc(
|
|
1976
2179
|
setAccessPointStatically:
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
withPassword:
|
|
1980
|
-
withConnectionPriority:
|
|
1981
|
-
withIpAddress:
|
|
1982
|
-
withSubnetMask:
|
|
1983
|
-
withDefaultGateway:
|
|
1984
|
-
withProxy:
|
|
1985
|
-
withResolver:
|
|
1986
|
-
withRejecter:
|
|
2180
|
+
withResolver:
|
|
2181
|
+
withRejecter:
|
|
1987
2182
|
)
|
|
1988
2183
|
func setAccessPointStatically(
|
|
1989
|
-
|
|
1990
|
-
ssidStealth: Bool,
|
|
1991
|
-
authMode: String,
|
|
1992
|
-
password: String?,
|
|
1993
|
-
connectionPriority: Int,
|
|
1994
|
-
ipAddress: String,
|
|
1995
|
-
subnetMask: String,
|
|
1996
|
-
defaultGateway: String,
|
|
1997
|
-
proxy: [AnyHashable: Any]?,
|
|
2184
|
+
params: [AnyHashable: Any],
|
|
1998
2185
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
1999
2186
|
reject: @escaping RCTPromiseRejectBlock
|
|
2000
2187
|
) {
|
|
@@ -2002,37 +2189,30 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2002
2189
|
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
2003
2190
|
return
|
|
2004
2191
|
}
|
|
2005
|
-
|
|
2006
|
-
let
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
ipAddress: ipAddress,
|
|
2027
|
-
subnetMask: subnetMask,
|
|
2028
|
-
defaultGateway: defaultGateway,
|
|
2029
|
-
proxy: proxyParam
|
|
2030
|
-
) { error in
|
|
2031
|
-
if let error {
|
|
2032
|
-
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
2033
|
-
} else {
|
|
2034
|
-
resolve(true)
|
|
2192
|
+
do {
|
|
2193
|
+
let accessPointParams = try toSetAccessPointParams(params: params as? [String: Any] ?? [:])
|
|
2194
|
+
let staticallyParams = try toSetAccessPointStaticallyParams(params: params as? [String: Any] ?? [:])
|
|
2195
|
+
thetaRepository.setAccessPointStatically(
|
|
2196
|
+
ssid: accessPointParams.ssid,
|
|
2197
|
+
ssidStealth: accessPointParams.ssidStealth,
|
|
2198
|
+
authMode: accessPointParams.authMode,
|
|
2199
|
+
password: accessPointParams.password,
|
|
2200
|
+
connectionPriority: accessPointParams.connectionPriority,
|
|
2201
|
+
ipAddress: staticallyParams.ipAddress,
|
|
2202
|
+
subnetMask: staticallyParams.subnetMask,
|
|
2203
|
+
defaultGateway: staticallyParams.defaultGateway,
|
|
2204
|
+
dns1: accessPointParams.dns1,
|
|
2205
|
+
dns2: accessPointParams.dns2,
|
|
2206
|
+
proxy: accessPointParams.proxy
|
|
2207
|
+
) { error in
|
|
2208
|
+
if let error {
|
|
2209
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
2210
|
+
} else {
|
|
2211
|
+
resolve(true)
|
|
2212
|
+
}
|
|
2035
2213
|
}
|
|
2214
|
+
} catch {
|
|
2215
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
2036
2216
|
}
|
|
2037
2217
|
}
|
|
2038
2218
|
|
|
@@ -2131,7 +2311,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2131
2311
|
}
|
|
2132
2312
|
guard let options = options as? [String: Any],
|
|
2133
2313
|
let captureMode = getEnumValue(
|
|
2134
|
-
|
|
2314
|
+
values: ThetaRepository.CaptureModeEnum.values(), name: captureMode
|
|
2135
2315
|
)
|
|
2136
2316
|
else {
|
|
2137
2317
|
reject(ERROR_CODE_ERROR, MESSAGE_NO_ARGUMENT, nil)
|
|
@@ -2349,7 +2529,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2349
2529
|
}
|
|
2350
2530
|
}
|
|
2351
2531
|
}
|
|
2352
|
-
|
|
2532
|
+
|
|
2353
2533
|
@objc(getEventWebSocket:withRejecter:)
|
|
2354
2534
|
func getEventWebSocket(
|
|
2355
2535
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -2364,7 +2544,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2364
2544
|
eventWebSocket = thetaRepository.getEventWebSocket()
|
|
2365
2545
|
resolve(true)
|
|
2366
2546
|
}
|
|
2367
|
-
|
|
2547
|
+
|
|
2368
2548
|
@objc(eventWebSocketStart:withRejecter:)
|
|
2369
2549
|
func eventWebSocketStart(
|
|
2370
2550
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -2380,13 +2560,14 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2380
2560
|
}
|
|
2381
2561
|
eventWebSocket.stop(completionHandler: { _ in
|
|
2382
2562
|
})
|
|
2383
|
-
|
|
2563
|
+
|
|
2384
2564
|
class Callback: EventWebSocketCallback {
|
|
2385
2565
|
let thetaClientReactNative: ThetaClientReactNative
|
|
2386
|
-
|
|
2566
|
+
|
|
2387
2567
|
init(_ thetaClientReactNative: ThetaClientReactNative) {
|
|
2388
2568
|
self.thetaClientReactNative = thetaClientReactNative
|
|
2389
2569
|
}
|
|
2570
|
+
|
|
2390
2571
|
func onClose() {
|
|
2391
2572
|
thetaClientReactNative.sendEvent(
|
|
2392
2573
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -2396,7 +2577,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2396
2577
|
)
|
|
2397
2578
|
)
|
|
2398
2579
|
}
|
|
2399
|
-
|
|
2580
|
+
|
|
2400
2581
|
func onReceive(event: CameraEvent) {
|
|
2401
2582
|
thetaClientReactNative.sendEvent(
|
|
2402
2583
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -2415,7 +2596,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2415
2596
|
}
|
|
2416
2597
|
}
|
|
2417
2598
|
}
|
|
2418
|
-
|
|
2599
|
+
|
|
2419
2600
|
@objc(eventWebSocketStop:withRejecter:)
|
|
2420
2601
|
func eventWebSocketStop(
|
|
2421
2602
|
resolve: @escaping RCTPromiseResolveBlock,
|