@umituz/react-native-ai-generation-content 1.89.72 → 1.89.74
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.89.
|
|
3
|
+
"version": "1.89.74",
|
|
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",
|
|
@@ -54,8 +54,21 @@ export const AudioPickerScreen: React.FC<AudioPickerScreenProps> = ({
|
|
|
54
54
|
setError(null);
|
|
55
55
|
|
|
56
56
|
// Lazy load expo-document-picker only when needed
|
|
57
|
-
//
|
|
58
|
-
const
|
|
57
|
+
// Use require() to avoid Metro bundler parsing the package
|
|
58
|
+
const DocumentPickerModule = require("expo-document-picker");
|
|
59
|
+
const DocumentPicker = DocumentPickerModule as {
|
|
60
|
+
getDocumentAsync: (options: {
|
|
61
|
+
type: string[];
|
|
62
|
+
copyToCacheDirectory: boolean;
|
|
63
|
+
}) => Promise<{
|
|
64
|
+
canceled: boolean;
|
|
65
|
+
assets?: Array<{
|
|
66
|
+
uri: string;
|
|
67
|
+
name: string;
|
|
68
|
+
size?: number;
|
|
69
|
+
}>;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
59
72
|
const result = await DocumentPicker.getDocumentAsync({
|
|
60
73
|
type: mimeTypes as string[],
|
|
61
74
|
copyToCacheDirectory: true,
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { View } from "react-native";
|
|
3
3
|
import { AtomicText } from "@umituz/react-native-design-system/atoms";
|
|
4
4
|
|
|
5
5
|
interface VideoResultPlayerProps {
|
|
6
6
|
uri: string;
|
|
7
|
+
VideoPlayerComponent?: React.ComponentType<{ uri: string }>;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Video Result Player Component
|
|
12
|
+
*
|
|
13
|
+
* This component displays video content. It accepts an optional VideoPlayerComponent prop
|
|
14
|
+
* that should be passed in from the consumer application if video support is desired.
|
|
15
|
+
*
|
|
16
|
+
* If no VideoPlayerComponent is provided, it shows a fallback UI.
|
|
17
|
+
*
|
|
18
|
+
* @example With video player
|
|
19
|
+
* import { VideoPlayer } from '@umituz/react-native-video-editor';
|
|
20
|
+
* <VideoResultPlayer uri={videoUri} VideoPlayerComponent={VideoPlayer} />
|
|
21
|
+
*
|
|
22
|
+
* @example Without video player (fallback)
|
|
23
|
+
* <VideoResultPlayer uri={videoUri} />
|
|
24
|
+
*/
|
|
25
|
+
export const VideoResultPlayer: React.FC<VideoResultPlayerProps> = ({
|
|
26
|
+
uri,
|
|
27
|
+
VideoPlayerComponent,
|
|
28
|
+
}) => {
|
|
29
|
+
if (!VideoPlayerComponent) {
|
|
23
30
|
return (
|
|
24
31
|
<View style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16, backgroundColor: "#000", justifyContent: "center", alignItems: "center" }}>
|
|
25
32
|
<AtomicText style={{ color: "#fff" }}>Video not available</AtomicText>
|
|
@@ -27,14 +34,5 @@ export const VideoResultPlayer: React.FC<VideoResultPlayerProps> = ({ uri }) =>
|
|
|
27
34
|
);
|
|
28
35
|
}
|
|
29
36
|
|
|
30
|
-
return
|
|
31
|
-
<VideoPlayer
|
|
32
|
-
source={uri}
|
|
33
|
-
loop
|
|
34
|
-
autoPlay
|
|
35
|
-
showControls
|
|
36
|
-
contentFit="cover"
|
|
37
|
-
style={{ width: "100%", aspectRatio: 2 / 3, borderRadius: 16 }}
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
37
|
+
return <VideoPlayerComponent uri={uri} />;
|
|
40
38
|
};
|