Я использую Expo-Camera для записи видео всего в течение 5 секунд, он работает на Expo-Go, а также работает над сборкой разработки. Но в производстве экран камеры просто висит, и ничего не происходит позже. const toggleRecording = async () => {
if (!optionsValue || !locationValue) {
alert("Please select sub folder and location values first.");
return;
}
setIsRecording((current) => !current);
if (isRecording) {
// Stop recording
camera.current?.stopRecording();
} else {
// Start recording
const maxDuration = 5;
camera.current
?.recordAsync({
maxDuration: maxDuration,
codec: "hvc1",
})
.then((video) => {
setIsRecording(false);
alert(`Video saved for duration of ${maxDuration} seconds`);
console.log("video", video);
setFiles({
...files,
[optionsValue + locationValue + generateRandomString(6)]: video,
});
})
.catch((error) => {
alert("Error recording video");
alert(error);
});
}
};
< /code>
{
console.log("Camera ready");
}}
>
© Copyright EcoCam
{currentTime?.toLocaleString()}
Latitude: {location?.coords.latitude},
Longitude: {location?.coords.longitude}{" "}
{
router.push(
("/map?lat=" +
location?.coords.latitude +
"&lon=" +
location?.coords.longitude +
"&session=" +
session) as Href
);
}}
>
setOptionsVisible(true)}
>
{optionsValue || "Select sub folder name"}
item.value}
renderItem={({ item }) => (
{
setOptionsValue(item.value);
setOptionsVisible(false);
}}
>
{item.value + " - " + item.label}
)}
style={{ maxHeight: 200 }} // Limits to around 5 items
/>
setOptionsVisible(false)}
style={{ marginTop: 10, alignSelf: "center" }}
>
Cancel
setLocationVisible(true)}
>
{locationValue || "Select location"}
item.value}
renderItem={({ item }) => (
{
setLocationValue(item.value);
setLocationVisible(false);
}}
>
{item.label}
)}
style={{ maxHeight: 200 }} // Limits to around 5 items
/>
setLocationVisible(false)}
style={{ marginTop: 10, alignSelf: "center" }}
>
Cancel
{
await AsyncStorage.setItem("files", JSON.stringify(files));
router.push(`/export?session=${session}`);
}}
>
End Session
{
await AsyncStorage.setItem("files", JSON.stringify(files));
router.push(`/camera?session=${session}`);
}}
>
Switch to photo mode
Подробнее здесь: https://stackoverflow.com/questions/794 ... n-apk-file