Can someone give me an example of how to pull convertFileSrc()
from Capacitor instead of using the one from cordova?
I need this because if I use the cordova one, then I cannot run my code in the browser anymore – because cordova.js does not support the browser.
Thanks.
Import Capacitor from @capacitor/core:
import { Capacitor } from '@capacitor/core';
and use it like this:
Capacitor.convertFileSrc('file:///your/file/path');
3 Likes
Thanks! This is not documented anywhere in the Capacitor docs, as far as I can tell.
But, I guess it is documented here, now…
1 Like
netkow
4
1 Like
This worked for me, thanks.
1 Like