Using the ionic media capture plugin (using the mp4 version) i capture a video which gives me a path to the video, which is along the lines of: file:///path/to/video/video.mp4
I'm not sure how i'm now meant to upload this via a post request, i have tried using form data as a blob but the video that ends up on the server is completely empty, in fact the post request runs that fast it's like nothing is being uploaded at all, although the console shows the form data is being sent (args.video holds the path to the file):
const blob = new Blob([args.video],{type: 'video/mp4'});
const formData = new FormData();
formData.append('video',blob,'video.mp4');
this.api.post('post/story/new',formData).subscribe((r:ApiResponseInterface)=>{
if(r.valid){
this.toast.success(r.message);
}else{
this.toast.error(r.message);
}
})
I'm assuming that i'm missing a step with the Blob part, as though it's only being given a string for the path but i'm not sure what step i'm missing.