How to run cordova music player in background with

2019-06-16 19:07发布

I am building music player application for android phone using cordova media plugin.

With the help of plugin i am able to play the local music now i wants to add a feature that even if the application is closed by the user. Music player should run in background with play,pause,exit options available in notification bar.

Can any one help me in this case.

Thanks in advance

1条回答
萌系小妹纸
2楼-- · 2019-06-16 19:20

I'm using this plugin here, and it works for me on android: https://github.com/homerours/cordova-music-controls-plugin

It does not control the media for you automatically though, you have handle its events and control the media yourself.

Keep in mind that at the moment, if your app is closed in the background by the system, the notification will still be shown. This is a known bug.

查看更多
登录 后发表回答