theta-client-react-native 1.9.0 → 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 (115) 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 +94 -0
  4. package/ios/ConvertUtil.swift +22 -0
  5. package/ios/ThetaClientReactNative.m +3 -0
  6. package/ios/ThetaClientReactNative.swift +133 -9
  7. package/lib/commonjs/capture/burst-capture.js +13 -1
  8. package/lib/commonjs/capture/burst-capture.js.map +1 -1
  9. package/lib/commonjs/capture/capture.js +24 -1
  10. package/lib/commonjs/capture/capture.js.map +1 -1
  11. package/lib/commonjs/capture/composite-interval-capture.js +13 -1
  12. package/lib/commonjs/capture/composite-interval-capture.js.map +1 -1
  13. package/lib/commonjs/capture/continuous-capture.js +12 -1
  14. package/lib/commonjs/capture/continuous-capture.js.map +1 -1
  15. package/lib/commonjs/capture/limitless-interval-capture.js +29 -2
  16. package/lib/commonjs/capture/limitless-interval-capture.js.map +1 -1
  17. package/lib/commonjs/capture/multi-bracket-capture.js +13 -1
  18. package/lib/commonjs/capture/multi-bracket-capture.js.map +1 -1
  19. package/lib/commonjs/capture/photo-capture.js +34 -10
  20. package/lib/commonjs/capture/photo-capture.js.map +1 -1
  21. package/lib/commonjs/capture/shot-count-specified-interval-capture.js +12 -1
  22. package/lib/commonjs/capture/shot-count-specified-interval-capture.js.map +1 -1
  23. package/lib/commonjs/capture/time-shift-capture.js +12 -1
  24. package/lib/commonjs/capture/time-shift-capture.js.map +1 -1
  25. package/lib/commonjs/capture/video-capture.js +29 -2
  26. package/lib/commonjs/capture/video-capture.js.map +1 -1
  27. package/lib/commonjs/index.js.map +1 -1
  28. package/lib/commonjs/theta-repository/options/option-file-format.js +20 -0
  29. package/lib/commonjs/theta-repository/options/option-file-format.js.map +1 -1
  30. package/lib/commonjs/theta-repository/theta-repository.js +11 -0
  31. package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
  32. package/lib/commonjs/theta-repository/theta-state/capture-status.js +32 -0
  33. package/lib/commonjs/theta-repository/theta-state/capture-status.js.map +1 -0
  34. package/lib/commonjs/theta-repository/theta-state/index.js +11 -0
  35. package/lib/commonjs/theta-repository/theta-state/index.js.map +1 -1
  36. package/lib/commonjs/theta-repository/theta-state/theta-state.js +1 -23
  37. package/lib/commonjs/theta-repository/theta-state/theta-state.js.map +1 -1
  38. package/lib/module/capture/burst-capture.js +13 -1
  39. package/lib/module/capture/burst-capture.js.map +1 -1
  40. package/lib/module/capture/capture.js +22 -0
  41. package/lib/module/capture/capture.js.map +1 -1
  42. package/lib/module/capture/composite-interval-capture.js +13 -1
  43. package/lib/module/capture/composite-interval-capture.js.map +1 -1
  44. package/lib/module/capture/continuous-capture.js +12 -1
  45. package/lib/module/capture/continuous-capture.js.map +1 -1
  46. package/lib/module/capture/limitless-interval-capture.js +29 -2
  47. package/lib/module/capture/limitless-interval-capture.js.map +1 -1
  48. package/lib/module/capture/multi-bracket-capture.js +13 -1
  49. package/lib/module/capture/multi-bracket-capture.js.map +1 -1
  50. package/lib/module/capture/photo-capture.js +35 -11
  51. package/lib/module/capture/photo-capture.js.map +1 -1
  52. package/lib/module/capture/shot-count-specified-interval-capture.js +12 -1
  53. package/lib/module/capture/shot-count-specified-interval-capture.js.map +1 -1
  54. package/lib/module/capture/time-shift-capture.js +12 -1
  55. package/lib/module/capture/time-shift-capture.js.map +1 -1
  56. package/lib/module/capture/video-capture.js +29 -2
  57. package/lib/module/capture/video-capture.js.map +1 -1
  58. package/lib/module/index.js.map +1 -1
  59. package/lib/module/theta-repository/options/option-file-format.js +20 -0
  60. package/lib/module/theta-repository/options/option-file-format.js.map +1 -1
  61. package/lib/module/theta-repository/theta-repository.js +10 -0
  62. package/lib/module/theta-repository/theta-repository.js.map +1 -1
  63. package/lib/module/theta-repository/theta-state/capture-status.js +26 -0
  64. package/lib/module/theta-repository/theta-state/capture-status.js.map +1 -0
  65. package/lib/module/theta-repository/theta-state/index.js +1 -0
  66. package/lib/module/theta-repository/theta-state/index.js.map +1 -1
  67. package/lib/module/theta-repository/theta-state/theta-state.js +0 -22
  68. package/lib/module/theta-repository/theta-state/theta-state.js.map +1 -1
  69. package/lib/typescript/capture/burst-capture.d.ts +4 -2
  70. package/lib/typescript/capture/burst-capture.d.ts.map +1 -1
  71. package/lib/typescript/capture/capture.d.ts +18 -1
  72. package/lib/typescript/capture/capture.d.ts.map +1 -1
  73. package/lib/typescript/capture/composite-interval-capture.d.ts +4 -2
  74. package/lib/typescript/capture/composite-interval-capture.d.ts.map +1 -1
  75. package/lib/typescript/capture/continuous-capture.d.ts +3 -2
  76. package/lib/typescript/capture/continuous-capture.d.ts.map +1 -1
  77. package/lib/typescript/capture/limitless-interval-capture.d.ts +10 -2
  78. package/lib/typescript/capture/limitless-interval-capture.d.ts.map +1 -1
  79. package/lib/typescript/capture/multi-bracket-capture.d.ts +5 -3
  80. package/lib/typescript/capture/multi-bracket-capture.d.ts.map +1 -1
  81. package/lib/typescript/capture/photo-capture.d.ts +15 -8
  82. package/lib/typescript/capture/photo-capture.d.ts.map +1 -1
  83. package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts +3 -2
  84. package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts.map +1 -1
  85. package/lib/typescript/capture/time-shift-capture.d.ts +3 -2
  86. package/lib/typescript/capture/time-shift-capture.d.ts.map +1 -1
  87. package/lib/typescript/capture/video-capture.d.ts +10 -2
  88. package/lib/typescript/capture/video-capture.d.ts.map +1 -1
  89. package/lib/typescript/theta-repository/options/option-file-format.d.ts +30 -0
  90. package/lib/typescript/theta-repository/options/option-file-format.d.ts.map +1 -1
  91. package/lib/typescript/theta-repository/theta-repository.d.ts +7 -0
  92. package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
  93. package/lib/typescript/theta-repository/theta-state/capture-status.d.ts +26 -0
  94. package/lib/typescript/theta-repository/theta-state/capture-status.d.ts.map +1 -0
  95. package/lib/typescript/theta-repository/theta-state/index.d.ts +1 -0
  96. package/lib/typescript/theta-repository/theta-state/index.d.ts.map +1 -1
  97. package/lib/typescript/theta-repository/theta-state/theta-state.d.ts +1 -21
  98. package/lib/typescript/theta-repository/theta-state/theta-state.d.ts.map +1 -1
  99. package/package.json +2 -2
  100. package/src/capture/burst-capture.ts +20 -2
  101. package/src/capture/capture.ts +27 -0
  102. package/src/capture/composite-interval-capture.ts +20 -2
  103. package/src/capture/continuous-capture.ts +19 -2
  104. package/src/capture/limitless-interval-capture.ts +40 -5
  105. package/src/capture/multi-bracket-capture.ts +21 -3
  106. package/src/capture/photo-capture.ts +50 -15
  107. package/src/capture/shot-count-specified-interval-capture.ts +19 -2
  108. package/src/capture/time-shift-capture.ts +19 -2
  109. package/src/capture/video-capture.ts +38 -3
  110. package/src/theta-repository/options/option-file-format.ts +20 -0
  111. package/src/theta-repository/theta-repository.ts +10 -0
  112. package/src/theta-repository/theta-state/capture-status.ts +27 -0
  113. package/src/theta-repository/theta-state/index.ts +1 -0
  114. package/src/theta-repository/theta-state/theta-state.ts +1 -24
  115. 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);
@@ -38,12 +38,24 @@ export const VideoFileFormatEnum = {
38
38
  VIDEO_FULL_HD: 'VIDEO_FULL_HD',
39
39
  /** mp4 1920 x 960 */
40
40
  VIDEO_2K: 'VIDEO_2K',
41
+ /** mp4 1920 x 960 no codec */
42
+ VIDEO_2K_NO_CODEC: 'VIDEO_2K_NO_CODEC',
41
43
  /** mp4 3840 x 1920 */
42
44
  VIDEO_4K: 'VIDEO_4K',
45
+ /** mp4 3840 x 1920 no codec */
46
+ VIDEO_4K_NO_CODEC: 'VIDEO_4K_NO_CODEC',
43
47
  /** mp4 1920 x 960 30fps */
44
48
  VIDEO_2K_30F: 'VIDEO_2K_30F',
45
49
  /** mp4 1920 x 960 60fps */
46
50
  VIDEO_2K_60F: 'VIDEO_2K_60F',
51
+ /** mp4 2752 x 2752 2fps */
52
+ VIDEO_2_7K_2752_2F: 'VIDEO_2_7K_2752_2F',
53
+ /** mp4 2752 x 2752 5fps */
54
+ VIDEO_2_7K_2752_5F: 'VIDEO_2_7K_2752_5F',
55
+ /** mp4 2752 x 2752 10fps */
56
+ VIDEO_2_7K_2752_10F: 'VIDEO_2_7K_2752_10F',
57
+ /** mp4 2752 x 2752 30fps */
58
+ VIDEO_2_7K_2752_30F: 'VIDEO_2_7K_2752_30F',
47
59
  /** mp4 2688 x 2688 1fps */
48
60
  VIDEO_2_7K_1F: 'VIDEO_2_7K_1F',
49
61
  /** mp4 2688 x 2688 2fps */
@@ -52,6 +64,10 @@ export const VideoFileFormatEnum = {
52
64
  VIDEO_3_6K_1F: 'VIDEO_3_6K_1F',
53
65
  /** mp4 3648 x 3648 2fps */
54
66
  VIDEO_3_6K_2F: 'VIDEO_3_6K_2F',
67
+ /** mp4 3840 x 1920 10fps */
68
+ VIDEO_4K_10F: 'VIDEO_4K_10F',
69
+ /** mp4 3840 x 1920 15fps */
70
+ VIDEO_4K_15F: 'VIDEO_4K_15F',
55
71
  /** mp4 3840 x 1920 30fps */
56
72
  VIDEO_4K_30F: 'VIDEO_4K_30F',
57
73
  /** mp4 3840 x 1920 60fps */
@@ -60,6 +76,10 @@ export const VideoFileFormatEnum = {
60
76
  VIDEO_5_7K_2F: 'VIDEO_5_7K_2F',
61
77
  /** mp4 5760 x 2880 5fps */
62
78
  VIDEO_5_7K_5F: 'VIDEO_5_7K_5F',
79
+ /** mp4 5760 x 2880 10fps */
80
+ VIDEO_5_7K_10F: 'VIDEO_5_7K_10F',
81
+ /** mp4 5760 x 2880 15fps */
82
+ VIDEO_5_7K_15F: 'VIDEO_5_7K_15F',
63
83
  /** mp4 5760 x 2880 30fps */
64
84
  VIDEO_5_7K_30F: 'VIDEO_5_7K_30F',
65
85
  /** mp4 7680 x 3840 2fps */
@@ -311,6 +311,16 @@ export function getThetaInfo(): Promise<ThetaInfo> {
311
311
  return ThetaClientReactNative.getThetaInfo();
312
312
  }
313
313
 
314
+ /**
315
+ * Acquires open source license information related to the camera.
316
+ *
317
+ * @function getThetaLicense
318
+ * @return Promise of string result, HTML string of the license.
319
+ */
320
+ export function getThetaLicense(): Promise<string> {
321
+ return ThetaClientReactNative.getThetaLicense();
322
+ }
323
+
314
324
  /**
315
325
  * Get current state of Theta.
316
326
  *
@@ -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.0"
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