fix: review screen recording without clipped content
This commit is contained in:
@@ -503,6 +503,7 @@ export function ComposeOverlay({
|
|||||||
isDragging={isDragging}
|
isDragging={isDragging}
|
||||||
dropZoneProps={dropZoneProps}
|
dropZoneProps={dropZoneProps}
|
||||||
mirror={true}
|
mirror={true}
|
||||||
|
objectFit="cover"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{step === "reviewing" && recordingSource === "screen" && reviewBlob && (
|
{step === "reviewing" && recordingSource === "screen" && reviewBlob && (
|
||||||
@@ -519,6 +520,7 @@ export function ComposeOverlay({
|
|||||||
isDragging={isDragging}
|
isDragging={isDragging}
|
||||||
dropZoneProps={dropZoneProps}
|
dropZoneProps={dropZoneProps}
|
||||||
mirror={false}
|
mirror={false}
|
||||||
|
objectFit="contain"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{step === "typing" && (
|
{step === "typing" && (
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ 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 the video horizontally. Defaults to true (selfie-view for webcam). */
|
||||||
mirror?: boolean;
|
mirror?: boolean;
|
||||||
|
/** How video fills its container. Defaults to "cover". Use "contain" for screen recordings. */
|
||||||
|
objectFit?: "cover" | "contain";
|
||||||
}
|
}
|
||||||
|
|
||||||
function RecordingTimer() {
|
function RecordingTimer() {
|
||||||
@@ -55,10 +57,12 @@ function ReviewPlayback({
|
|||||||
blob,
|
blob,
|
||||||
isVideo,
|
isVideo,
|
||||||
mirror = true,
|
mirror = true,
|
||||||
|
objectFit = "cover",
|
||||||
}: {
|
}: {
|
||||||
blob: Blob;
|
blob: Blob;
|
||||||
isVideo: boolean;
|
isVideo: boolean;
|
||||||
mirror?: boolean;
|
mirror?: boolean;
|
||||||
|
objectFit?: "cover" | "contain";
|
||||||
}) {
|
}) {
|
||||||
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);
|
||||||
@@ -86,7 +90,7 @@ function ReviewPlayback({
|
|||||||
autoPlay
|
autoPlay
|
||||||
loop
|
loop
|
||||||
playsInline
|
playsInline
|
||||||
className={`absolute inset-0 h-full w-full object-cover${mirror ? " -scale-x-100" : ""}`}
|
className={`absolute inset-0 h-full w-full ${objectFit === "contain" ? "object-contain" : "object-cover"}${mirror ? " -scale-x-100" : ""}`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -124,6 +128,7 @@ export function RecordingOverlay({
|
|||||||
isDragging,
|
isDragging,
|
||||||
dropZoneProps,
|
dropZoneProps,
|
||||||
mirror = true,
|
mirror = true,
|
||||||
|
objectFit = "cover",
|
||||||
}: RecordingOverlayProps) {
|
}: RecordingOverlayProps) {
|
||||||
const videoRef = useRef<HTMLVideoElement>(null);
|
const videoRef = useRef<HTMLVideoElement>(null);
|
||||||
const recordingAudioSource = useAudioSource(mediaStream ?? null);
|
const recordingAudioSource = useAudioSource(mediaStream ?? null);
|
||||||
@@ -182,6 +187,7 @@ export function RecordingOverlay({
|
|||||||
blob={reviewBlob}
|
blob={reviewBlob}
|
||||||
isVideo={recordingMode === "video"}
|
isVideo={recordingMode === "video"}
|
||||||
mirror={mirror}
|
mirror={mirror}
|
||||||
|
objectFit={objectFit}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user