@umituz/react-native-ai-generation-content 1.17.214 → 1.17.216
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
|
@@ -104,6 +104,24 @@ export interface IAnalyticsService {
|
|
|
104
104
|
track: (event: string, data: Record<string, unknown>) => void;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Feature utils interface (optional)
|
|
109
|
+
* Provides utility functions for AI features
|
|
110
|
+
*/
|
|
111
|
+
export interface IFeatureUtils {
|
|
112
|
+
/**
|
|
113
|
+
* Select image from gallery
|
|
114
|
+
* @returns Image URI or null if cancelled
|
|
115
|
+
*/
|
|
116
|
+
selectImage: () => Promise<string | null>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Save video to device library
|
|
120
|
+
* @param uri - Video URI to save
|
|
121
|
+
*/
|
|
122
|
+
saveVideo: (uri: string) => Promise<void>;
|
|
123
|
+
}
|
|
124
|
+
|
|
107
125
|
/**
|
|
108
126
|
* Combined app services interface
|
|
109
127
|
* Apps implement this to provide all required services
|
|
@@ -114,6 +132,7 @@ export interface IAppServices {
|
|
|
114
132
|
readonly paywall: IPaywallService;
|
|
115
133
|
readonly auth: IAuthService;
|
|
116
134
|
readonly analytics?: IAnalyticsService;
|
|
135
|
+
readonly featureUtils?: IFeatureUtils;
|
|
117
136
|
}
|
|
118
137
|
|
|
119
138
|
/**
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Video player with thumbnail and play controls for creation detail view
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React, { useMemo } from "react";
|
|
7
|
-
import { View } from "react-native";
|
|
6
|
+
import React, { useMemo, useState } from "react";
|
|
7
|
+
import { View, StyleSheet } from "react-native";
|
|
8
|
+
import { VideoView, useVideoPlayer } from "expo-video";
|
|
8
9
|
import { useResponsive } from "@umituz/react-native-design-system";
|
|
9
|
-
import { VideoPlayer } from "@umituz/react-native-video-editor";
|
|
10
10
|
|
|
11
11
|
interface DetailVideoProps {
|
|
12
12
|
readonly videoUrl: string;
|
|
@@ -20,20 +20,28 @@ export const DetailVideo: React.FC<DetailVideoProps> = ({
|
|
|
20
20
|
const { width, horizontalPadding, spacingMultiplier } = useResponsive();
|
|
21
21
|
const videoWidth = width - (horizontalPadding * 2);
|
|
22
22
|
|
|
23
|
+
const player = useVideoPlayer(videoUrl, (player) => {
|
|
24
|
+
player.loop = true;
|
|
25
|
+
});
|
|
26
|
+
|
|
23
27
|
const containerStyle = useMemo(() => ({
|
|
24
28
|
paddingHorizontal: horizontalPadding,
|
|
25
29
|
marginVertical: 16 * spacingMultiplier,
|
|
26
30
|
}), [horizontalPadding, spacingMultiplier]);
|
|
27
31
|
|
|
32
|
+
const videoStyle = useMemo(() => ({
|
|
33
|
+
width: videoWidth,
|
|
34
|
+
height: (videoWidth * 9) / 16, // 16:9 aspect ratio
|
|
35
|
+
}), [videoWidth]);
|
|
36
|
+
|
|
28
37
|
return (
|
|
29
38
|
<View style={containerStyle}>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
<VideoView
|
|
40
|
+
style={videoStyle}
|
|
41
|
+
player={player}
|
|
42
|
+
allowsFullscreen
|
|
43
|
+
allowsPictureInPicture
|
|
34
44
|
nativeControls
|
|
35
|
-
contentFit="cover"
|
|
36
|
-
style={{ width: videoWidth }}
|
|
37
45
|
/>
|
|
38
46
|
</View>
|
|
39
47
|
);
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type {
|
|
|
10
10
|
SubscribeOptions, RunOptions, ImageFeatureType, VideoFeatureType, ImageFeatureInputData,
|
|
11
11
|
VideoFeatureInputData, ProviderCapabilities, ProviderProgressInfo, INetworkService,
|
|
12
12
|
ICreditService, IPaywallService, IAuthService, IAnalyticsService, IAppServices, PartialAppServices,
|
|
13
|
+
IFeatureUtils,
|
|
13
14
|
} from "./domain/interfaces";
|
|
14
15
|
|
|
15
16
|
export { AIErrorType } from "./domain/entities";
|