'Ionic Native Record video and open it in iOS
I'm having this issue trying to record a video with Ionic Capacitor in iOS...
the code is very straightforward..
this.mediaCapture.captureVideo({duration: 10, quality: 0}).then(
(data: MediaFile[]) =>{
if (data.length > 0) {
let videopath = Capacitor.convertFileSrc(data[0].fullPath);
let video = (document.getElementById('myvideo') as HTMLVideoElement).src = videopath;
const contents = Filesystem.readFile({
path: videopath
})
.then(result =>{
let alert = this.alerts.create({
buttons: ['ok'],
message: "file exists" + JSON.stringify(result)
});
alert.then(set => set.present());
})
.catch(err =>{
let alert = this.alerts.create({
buttons: ['ok'],
message: "error file: " + JSON.stringify(err)
});
alert.then(set => set.present());
})
}
}
2022-03-13 16:47:53.446758-0500 App[3048:612360] NSURLConnection finished with error - code -1002
ERROR MESSAGE: {"errorMessage":"The file “66890086390_513929C5-10D6-4FA4-BCFE-3ED763DD08F9.MOV” couldn’t be opened.","message":"The file “66890086390_513929C5-10D6-4FA4-BCFE-3ED763DD08F9.MOV” couldn’t be opened."}
does anyone have or had this issue?? any help is very appreciated!
details: device tested: iPad Air 12.5.5 info.plist (from Xcode)
versions:
- Node v14.15.0
- Ionic 6.18.1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


