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

File:// protocol causes crash #46

Open
viking2917 opened this issue Jan 4, 2025 · 0 comments
Open

File:// protocol causes crash #46

viking2917 opened this issue Jan 4, 2025 · 0 comments

Comments

@viking2917
Copy link

I'm using this to upload videos recorded by https://github.com/capacitor-community/video-recorder. On iOS the file uploads successfully, but on Android, it crashes.

The video-recorder produces file URLs of the form:

'http://192.168.1.36:8100/_capacitor_file_/storage/emulated/0/Android/data/<myappid>/files/VID_20250104103919.mp4'

on iOS, following the video-recorder example code, I replace it with a file:// URL and it works fine.
e.g.

filePath = 'file://' + srcVideo.split('_capacitor_file_')[1];

to produce a url like:

'file:///storage/emulated/0/Android/data/com.ionicframework.bookship/files/VID_20250104103919.mp4'

Uploading this file on Android using this plugin crashes with the following error:

Upload failed: Unsupported scheme for file:///storage/emulated/0/Android/data/<myappid>/files/VID_20250104103919.mp4.

Currently supported schemes are [/, content://]

If I replace file:// with '' on Android, it works. I do not know if that is expected, but ideally, the plugin would work the same on both platforms.

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

1 participant