fix: prevent mirror review of screen recording
This commit is contained in:
@@ -164,6 +164,7 @@ export function ComposeOverlay({
|
|||||||
stopRecording: stopScreenRecording,
|
stopRecording: stopScreenRecording,
|
||||||
cancelRecording: cancelScreenRecording,
|
cancelRecording: cancelScreenRecording,
|
||||||
} = useScreenRecorder({
|
} = useScreenRecorder({
|
||||||
|
mode: recordingMode,
|
||||||
onFinish: (blob, durationMs, mimeType) => {
|
onFinish: (blob, durationMs, mimeType) => {
|
||||||
setStepSync("reviewing");
|
setStepSync("reviewing");
|
||||||
setReviewBlob(blob);
|
setReviewBlob(blob);
|
||||||
@@ -496,6 +497,7 @@ export function ComposeOverlay({
|
|||||||
onAddFiles={openFilePicker}
|
onAddFiles={openFilePicker}
|
||||||
isDragging={isDragging}
|
isDragging={isDragging}
|
||||||
dropZoneProps={dropZoneProps}
|
dropZoneProps={dropZoneProps}
|
||||||
|
mirror={true}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{step === "reviewing" && recordingSource === "screen" && reviewBlob && (
|
{step === "reviewing" && recordingSource === "screen" && reviewBlob && (
|
||||||
@@ -511,6 +513,7 @@ export function ComposeOverlay({
|
|||||||
onAddFiles={openFilePicker}
|
onAddFiles={openFilePicker}
|
||||||
isDragging={isDragging}
|
isDragging={isDragging}
|
||||||
dropZoneProps={dropZoneProps}
|
dropZoneProps={dropZoneProps}
|
||||||
|
mirror={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{step === "typing" && (
|
{step === "typing" && (
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ interface RecordingOverlayProps {
|
|||||||
onDragLeave: (e: React.DragEvent) => void;
|
onDragLeave: (e: React.DragEvent) => void;
|
||||||
onDrop: (e: React.DragEvent) => void;
|
onDrop: (e: React.DragEvent) => void;
|
||||||
};
|
};
|
||||||
|
/** Mirror the video horizontally. Defaults to true (selfie-view for webcam). Set false for screen recordings. */
|
||||||
|
mirror?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
function RecordingTimer() {
|
function RecordingTimer() {
|
||||||
@@ -52,9 +54,11 @@ function RecordingTimer() {
|
|||||||
function ReviewPlayback({
|
function ReviewPlayback({
|
||||||
blob,
|
blob,
|
||||||
isVideo,
|
isVideo,
|
||||||
|
mirror = true,
|
||||||
}: {
|
}: {
|
||||||
blob: Blob;
|
blob: Blob;
|
||||||
isVideo: boolean;
|
isVideo: boolean;
|
||||||
|
mirror?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const urlRef = useRef<string | null>(null);
|
const urlRef = useRef<string | null>(null);
|
||||||
const [objectUrl, setObjectUrl] = useState<string | null>(null);
|
const [objectUrl, setObjectUrl] = useState<string | null>(null);
|
||||||
@@ -82,7 +86,7 @@ function ReviewPlayback({
|
|||||||
autoPlay
|
autoPlay
|
||||||
loop
|
loop
|
||||||
playsInline
|
playsInline
|
||||||
className="absolute inset-0 h-full w-full -scale-x-100 object-cover"
|
className={`absolute inset-0 h-full w-full object-cover${mirror ? " -scale-x-100" : ""}`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -119,6 +123,7 @@ export function RecordingOverlay({
|
|||||||
onAddFiles,
|
onAddFiles,
|
||||||
isDragging,
|
isDragging,
|
||||||
dropZoneProps,
|
dropZoneProps,
|
||||||
|
mirror = true,
|
||||||
}: RecordingOverlayProps) {
|
}: RecordingOverlayProps) {
|
||||||
const videoRef = useRef<HTMLVideoElement>(null);
|
const videoRef = useRef<HTMLVideoElement>(null);
|
||||||
const recordingAudioSource = useAudioSource(mediaStream ?? null);
|
const recordingAudioSource = useAudioSource(mediaStream ?? null);
|
||||||
@@ -176,6 +181,7 @@ export function RecordingOverlay({
|
|||||||
<ReviewPlayback
|
<ReviewPlayback
|
||||||
blob={reviewBlob}
|
blob={reviewBlob}
|
||||||
isVideo={recordingMode === "video"}
|
isVideo={recordingMode === "video"}
|
||||||
|
mirror={mirror}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user