Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
528 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...