@umituz/react-native-video-editor 1.0.12 → 1.0.14
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.14",
|
|
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",
|
|
@@ -128,12 +128,20 @@ export const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
|
|
128
128
|
hasPlayer: !!player,
|
|
129
129
|
source,
|
|
130
130
|
});
|
|
131
|
+
// eslint-disable-next-line no-console
|
|
132
|
+
console.log("[VideoPlayer] dimensions:", {
|
|
133
|
+
screenWidth,
|
|
134
|
+
horizontalPadding,
|
|
135
|
+
videoWidth,
|
|
136
|
+
videoHeight,
|
|
137
|
+
styleWidth: getWidthFromStyle(style as ViewStyle),
|
|
138
|
+
});
|
|
131
139
|
}
|
|
132
140
|
|
|
133
141
|
if (showVideo && state.isPlayerValid && player) {
|
|
134
142
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
135
143
|
// eslint-disable-next-line no-console
|
|
136
|
-
console.log("[VideoPlayer] Rendering VideoView");
|
|
144
|
+
console.log("[VideoPlayer] Rendering VideoView with dimensions:", { videoWidth, videoHeight });
|
|
137
145
|
}
|
|
138
146
|
return (
|
|
139
147
|
<View style={[containerStyle, style]}>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Main hook for video player control with safe operations
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { useState, useCallback, useMemo } from "react";
|
|
6
|
+
import { useState, useCallback, useMemo, useEffect } from "react";
|
|
7
7
|
import { useVideoPlayer as useExpoVideoPlayer } from "expo-video";
|
|
8
8
|
|
|
9
9
|
import type {
|
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
configurePlayer,
|
|
21
21
|
} from "../../infrastructure/services/player-control.service";
|
|
22
22
|
|
|
23
|
+
declare const __DEV__: boolean;
|
|
24
|
+
|
|
23
25
|
/**
|
|
24
26
|
* Hook for managing video player with safe operations
|
|
25
27
|
*/
|
|
@@ -32,16 +34,55 @@ export const useVideoPlayerControl = (
|
|
|
32
34
|
const [isLoading, setIsLoading] = useState(true);
|
|
33
35
|
|
|
34
36
|
const player = useExpoVideoPlayer(source || "", (p) => {
|
|
35
|
-
|
|
37
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
38
|
+
// eslint-disable-next-line no-console
|
|
39
|
+
console.log("[useVideoPlayerControl] Player callback, source:", source, "player:", !!p);
|
|
40
|
+
}
|
|
36
41
|
if (source && p) {
|
|
37
42
|
configurePlayer(p, { loop, muted, autoPlay });
|
|
38
43
|
setIsLoading(false);
|
|
39
44
|
if (autoPlay) {
|
|
40
45
|
setIsPlaying(true);
|
|
41
46
|
}
|
|
47
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
48
|
+
// eslint-disable-next-line no-console
|
|
49
|
+
console.log("[useVideoPlayerControl] Player status:", {
|
|
50
|
+
currentTime: p.currentTime,
|
|
51
|
+
duration: p.duration,
|
|
52
|
+
status: p.status,
|
|
53
|
+
playing: p.playing,
|
|
54
|
+
muted: p.muted,
|
|
55
|
+
volume: p.volume,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
42
58
|
}
|
|
43
59
|
});
|
|
44
60
|
|
|
61
|
+
// Listen to player status changes and errors
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!player) return;
|
|
64
|
+
|
|
65
|
+
const subscription = player.addListener("statusChange", ({ status, error }) => {
|
|
66
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
67
|
+
// eslint-disable-next-line no-console
|
|
68
|
+
console.log("[useVideoPlayerControl] Status changed:", status, "Error:", error);
|
|
69
|
+
}
|
|
70
|
+
if (status === "readyToPlay") {
|
|
71
|
+
setIsLoading(false);
|
|
72
|
+
}
|
|
73
|
+
if (error) {
|
|
74
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
75
|
+
// eslint-disable-next-line no-console
|
|
76
|
+
console.error("[useVideoPlayerControl] Player error:", error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return () => {
|
|
82
|
+
subscription.remove();
|
|
83
|
+
};
|
|
84
|
+
}, [player]);
|
|
85
|
+
|
|
45
86
|
const isPlayerValid = useMemo(
|
|
46
87
|
() => isPlayerReady(player, source),
|
|
47
88
|
[player, source],
|