I ran into an issue when trying to create a thumbnail from a video file on iOS. The error was caused by the app not having proper access to the selected file.
The fix? I had to call url.startAccessingSecurityScopedResource() before actually using the file. Here’s what worked for me:
// ✅ Start accessing the security-scoped resource (iOS only)
let accessGranted = false;
if (Platform.OS === "ios" && video.path.startsWith("file://")) {
accessGranted = video.path.startAccessingSecurityScopedResource();
if (!accessGranted) {
throw new Error("Failed to access security-scoped resource.");
}
}