homerours / cordova-music-controls-plugin

A Cordova plugin displaying music controls in notifications (cordova-plugin-music-controls)
MIT License
155 stars 186 forks source link

updateIsPlaying won't work and ios controls continuously pops up as "playing" #141

Open TylerAHolden opened 5 years ago

TylerAHolden commented 5 years ago

updateIsPlaying method does not work. The music controls on ios 11 lock screen continues to pop up as "playing" (with the pause button shown as if the music is still playing). Anyone else encountering this issue?

ArkeshGKalathiya commented 5 years ago

Hi I have kind of solved issue, but I don't have much knowledge of functionality, I have just added patch. Please check it before you use it.

if(![musicControlsInfo isPlaying]){ nowPlayingCenter.playbackState = MPMusicPlaybackStatePaused; }else{ nowPlayingCenter.playbackState = MPMusicPlaybackStatePlaying; }

Please add above lines in updateIsPlaying function in musiccontrols.m file.