Phonegap / Cordova pause event triggered on resume for android; can not turn off audio as a result

前端 未结 1 370
攒了一身酷
攒了一身酷 2021-01-07 16:17

I am developing a Phonegap app that plays audio using the Phonegap Media plugin. When I press the home button or screen lock button on my android device (KitKat 4.4), the a

相关标签:
1条回答
  • 2021-01-07 16:52

    When I was developing an mp3 player for my thesis, I was encountering the same issue in the first android version.
    The issue was that I was not creating threads and so the stop function was not prioritary to be executed.

    I know that my thesis was not in Cordova, but reading Cordova documentation it states

    Threading. JavaScript in the WebView does not run on the UI thread. It runs on the 
    WebCore thread
    

    from Cordova Documentation

    Looking also at Android Documentation, have you thought of implementing a class that handles multiple thread and task queue that fits with Cordova plugin ?

    0 讨论(0)
提交回复
热议问题