theta-client-react-native 1.9.1 → 1.10.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.
Files changed (98) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +27 -0
  3. package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +73 -0
  4. package/ios/ConvertUtil.swift +22 -0
  5. package/ios/ThetaClientReactNative.swift +112 -9
  6. package/lib/commonjs/capture/burst-capture.js +13 -1
  7. package/lib/commonjs/capture/burst-capture.js.map +1 -1
  8. package/lib/commonjs/capture/capture.js +12 -1
  9. package/lib/commonjs/capture/capture.js.map +1 -1
  10. package/lib/commonjs/capture/composite-interval-capture.js +13 -1
  11. package/lib/commonjs/capture/composite-interval-capture.js.map +1 -1
  12. package/lib/commonjs/capture/continuous-capture.js +12 -1
  13. package/lib/commonjs/capture/continuous-capture.js.map +1 -1
  14. package/lib/commonjs/capture/limitless-interval-capture.js +29 -2
  15. package/lib/commonjs/capture/limitless-interval-capture.js.map +1 -1
  16. package/lib/commonjs/capture/multi-bracket-capture.js +13 -1
  17. package/lib/commonjs/capture/multi-bracket-capture.js.map +1 -1
  18. package/lib/commonjs/capture/photo-capture.js +38 -4
  19. package/lib/commonjs/capture/photo-capture.js.map +1 -1
  20. package/lib/commonjs/capture/shot-count-specified-interval-capture.js +12 -1
  21. package/lib/commonjs/capture/shot-count-specified-interval-capture.js.map +1 -1
  22. package/lib/commonjs/capture/time-shift-capture.js +12 -1
  23. package/lib/commonjs/capture/time-shift-capture.js.map +1 -1
  24. package/lib/commonjs/capture/video-capture.js +29 -2
  25. package/lib/commonjs/capture/video-capture.js.map +1 -1
  26. package/lib/commonjs/theta-repository/theta-state/capture-status.js +32 -0
  27. package/lib/commonjs/theta-repository/theta-state/capture-status.js.map +1 -0
  28. package/lib/commonjs/theta-repository/theta-state/index.js +11 -0
  29. package/lib/commonjs/theta-repository/theta-state/index.js.map +1 -1
  30. package/lib/commonjs/theta-repository/theta-state/theta-state.js +1 -23
  31. package/lib/commonjs/theta-repository/theta-state/theta-state.js.map +1 -1
  32. package/lib/module/capture/burst-capture.js +13 -1
  33. package/lib/module/capture/burst-capture.js.map +1 -1
  34. package/lib/module/capture/capture.js +11 -0
  35. package/lib/module/capture/capture.js.map +1 -1
  36. package/lib/module/capture/composite-interval-capture.js +13 -1
  37. package/lib/module/capture/composite-interval-capture.js.map +1 -1
  38. package/lib/module/capture/continuous-capture.js +12 -1
  39. package/lib/module/capture/continuous-capture.js.map +1 -1
  40. package/lib/module/capture/limitless-interval-capture.js +29 -2
  41. package/lib/module/capture/limitless-interval-capture.js.map +1 -1
  42. package/lib/module/capture/multi-bracket-capture.js +13 -1
  43. package/lib/module/capture/multi-bracket-capture.js.map +1 -1
  44. package/lib/module/capture/photo-capture.js +38 -4
  45. package/lib/module/capture/photo-capture.js.map +1 -1
  46. package/lib/module/capture/shot-count-specified-interval-capture.js +12 -1
  47. package/lib/module/capture/shot-count-specified-interval-capture.js.map +1 -1
  48. package/lib/module/capture/time-shift-capture.js +12 -1
  49. package/lib/module/capture/time-shift-capture.js.map +1 -1
  50. package/lib/module/capture/video-capture.js +29 -2
  51. package/lib/module/capture/video-capture.js.map +1 -1
  52. package/lib/module/theta-repository/theta-state/capture-status.js +26 -0
  53. package/lib/module/theta-repository/theta-state/capture-status.js.map +1 -0
  54. package/lib/module/theta-repository/theta-state/index.js +1 -0
  55. package/lib/module/theta-repository/theta-state/index.js.map +1 -1
  56. package/lib/module/theta-repository/theta-state/theta-state.js +0 -22
  57. package/lib/module/theta-repository/theta-state/theta-state.js.map +1 -1
  58. package/lib/typescript/capture/burst-capture.d.ts +4 -2
  59. package/lib/typescript/capture/burst-capture.d.ts.map +1 -1
  60. package/lib/typescript/capture/capture.d.ts +9 -0
  61. package/lib/typescript/capture/capture.d.ts.map +1 -1
  62. package/lib/typescript/capture/composite-interval-capture.d.ts +4 -2
  63. package/lib/typescript/capture/composite-interval-capture.d.ts.map +1 -1
  64. package/lib/typescript/capture/continuous-capture.d.ts +3 -2
  65. package/lib/typescript/capture/continuous-capture.d.ts.map +1 -1
  66. package/lib/typescript/capture/limitless-interval-capture.d.ts +10 -2
  67. package/lib/typescript/capture/limitless-interval-capture.d.ts.map +1 -1
  68. package/lib/typescript/capture/multi-bracket-capture.d.ts +5 -3
  69. package/lib/typescript/capture/multi-bracket-capture.d.ts.map +1 -1
  70. package/lib/typescript/capture/photo-capture.d.ts +15 -2
  71. package/lib/typescript/capture/photo-capture.d.ts.map +1 -1
  72. package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts +3 -2
  73. package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts.map +1 -1
  74. package/lib/typescript/capture/time-shift-capture.d.ts +3 -2
  75. package/lib/typescript/capture/time-shift-capture.d.ts.map +1 -1
  76. package/lib/typescript/capture/video-capture.d.ts +10 -2
  77. package/lib/typescript/capture/video-capture.d.ts.map +1 -1
  78. package/lib/typescript/theta-repository/theta-state/capture-status.d.ts +26 -0
  79. package/lib/typescript/theta-repository/theta-state/capture-status.d.ts.map +1 -0
  80. package/lib/typescript/theta-repository/theta-state/index.d.ts +1 -0
  81. package/lib/typescript/theta-repository/theta-state/index.d.ts.map +1 -1
  82. package/lib/typescript/theta-repository/theta-state/theta-state.d.ts +1 -21
  83. package/lib/typescript/theta-repository/theta-state/theta-state.d.ts.map +1 -1
  84. package/package.json +2 -2
  85. package/src/capture/burst-capture.ts +20 -2
  86. package/src/capture/capture.ts +12 -0
  87. package/src/capture/composite-interval-capture.ts +20 -2
  88. package/src/capture/continuous-capture.ts +19 -2
  89. package/src/capture/limitless-interval-capture.ts +40 -5
  90. package/src/capture/multi-bracket-capture.ts +21 -3
  91. package/src/capture/photo-capture.ts +53 -4
  92. package/src/capture/shot-count-specified-interval-capture.ts +19 -2
  93. package/src/capture/time-shift-capture.ts +19 -2
  94. package/src/capture/video-capture.ts +38 -3
  95. package/src/theta-repository/theta-state/capture-status.ts +27 -0
  96. package/src/theta-repository/theta-state/index.ts +1 -0
  97. package/src/theta-repository/theta-state/theta-state.ts +1 -24
  98. package/theta-client-react-native.podspec +1 -1
@@ -1,4 +1,4 @@
1
- import { CaptureBuilder } from './capture';
1
+ import { CaptureBuilder, CapturingStatusEnum } from './capture';
2
2
  import type {
3
3
  MaxRecordableTimeEnum,
4
4
  VideoFileFormatEnum,
@@ -12,6 +12,7 @@ import {
12
12
  const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
13
13
 
14
14
  const NOTIFY_NAME = 'VIDEO-CAPTURE-STOP-ERROR';
15
+ const NOTIFY_CAPTURING = 'VIDEO-CAPTURE-CAPTURING';
15
16
 
16
17
  interface CaptureStopErrorNotify extends BaseNotify {
17
18
  params?: {
@@ -19,6 +20,12 @@ interface CaptureStopErrorNotify extends BaseNotify {
19
20
  };
20
21
  }
21
22
 
23
+ interface CapturingNotify extends BaseNotify {
24
+ params?: {
25
+ status: CapturingStatusEnum;
26
+ };
27
+ }
28
+
22
29
  /**
23
30
  * VideoCapture class
24
31
  */
@@ -31,16 +38,25 @@ export class VideoCapture {
31
38
  /**
32
39
  * start video capture
33
40
  * @param onStopFailed the block for error of stopCapture
41
+ * @param onCapturing Called when change capture status
34
42
  * @return promise of captured file url
35
43
  */
36
44
  startCapture(
37
- onStopFailed?: (error: any) => void
45
+ onStopFailed?: (error: any) => void,
46
+ onCapturing?: (status: CapturingStatusEnum) => void
38
47
  ): Promise<string | undefined> {
39
48
  if (onStopFailed) {
40
49
  this.notify.addNotify(NOTIFY_NAME, (event: CaptureStopErrorNotify) => {
41
50
  onStopFailed(event.params);
42
51
  });
43
52
  }
53
+ if (onCapturing) {
54
+ this.notify.addNotify(NOTIFY_CAPTURING, (event: CapturingNotify) => {
55
+ if (event.params?.status) {
56
+ onCapturing(event.params.status);
57
+ }
58
+ });
59
+ }
44
60
  return new Promise<string | undefined>(async (resolve, reject) => {
45
61
  await ThetaClientReactNative.startVideoCapture()
46
62
  .then((result?: string) => {
@@ -51,6 +67,7 @@ export class VideoCapture {
51
67
  })
52
68
  .finally(() => {
53
69
  this.notify.removeNotify(NOTIFY_NAME);
70
+ this.notify.removeNotify(NOTIFY_CAPTURING);
54
71
  });
55
72
  });
56
73
  }
@@ -67,9 +84,22 @@ export class VideoCapture {
67
84
  * VideoCaptureBuilder class
68
85
  */
69
86
  export class VideoCaptureBuilder extends CaptureBuilder<VideoCaptureBuilder> {
87
+ interval?: number;
88
+
70
89
  /** construct VideoCaptureBuilder instance */
71
90
  constructor() {
72
91
  super();
92
+ this.interval = undefined;
93
+ }
94
+
95
+ /**
96
+ * set interval of checking continuous shooting status command
97
+ * @param timeMillis interval
98
+ * @returns VideoCaptureBuilder
99
+ */
100
+ setCheckStatusCommandInterval(timeMillis: number): VideoCaptureBuilder {
101
+ this.interval = timeMillis;
102
+ return this;
73
103
  }
74
104
 
75
105
  /**
@@ -99,10 +129,15 @@ export class VideoCaptureBuilder extends CaptureBuilder<VideoCaptureBuilder> {
99
129
  * @return promise of VideoCapture instance
100
130
  */
101
131
  build(): Promise<VideoCapture> {
132
+ let params = {
133
+ ...this.options,
134
+ // Cannot pass negative values in IOS, use objects
135
+ _capture_interval: this.interval ?? -1,
136
+ };
102
137
  return new Promise<VideoCapture>(async (resolve, reject) => {
103
138
  try {
104
139
  await ThetaClientReactNative.getVideoCaptureBuilder();
105
- await ThetaClientReactNative.buildVideoCapture(this.options);
140
+ await ThetaClientReactNative.buildVideoCapture(params);
106
141
  resolve(new VideoCapture(NotifyController.instance));
107
142
  } catch (error) {
108
143
  reject(error);
@@ -0,0 +1,27 @@
1
+ /** Capture Status constants */
2
+ export const CaptureStatusEnum = {
3
+ /** Undefined value */
4
+ UNKNOWN: 'UNKNOWN',
5
+ /** Performing continuously shoot */
6
+ SHOOTING: 'SHOOTING',
7
+ /** In standby */
8
+ IDLE: 'IDLE',
9
+ /** Self-timer is operating */
10
+ SELF_TIMER_COUNTDOWN: 'SELF_TIMER_COUNTDOWN',
11
+ /** Performing multi bracket shooting */
12
+ BRACKET_SHOOTING: 'BRACKET_SHOOTING',
13
+ /** Converting post file... */
14
+ CONVERTING: 'CONVERTING',
15
+ /** Performing timeShift shooting */
16
+ TIME_SHIFT_SHOOTING: 'TIME_SHIFT_SHOOTING',
17
+ /** Performing continuous shooting */
18
+ CONTINUOUS_SHOOTING: 'CONTINUOUS_SHOOTING',
19
+ /** Waiting for retrospective video... */
20
+ RETROSPECTIVE_IMAGE_RECORDING: 'RETROSPECTIVE_IMAGE_RECORDING',
21
+ /** Performing burst shooting */
22
+ BURST_SHOOTING: 'BURST_SHOOTING',
23
+ } as const;
24
+
25
+ /** type definition of CaptureStatusEnum */
26
+ export type CaptureStatusEnum =
27
+ (typeof CaptureStatusEnum)[keyof typeof CaptureStatusEnum];
@@ -1,3 +1,4 @@
1
1
  export * from './camera-error';
2
+ export * from './capture-status';
2
3
  export * from './state-gps-info';
3
4
  export * from './theta-state';
@@ -1,5 +1,6 @@
1
1
  import type { ShootingFunctionEnum } from '../options/option-function';
2
2
  import type { CameraErrorEnum } from './camera-error';
3
+ import type { CaptureStatusEnum } from './capture-status';
3
4
  import type { StateGpsInfo } from './state-gps-info';
4
5
 
5
6
  /** Battery charging state constants */
@@ -16,30 +17,6 @@ export const ChargingStateEnum = {
16
17
  export type ChargingStateEnum =
17
18
  (typeof ChargingStateEnum)[keyof typeof ChargingStateEnum];
18
19
 
19
- /** Capture Status constants */
20
- export const CaptureStatusEnum = {
21
- /** Performing continuously shoot */
22
- SHOOTING: 'SHOOTING',
23
- /** In standby */
24
- IDLE: 'IDLE',
25
- /** Self-timer is operating */
26
- SELF_TIMER_COUNTDOWN: 'SELF_TIMER_COUNTDOWN',
27
- /** Performing multi bracket shooting */
28
- BRACKET_SHOOTING: 'BRACKET_SHOOTING',
29
- /** Converting post file... */
30
- CONVERTING: 'CONVERTING',
31
- /** Performing timeShift shooting */
32
- TIME_SHIFT_SHOOTING: 'TIME_SHIFT_SHOOTING',
33
- /** Performing continuous shooting */
34
- CONTINUOUS_SHOOTING: 'CONTINUOUS_SHOOTING',
35
- /** Waiting for retrospective video... */
36
- RETROSPECTIVE_IMAGE_RECORDING: 'RETROSPECTIVE_IMAGE_RECORDING',
37
- } as const;
38
-
39
- /** type definition of CaptureStatusEnum */
40
- export type CaptureStatusEnum =
41
- (typeof CaptureStatusEnum)[keyof typeof CaptureStatusEnum];
42
-
43
20
  /** Microphone option constants */
44
21
  export const MicrophoneOptionEnum = {
45
22
  /** auto */
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
17
17
  s.source_files = "ios/**/*.{h,m,mm,swift}"
18
18
 
19
19
  s.dependency "React-Core"
20
- s.dependency "THETAClient", "1.9.1"
20
+ s.dependency "THETAClient", "1.10.0"
21
21
 
22
22
  # Don't install the dependencies when we run `pod install` in the old architecture.
23
23
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then