How to run cordova music player in background with options available on notification bar

℡╲_俬逩灬. 提交于 2019-12-08 17:13:58

问题


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:


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.



来源:https://stackoverflow.com/questions/23670318/how-to-run-cordova-music-player-in-background-with-options-available-on-notifica

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!