Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
535 views
in Technique[技术] by (71.8m points)

javascript - Is there a way to get the Ionic Framework Media plugin to work with mobile AND browser for a Capacitor Project?

I have an Ionic 5 Angular using Capacitor. I want to capture and playback audio on iOS, Android, and the Browser.

I have been using the following Media Plugin Ionic Media Plugin and the docs clear show that it should work for Android, iOS, and Browser on a Capacitor project.

I create a blank project, and use the example code, and it works just fine on Android and iOS, but on any browser I get the following error:

common.js:291 Native: tried accessing the Media plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator

From all the other questions I've found on StackOverflow and GitHub Issues, it seems that Capacitor projects all run into the same issue.

Ex.

I cannot use ionic cordova run browser since I am using capacitor.

Are there any workarounds to his? Or are the docs just wrong?

question from:https://stackoverflow.com/questions/65943355/is-there-a-way-to-get-the-ionic-framework-media-plugin-to-work-with-mobile-and-b

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...