@umituz/react-native-video-editor 1.0.9 → 1.0.10
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-video-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Professional video editor with layer-based timeline, text/image/shape/audio/animation layers, and export functionality",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -11,16 +11,16 @@ declare const __DEV__: boolean;
|
|
|
11
11
|
* Safely play video with error handling
|
|
12
12
|
*/
|
|
13
13
|
export const safePlay = (player: VideoPlayer | null): boolean => {
|
|
14
|
+
console.log("[safePlay] called, player:", !!player);
|
|
14
15
|
if (!player) return false;
|
|
15
16
|
|
|
16
17
|
try {
|
|
18
|
+
console.log("[safePlay] calling player.play()");
|
|
17
19
|
player.play();
|
|
20
|
+
console.log("[safePlay] player.play() called successfully");
|
|
18
21
|
return true;
|
|
19
22
|
} catch (error) {
|
|
20
|
-
|
|
21
|
-
// eslint-disable-next-line no-console
|
|
22
|
-
console.log("[VideoPlayer] Play error ignored:", error);
|
|
23
|
-
}
|
|
23
|
+
console.log("[safePlay] Play error:", error);
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
@@ -33,17 +33,18 @@ export const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
|
|
33
33
|
const { width } = useWindowDimensions();
|
|
34
34
|
const [showVideo, setShowVideo] = useState(autoPlay);
|
|
35
35
|
|
|
36
|
+
// Always pass source to player - control visibility separately
|
|
36
37
|
const { player, state, controls } = useVideoPlayerControl({
|
|
37
|
-
source
|
|
38
|
+
source,
|
|
38
39
|
loop,
|
|
39
40
|
muted,
|
|
40
|
-
autoPlay:
|
|
41
|
+
autoPlay: false,
|
|
41
42
|
});
|
|
42
43
|
|
|
43
|
-
// Auto-play when
|
|
44
|
+
// Auto-play when user clicks play button
|
|
44
45
|
useEffect(() => {
|
|
45
46
|
if (showVideo && state.isPlayerValid && player) {
|
|
46
|
-
console.log("[VideoPlayer]
|
|
47
|
+
console.log("[VideoPlayer] Starting playback...");
|
|
47
48
|
controls.play();
|
|
48
49
|
}
|
|
49
50
|
}, [showVideo, state.isPlayerValid, player, controls]);
|
|
@@ -31,7 +31,8 @@ export const useVideoPlayerControl = (
|
|
|
31
31
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
32
32
|
const [isLoading, setIsLoading] = useState(true);
|
|
33
33
|
|
|
34
|
-
const player = useExpoVideoPlayer(source
|
|
34
|
+
const player = useExpoVideoPlayer(source || "", (p) => {
|
|
35
|
+
console.log("[useVideoPlayerControl] Player callback, source:", source, "player:", !!p);
|
|
35
36
|
if (source && p) {
|
|
36
37
|
configurePlayer(p, { loop, muted, autoPlay });
|
|
37
38
|
setIsLoading(false);
|