I would encourage you to look at this from the opposite direction.
Anything you can do using only portable browser-supported HTML features, I would suggest doing that way, if only for the fact that it simplifies everything and means you don’t have to ask questions like this and can spend your time doing more interesting things.
Ergo, if I were going to play audio from an Ionic app, I would use the
<audio> element and
MediaStreams in general.
If you decide to go that way, I think we’re done here.
If you’re still reading, any time you deal with something called “Native” anything, it’s best to assume that:
- it’s only going to work on a device (or possibly an emulator)
- that means no rapid development using a desktop browser
- support may be limited to certain OS flavors and versions
- you are committing yourself to a lot more future busywork dealing with device compatibility
Here, the path forks.
Down one road is stuff that is simply impossible to fake - HealthKit / Google Fit, for example. Can’t be done in a browser, no matter how loudly you yell and how vigorously you wave your arms.
Down the other path is stuff that can be reasonably done within a modern web browser using HTML5 - streaming media, geolocation, and so on. The ironic thing is that if you’re looking at something in this neighborhood, there wasn’t really any point in resorting to Cordova in the first place.
- the Cordova “browser” platform is largely pointless
- even if it wasn’t pointless, it’s hard to use and doesn’t work seamlessly the way you seem to expect it would
- “native” functionality imposes significant hassle on your app development, so it’s best reserved for situations where there is no portable way to do what you want
- playing audio is a situation where there is a portable way to do what you want, so I would suggest doing that instead, and forgetting completely that