theta-client-react-native 1.12.1 → 1.13.1
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 +532 -33
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +230 -50
- package/ios/ConvertUtil.swift +561 -102
- package/ios/ThetaClientReactNative.m +31 -15
- package/ios/ThetaClientReactNative.swift +325 -118
- 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 +130 -18
- 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 +128 -20
- 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 +65 -14
- 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 +133 -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
|
}
|
|
@@ -1571,7 +1770,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1571
1770
|
)
|
|
1572
1771
|
)
|
|
1573
1772
|
}
|
|
1574
|
-
|
|
1773
|
+
|
|
1575
1774
|
func onCapturing(status: CapturingStatusEnum) {
|
|
1576
1775
|
client?.sendEvent(
|
|
1577
1776
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -1581,7 +1780,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1581
1780
|
)
|
|
1582
1781
|
)
|
|
1583
1782
|
}
|
|
1584
|
-
|
|
1783
|
+
|
|
1585
1784
|
func onCaptureCompleted(fileUrls: [String]?) {
|
|
1586
1785
|
callback(fileUrls, nil)
|
|
1587
1786
|
}
|
|
@@ -1712,7 +1911,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1712
1911
|
)
|
|
1713
1912
|
)
|
|
1714
1913
|
}
|
|
1715
|
-
|
|
1914
|
+
|
|
1716
1915
|
func onCapturing(status: CapturingStatusEnum) {
|
|
1717
1916
|
client?.sendEvent(
|
|
1718
1917
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -1722,7 +1921,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1722
1921
|
)
|
|
1723
1922
|
)
|
|
1724
1923
|
}
|
|
1725
|
-
|
|
1924
|
+
|
|
1726
1925
|
func onCaptureCompleted(fileUrls: [String]?) {
|
|
1727
1926
|
callback(fileUrls, nil)
|
|
1728
1927
|
}
|
|
@@ -1766,6 +1965,25 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1766
1965
|
}
|
|
1767
1966
|
}
|
|
1768
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
|
+
|
|
1769
1987
|
@objc(reset:withRejecter:)
|
|
1770
1988
|
func reset(
|
|
1771
1989
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -1822,10 +2040,10 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1822
2040
|
}
|
|
1823
2041
|
}
|
|
1824
2042
|
}
|
|
1825
|
-
|
|
2043
|
+
|
|
1826
2044
|
@objc(
|
|
1827
2045
|
convertVideoFormats:withToLowResolution:withApplyTopBottomCorrection:withResolver:
|
|
1828
|
-
|
|
2046
|
+
withRejecter:
|
|
1829
2047
|
)
|
|
1830
2048
|
func convertVideoFormats(
|
|
1831
2049
|
fileUrl: String,
|
|
@@ -1924,21 +2142,11 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1924
2142
|
|
|
1925
2143
|
@objc(
|
|
1926
2144
|
setAccessPointDynamically:
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
withPassword:
|
|
1930
|
-
withConnectionPriority:
|
|
1931
|
-
withProxy:
|
|
1932
|
-
withResolver:
|
|
1933
|
-
withRejecter:
|
|
2145
|
+
withResolver:
|
|
2146
|
+
withRejecter:
|
|
1934
2147
|
)
|
|
1935
2148
|
func setAccessPointDynamically(
|
|
1936
|
-
|
|
1937
|
-
ssidStealth: Bool,
|
|
1938
|
-
authMode: String,
|
|
1939
|
-
password: String,
|
|
1940
|
-
connectionPriority: Int,
|
|
1941
|
-
proxy: [AnyHashable: Any]?,
|
|
2149
|
+
params: [AnyHashable: Any],
|
|
1942
2150
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
1943
2151
|
reject: @escaping RCTPromiseRejectBlock
|
|
1944
2152
|
) {
|
|
@@ -1946,60 +2154,34 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1946
2154
|
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1947
2155
|
return
|
|
1948
2156
|
}
|
|
1949
|
-
|
|
1950
|
-
let
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
thetaRepository.setAccessPointDynamically(
|
|
1965
|
-
ssid: ssid,
|
|
1966
|
-
ssidStealth: ssidStealth,
|
|
1967
|
-
authMode: authMode,
|
|
1968
|
-
password: password,
|
|
1969
|
-
connectionPriority: Int32(connectionPriority),
|
|
1970
|
-
proxy: proxyParam
|
|
1971
|
-
) { error in
|
|
1972
|
-
if let error {
|
|
1973
|
-
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1974
|
-
} else {
|
|
1975
|
-
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
|
+
}
|
|
1976
2172
|
}
|
|
2173
|
+
} catch {
|
|
2174
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1977
2175
|
}
|
|
1978
2176
|
}
|
|
1979
2177
|
|
|
1980
2178
|
@objc(
|
|
1981
2179
|
setAccessPointStatically:
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
withPassword:
|
|
1985
|
-
withConnectionPriority:
|
|
1986
|
-
withIpAddress:
|
|
1987
|
-
withSubnetMask:
|
|
1988
|
-
withDefaultGateway:
|
|
1989
|
-
withProxy:
|
|
1990
|
-
withResolver:
|
|
1991
|
-
withRejecter:
|
|
2180
|
+
withResolver:
|
|
2181
|
+
withRejecter:
|
|
1992
2182
|
)
|
|
1993
2183
|
func setAccessPointStatically(
|
|
1994
|
-
|
|
1995
|
-
ssidStealth: Bool,
|
|
1996
|
-
authMode: String,
|
|
1997
|
-
password: String?,
|
|
1998
|
-
connectionPriority: Int,
|
|
1999
|
-
ipAddress: String,
|
|
2000
|
-
subnetMask: String,
|
|
2001
|
-
defaultGateway: String,
|
|
2002
|
-
proxy: [AnyHashable: Any]?,
|
|
2184
|
+
params: [AnyHashable: Any],
|
|
2003
2185
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
2004
2186
|
reject: @escaping RCTPromiseRejectBlock
|
|
2005
2187
|
) {
|
|
@@ -2007,37 +2189,61 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2007
2189
|
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
2008
2190
|
return
|
|
2009
2191
|
}
|
|
2010
|
-
|
|
2011
|
-
let
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
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
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
} catch {
|
|
2215
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
2017
2216
|
}
|
|
2217
|
+
}
|
|
2018
2218
|
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2219
|
+
@objc(
|
|
2220
|
+
setAccessPointConnectionPriority:
|
|
2221
|
+
connectionPriority:
|
|
2222
|
+
ssidStealth:
|
|
2223
|
+
withResolver:
|
|
2224
|
+
withRejecter:
|
|
2225
|
+
)
|
|
2226
|
+
func setAccessPointConnectionPriority(
|
|
2227
|
+
ssid: String,
|
|
2228
|
+
connectionPriority: Int,
|
|
2229
|
+
ssidStealth: Bool,
|
|
2230
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
2231
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
2232
|
+
) {
|
|
2233
|
+
guard let thetaRepository else {
|
|
2234
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
2235
|
+
return
|
|
2236
|
+
}
|
|
2237
|
+
do {
|
|
2238
|
+
thetaRepository.setAccessPointConnectionPriority(ssid: ssid, connectionPriority: Int32(connectionPriority), ssidStealth: ssidStealth) { error in
|
|
2239
|
+
if let error {
|
|
2240
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
2241
|
+
} else {
|
|
2242
|
+
resolve(true)
|
|
2243
|
+
}
|
|
2040
2244
|
}
|
|
2245
|
+
} catch {
|
|
2246
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
2041
2247
|
}
|
|
2042
2248
|
}
|
|
2043
2249
|
|
|
@@ -2136,7 +2342,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2136
2342
|
}
|
|
2137
2343
|
guard let options = options as? [String: Any],
|
|
2138
2344
|
let captureMode = getEnumValue(
|
|
2139
|
-
|
|
2345
|
+
values: ThetaRepository.CaptureModeEnum.values(), name: captureMode
|
|
2140
2346
|
)
|
|
2141
2347
|
else {
|
|
2142
2348
|
reject(ERROR_CODE_ERROR, MESSAGE_NO_ARGUMENT, nil)
|
|
@@ -2354,7 +2560,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2354
2560
|
}
|
|
2355
2561
|
}
|
|
2356
2562
|
}
|
|
2357
|
-
|
|
2563
|
+
|
|
2358
2564
|
@objc(getEventWebSocket:withRejecter:)
|
|
2359
2565
|
func getEventWebSocket(
|
|
2360
2566
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -2369,7 +2575,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2369
2575
|
eventWebSocket = thetaRepository.getEventWebSocket()
|
|
2370
2576
|
resolve(true)
|
|
2371
2577
|
}
|
|
2372
|
-
|
|
2578
|
+
|
|
2373
2579
|
@objc(eventWebSocketStart:withRejecter:)
|
|
2374
2580
|
func eventWebSocketStart(
|
|
2375
2581
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -2385,13 +2591,14 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2385
2591
|
}
|
|
2386
2592
|
eventWebSocket.stop(completionHandler: { _ in
|
|
2387
2593
|
})
|
|
2388
|
-
|
|
2594
|
+
|
|
2389
2595
|
class Callback: EventWebSocketCallback {
|
|
2390
2596
|
let thetaClientReactNative: ThetaClientReactNative
|
|
2391
|
-
|
|
2597
|
+
|
|
2392
2598
|
init(_ thetaClientReactNative: ThetaClientReactNative) {
|
|
2393
2599
|
self.thetaClientReactNative = thetaClientReactNative
|
|
2394
2600
|
}
|
|
2601
|
+
|
|
2395
2602
|
func onClose() {
|
|
2396
2603
|
thetaClientReactNative.sendEvent(
|
|
2397
2604
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -2401,7 +2608,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2401
2608
|
)
|
|
2402
2609
|
)
|
|
2403
2610
|
}
|
|
2404
|
-
|
|
2611
|
+
|
|
2405
2612
|
func onReceive(event: CameraEvent) {
|
|
2406
2613
|
thetaClientReactNative.sendEvent(
|
|
2407
2614
|
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
@@ -2420,7 +2627,7 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
2420
2627
|
}
|
|
2421
2628
|
}
|
|
2422
2629
|
}
|
|
2423
|
-
|
|
2630
|
+
|
|
2424
2631
|
@objc(eventWebSocketStop:withRejecter:)
|
|
2425
2632
|
func eventWebSocketStop(
|
|
2426
2633
|
resolve: @escaping RCTPromiseResolveBlock,
|