@umituz/react-native-ai-generation-content 1.20.33 → 1.20.35

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.33",
3
+ "version": "1.20.35",
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",
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { useVideoPlayer, VideoView } from "expo-video";
3
+
4
+ interface VideoResultPlayerProps {
5
+ uri: string;
6
+ }
7
+
8
+ export const VideoResultPlayer: React.FC<VideoResultPlayerProps> = ({ uri }) => {
9
+ const player = useVideoPlayer(uri, (player) => {
10
+ player.loop = true;
11
+ player.play();
12
+ });
13
+
14
+ return (
15
+ <VideoView
16
+ style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }}
17
+ player={player}
18
+ contentFit="cover"
19
+ nativeControls
20
+ />
21
+ );
22
+ };
@@ -17,6 +17,7 @@ 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 { VideoResultPlayer } from "../display/VideoResultPlayer";
20
21
 
21
22
  export const AIGenerateWizardFlow: React.FC<AIGenerateWizardFlowProps> = ({
22
23
  featureType,
@@ -114,16 +115,8 @@ export const AIGenerateWizardFlow: React.FC<AIGenerateWizardFlowProps> = ({
114
115
  icon: "refresh",
115
116
  }}
116
117
  >
117
- {isVideo ? (
118
- // TODO: Use correct video player component if available in design system,
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>
118
+ {isVideo && result ? (
119
+ <VideoResultPlayer uri={result} />
127
120
  ) : (
128
121
  <Image source={{ uri: result || "" }} style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }} resizeMode="cover" />
129
122
  )}