Camera Plugin feeds Video Editor - file path hell


#1

Hello

I’m getting really frustrated with this… I’m trying to feed a file to Video Editor plugin which was picked from the local storage with Camera plugin, but the path is not recognized and getting error “File Protocol error”

In more details:

I chose Camera plugin with configuration to pick Video (only) files from my local device.
The Camera plugin spits out a video file path from library like

/storage/emulated/0/DCIM/Camera/Vid_xxxxx.mp4

Now when I feed this URL to Video Editor’s .getVideoInfo() member method I get an error “malformedURLException: Protocol not found”.

On the same page I use Media Capture plugin to record a video that then is feeded to Video Editor plugin to transcode it and modify it. This works perfectly.
I see that Media Capture plugin spits out a URL path like

file:///data/user/0/com.app.my/cache/Capture.avi

So obviously this URL is fine for Video Editor.

And I don’t know what kind of hell I’m going to get into when trying on iOS.

Question 1: Do you think I’m using the correct approach here (Camera plugin) to pick a video file from local storage?

Question 2: Is there a way to convert the “/storage/…” path to “file:///…” path?

Any help or guidance is highly appreciated.

Regards
Costas


#2

It seems that by adding “file://” in front of my “/storage/emulated/…” path just did the trick (at least for Android).


#3

I think a better approach is to remove starting slash from the path, so instead /storage/em… it should be storage/em… without “/” at starting point of path


#4

Thank you for your feedback.

I have not tried your approach, since putting “file://” in front of the path allowed me to pass file URI from Camera plugin to the Video Editor plugin.

But if you ever try it with your seggested approach, please share your experience.

Regards
Costas