@umituz/react-native-ai-generation-content 1.84.10 → 1.84.12

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.84.10",
3
+ "version": "1.84.12",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -122,7 +122,9 @@ export class VideoExecutor
122
122
  const data = (rawResult?.data ?? rawResult) as {
123
123
  video?: { url: string };
124
124
  video_url?: string;
125
+ url?: string;
125
126
  };
126
- return data?.video?.url ?? data?.video_url;
127
+ // FAL returns { video: { url } }, Pruna returns { url }, some return { video_url }
128
+ return data?.video?.url ?? data?.video_url ?? data?.url;
127
129
  }
128
130
  }
@@ -107,8 +107,9 @@ export async function executeVideoGeneration(
107
107
  });
108
108
 
109
109
  const rawResult = result as Record<string, unknown>;
110
- const data = (rawResult?.data ?? rawResult) as { video?: { url: string }; video_url?: string };
111
- const videoUrl = data?.video?.url ?? data?.video_url;
110
+ const data = (rawResult?.data ?? rawResult) as { video?: { url: string }; video_url?: string; url?: string };
111
+ // FAL returns { video: { url } }, Pruna returns { url }, some return { video_url }
112
+ const videoUrl = data?.video?.url ?? data?.video_url ?? data?.url;
112
113
 
113
114
  if (typeof __DEV__ !== "undefined" && __DEV__) {
114
115
  console.log("[VideoExecutor] Generation completed", { success: !!videoUrl });
@@ -1,35 +1,19 @@
1
1
  import React from "react";
2
-
3
- // expo-video is optional — module-level lazy require with null stubs
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- let useVideoPlayer: (...args: any[]) => any = () => null;
6
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
- let VideoView: React.ComponentType<any> = () => null;
8
- try {
9
- const expoVideo = require("expo-video");
10
- useVideoPlayer = expoVideo.useVideoPlayer;
11
- VideoView = expoVideo.VideoView;
12
- } catch {
13
- // expo-video not installed in consuming app
14
- }
2
+ import { VideoPlayer } from "@umituz/react-native-video-editor/player";
15
3
 
16
4
  interface VideoResultPlayerProps {
17
5
  uri: string;
18
6
  }
19
7
 
20
8
  export const VideoResultPlayer: React.FC<VideoResultPlayerProps> = ({ uri }) => {
21
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
- const player = useVideoPlayer(uri, (player: any) => {
23
- player.loop = true;
24
- player.play();
25
- });
26
-
27
9
  return (
28
- <VideoView
29
- style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }}
30
- player={player}
10
+ <VideoPlayer
11
+ source={uri}
12
+ loop
13
+ autoPlay
14
+ showControls
31
15
  contentFit="cover"
32
- nativeControls
16
+ style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }}
33
17
  />
34
18
  );
35
19
  };