diff --git a/js/mobile/src/features/compose/VideoRecordingOverlay.tsx b/js/mobile/src/features/compose/VideoRecordingOverlay.tsx index 459e8a4..92b998b 100644 --- a/js/mobile/src/features/compose/VideoRecordingOverlay.tsx +++ b/js/mobile/src/features/compose/VideoRecordingOverlay.tsx @@ -1,9 +1,10 @@ import { useEffect, useRef, useState } from "react"; -import { Pressable, StyleSheet, Text, View } from "react-native"; +import { Platform, Pressable, StyleSheet, Text, View } from "react-native"; import { CameraView } from "expo-camera"; import { logError } from "@/lib/errors"; const MAX_DURATION_S = 60; +const VIDEO_BITRATE_BPS = 1_200_000; interface VideoRecordingOverlayProps { onComplete: (result: { uri: string; durationMs: number }) => void; @@ -36,7 +37,10 @@ export function VideoRecordingOverlay({ let result: { uri: string } | undefined; try { - result = await cam.recordAsync({ maxDuration: MAX_DURATION_S }); + result = await cam.recordAsync({ + maxDuration: MAX_DURATION_S, + ...(Platform.OS === "ios" ? { codec: "hvc1" as const } : {}), + }); } catch (err) { if (cancelledRef.current) return; logError(err, { scope: "compose.video.recordAsync" }); @@ -83,6 +87,8 @@ export function VideoRecordingOverlay({ ref={cameraRef} style={StyleSheet.absoluteFill} facing="front" + videoQuality="480p" + videoBitrate={VIDEO_BITRATE_BPS} mode="video" mute={false} onCameraReady={() => setCameraReady(true)}