@umituz/react-native-ai-generation-content 1.20.32 → 1.20.34
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.20.
|
|
3
|
+
"version": "1.20.34",
|
|
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",
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"firebase": ">=10.0.0",
|
|
49
49
|
"react": ">=18.0.0",
|
|
50
50
|
"react-native": ">=0.74.0",
|
|
51
|
-
"react-native-safe-area-context": ">=4.0.0"
|
|
51
|
+
"react-native-safe-area-context": ">=4.0.0",
|
|
52
|
+
"expo-video": ">=1.0.0"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
55
|
"@expo/vector-icons": "^15.0.3",
|
|
@@ -17,6 +17,23 @@ import { AIGenerationResult } from "../display/AIGenerationResult";
|
|
|
17
17
|
import { AIGenerateStep } from "../../hooks/generation/useAIGenerateState";
|
|
18
18
|
import { useAIGenerateWizardFlow } from "./useAIGenerateWizardFlow";
|
|
19
19
|
import { AIGenerateWizardFlowProps } from "./AIGenerateWizardFlow.types";
|
|
20
|
+
import { useVideoPlayer, VideoView } from "expo-video";
|
|
21
|
+
|
|
22
|
+
const VideoResultPlayer = ({ uri }: { uri: string }) => {
|
|
23
|
+
const player = useVideoPlayer(uri, player => {
|
|
24
|
+
player.loop = true;
|
|
25
|
+
player.play();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<VideoView
|
|
30
|
+
style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }}
|
|
31
|
+
player={player}
|
|
32
|
+
contentFit="cover"
|
|
33
|
+
nativeControls
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
20
37
|
|
|
21
38
|
export const AIGenerateWizardFlow: React.FC<AIGenerateWizardFlowProps> = ({
|
|
22
39
|
featureType,
|
|
@@ -114,16 +131,8 @@ export const AIGenerateWizardFlow: React.FC<AIGenerateWizardFlowProps> = ({
|
|
|
114
131
|
icon: "refresh",
|
|
115
132
|
}}
|
|
116
133
|
>
|
|
117
|
-
{isVideo ? (
|
|
118
|
-
|
|
119
|
-
// for now rendering Image with play icon overlay or similar approach is standard if no player passed.
|
|
120
|
-
// However, ideally we should use <Video> generic component.
|
|
121
|
-
// Assuming standard <Image> for now but we should address this.
|
|
122
|
-
// Let's use a conditional or comment.
|
|
123
|
-
<View style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16, backgroundColor: "#000", justifyContent: 'center', alignItems: 'center' }}>
|
|
124
|
-
<AtomicText style={{ color: "white" }}>Video Result: {result ? "Ready" : "Error"}</AtomicText>
|
|
125
|
-
{/* Real implementation should use expo-video or similar */}
|
|
126
|
-
</View>
|
|
134
|
+
{isVideo && result ? (
|
|
135
|
+
<VideoResultPlayer uri={result} />
|
|
127
136
|
) : (
|
|
128
137
|
<Image source={{ uri: result || "" }} style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }} resizeMode="cover" />
|
|
129
138
|
)}
|
|
@@ -82,8 +82,10 @@ export function useAIGenerateWizardFlow({
|
|
|
82
82
|
duration: selectedDuration,
|
|
83
83
|
images,
|
|
84
84
|
});
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
if (output) {
|
|
86
|
+
setResult(output);
|
|
87
|
+
setCurrentStep(AIGenerateStep.RESULT);
|
|
88
|
+
}
|
|
87
89
|
} catch (error) {
|
|
88
90
|
console.error("Generation failed", error);
|
|
89
91
|
setCurrentStep(AIGenerateStep.CONFIG);
|