Upload a Captured Video

Hi

Within our App users can capture a video.  We can use media.captureVideo for this purpose, but we want to then store the video for the end user on our cloud servers.

The media.captureVideo returns an event.url which points to the file.  However, I cannot see anyway of uploading this file.

I had a look at this post: https://forums.coronalabs.com/topic/71226-how-can-i-upload-a-video/ but this again misses a step.

I tried to use the IO functionality to copy the file URL to a system directory, but that does not seem to work.

Do you know if this is possible?  We can obviously access the video locally, but we cannot copy and upload it at present.  Any help you can provide would be really helpful.

Matt

I have worked out how to do it by copying the file URL (minus the file:///) to a location in the system.temporaryDirectory.

I can then grab the file and upload it.  What I have found is that on Android it seems to work well.  I tested it on IOS using my IPhone X and the video was uploaded, but the quality is really poor.

I am going to do some more investigating, but are we aware if the API is grabbing a reduced quality video on IOS?

OK, more info on this.  When I select media.SelectVideo() and then select a video, you can see the camera app do a “Compression” before returning to the App.

When I check the file size before I load it to our cloud servers the video is the same size post load so it is definitely being compressed before the listener is called.

Interesting, if I try and email the video it also compresses it, but nothing like as small.  The compression rate when using media.SelectVideo results in a very poor quality video.

Is there anything I can do to stop IOS compressing the video to this level?

I have worked out how to do it by copying the file URL (minus the file:///) to a location in the system.temporaryDirectory.

I can then grab the file and upload it.  What I have found is that on Android it seems to work well.  I tested it on IOS using my IPhone X and the video was uploaded, but the quality is really poor.

I am going to do some more investigating, but are we aware if the API is grabbing a reduced quality video on IOS?

OK, more info on this.  When I select media.SelectVideo() and then select a video, you can see the camera app do a “Compression” before returning to the App.

When I check the file size before I load it to our cloud servers the video is the same size post load so it is definitely being compressed before the listener is called.

Interesting, if I try and email the video it also compresses it, but nothing like as small.  The compression rate when using media.SelectVideo results in a very poor quality video.

Is there anything I can do to stop IOS compressing the video to this level?