Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 13 can't access recorded video using cordova-plugin-file #187

Open
3 tasks done
scattered opened this issue Aug 18, 2020 · 6 comments
Open
3 tasks done

iOS 13 can't access recorded video using cordova-plugin-file #187

scattered opened this issue Aug 18, 2020 · 6 comments

Comments

@scattered
Copy link

Bug Report

Problem

I can't use cordova-plugin-file to access a recorded video on iOS.

What is expected to happen?

I should be able to use the following code to access the recorded video file:

window.resolveLocalFileSystemURL(path, entry => {
    // I should be able to do something with the value in `entry`
}, err => {
    // But I get an error with the status code of 5
});

What does actually happen?

When trying to use the above code, the error callback is called with err containing { code: 5 }.

Information

The above code works in Android, it's only iOS that I'm having an issue.

The fullPath value provided after successfully calling navigator.device.capture.captureVideo() is something like the following: /private/var/mobile/Containers/Data/Application/7EF20D5A-03FE-4EA1-877A-8260CBCCE049/tmp/61945023201__49A539F3-B9CF-4E9B-B8B9-E497668AD4E7.MOV.

There is an open issue for cordova-plugin-camera that might be similar: apache/cordova-plugin-file#346

I tried implementing the fix mentioned in the above issue, but even after copying the file to another location and renaming it I still get the same problem.

I've also tried adding File:// to the start of fullPath, but it resulted in the same issue.

It's worth mentioning that I've added the follow permissions to my config.xml.

<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
    <string>We need camera access to take photos and record videos for theholla.co</string>
</edit-config>
<edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge">
    <string>We need microphone access to record audio while you're making videos for theholla.co</string>
</edit-config>
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
    <string>We need access to your gallery so you can access photos / videos to upload to theholla.co</string>
</edit-config>

The following SOF (relates to React Native, but should still be appropriate) comment advises that I don't need any additional permissions to read / write to an iOS device. So I'm working on the assumption that the above is all that's needed to read / write to the device.

https://stackoverflow.com/questions/53082568/how-can-i-request-ios-storage-permission-in-react-native

Environment, Platform, Device

Development Environment: OSX 10.15.1 / Xcode 11.5
Device: iPhone 6S+ (iOS 13.5.1)

Version information

cordova: 10.0
cordova-ios: 6.1.0
cordova-android: 8.1.0
cordova-browser: 6.0.0
cordova-plugin-android-permissions: 1.0.2
cordova-plugin-file: 6.0.2
cordova-plugin-media-capture: 3.0.3

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@tejasamandaliya

This comment has been minimized.

@timeisgolden

This comment has been minimized.

@Srinivas-Alle

This comment has been minimized.

1 similar comment
@pjain168
Copy link

Facing Same issue

@nicolas-gameffecive
Copy link

nicolas-gameffecive commented Oct 22, 2020

in IOS this is what fixed the issue for me :
remove the '/private' and add file://

fixIosFilePath(path: string) {
    if (path.indexOf('/private/') === 0) {
        path = 'file://' + path.substr(8);
    }

    return path;
}

@aligassan
Copy link

same issue , l have : Failed to load resource: the server responded with a status of 404 () ionic://localhost/var/mobile/Containers/Data/Application/7303203F-585A-43EE-8C5D-6590E6FC27C5/Library/NoCloud/63431338914__90444BBF-32B2-4FBF-B26F-7387CCD5E07E.MOV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants