diff --git a/react-native-vision-camera b/react-native-vision-camera index 1312c5b..19bf300 160000 --- a/react-native-vision-camera +++ b/react-native-vision-camera @@ -1 +1 @@ -Subproject commit 1312c5be53fdf1912922a1412642e48200cff0aa +Subproject commit 19bf300bbefbe9c8244be3b1c8fbb7a9453ff8e2 diff --git a/src/component/video/camera.tsx b/src/component/video/camera.tsx index 0e93de1..0becc15 100644 --- a/src/component/video/camera.tsx +++ b/src/component/video/camera.tsx @@ -223,6 +223,7 @@ export default function CameraScreen({ camera={camera} onMediaCaptured={onMediaCaptured} enabled={isCameraInitialized} + orientation={orientation} /> void; enabled: boolean; + orientation: string; } export const RecordingButton: React.FC = ({ @@ -24,6 +25,7 @@ export const RecordingButton: React.FC = ({ camera, onMediaCaptured, enabled, + orientation, }) => { const isRecording = useRef(false); // UseRef won't trigger a re-render @@ -54,6 +56,7 @@ export const RecordingButton: React.FC = ({ throw new Error("Camera ref is null!"); // Error handling could be more graceful } console.log("calling startRecording()..."); + console.log(`with ${orientation}`); camera.current.startRecording({ onRecordingError: (error) => { console.error("Recording failed!", error); @@ -63,6 +66,7 @@ export const RecordingButton: React.FC = ({ onMediaCaptured(video, "video"); onStoppedRecording(); }, + orientation: orientation, }); console.log("called startRecording()!"); isRecording.current = true; @@ -70,7 +74,7 @@ export const RecordingButton: React.FC = ({ } catch (e) { console.error("failed to start recording!", e, "camera"); } - }, [camera, onMediaCaptured, onStoppedRecording]); + }, [camera, onMediaCaptured, onStoppedRecording, orientation]); const handlePress = () => { if (isRecording.current) {