@umituz/react-native-ai-generation-content 1.17.141 → 1.17.142

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.17.141",
3
+ "version": "1.17.142",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -89,27 +89,33 @@ export async function executeImageToVideo(
89
89
 
90
90
  if (typeof __DEV__ !== "undefined" && __DEV__) {
91
91
  // eslint-disable-next-line no-console
92
- console.log("[ImageToVideoExecutor] Starting provider.run()...");
92
+ console.log("[ImageToVideoExecutor] Starting provider.subscribe()...");
93
93
  }
94
94
 
95
95
  // Build input directly - let buildInput handle base64 format
96
96
  const input = buildInput(request.imageBase64, request.motionPrompt, request.options);
97
97
 
98
- // Call provider.run with onProgress like text-to-video does
99
- const result = await provider.run(model, input, {
100
- onProgress: (progressInfo) => {
101
- const progressValue = progressInfo.progress;
98
+ // Use subscribe for video generation (long-running operation with queue)
99
+ // subscribe provides progress updates unlike run()
100
+ const result = await provider.subscribe(model, input, {
101
+ onQueueUpdate: (status) => {
102
102
  if (typeof __DEV__ !== "undefined" && __DEV__) {
103
103
  // eslint-disable-next-line no-console
104
- console.log("[ImageToVideoExecutor] Progress:", progressValue);
104
+ console.log("[ImageToVideoExecutor] Queue status:", status.status, "position:", status.queuePosition);
105
+ }
106
+ // Map queue status to progress
107
+ if (status.status === "IN_QUEUE") {
108
+ onProgress?.(10);
109
+ } else if (status.status === "IN_PROGRESS") {
110
+ onProgress?.(50);
105
111
  }
106
- onProgress?.(progressValue);
107
112
  },
113
+ timeoutMs: 300000, // 5 minutes timeout for video generation
108
114
  });
109
115
 
110
116
  if (typeof __DEV__ !== "undefined" && __DEV__) {
111
117
  // eslint-disable-next-line no-console
112
- console.log("[ImageToVideoExecutor] provider.run() completed");
118
+ console.log("[ImageToVideoExecutor] provider.subscribe() completed");
113
119
  }
114
120
 
115
121
  const extractor = extractResult || defaultExtractResult;