Here's a snippet of my code. I'm trying to use a trick I learned which makes use of fetch to convert a file path to a blob. This works fine on my desktop Chrome and on Android, but produces an error on iOS.
import { Capacitor } from '@capacitor/core';
import { VideoEditor } from '@ionic-native/video-editor/ngx';
// irrelevant code here...
return this.videoEditor
.transcodeVideo(transcodeOptions)
.then((path) => {
fullPathTranscoded = "file://" + path
// I've verified that the error comes from here
return fetch(Capacitor.convertFileSrc(fullPathTranscoded))
})
.then((res) => {
return res.blob()
})
.then(async (blob) => {
videoInfo = await this.getVideoInfo(fullPathTranscoded)
return blob
})
The error is Cross origin requests are only supported for HTTP.
I'm working with Ionic/Angular and building with Capacitor.
There are some similar questions online but I haven't found one that's totally relevant to my setup.