c# - How to get Track Source in BackgroundMediaPlayer in Windows Phone 8.1 -


code in wp8.0

  if (backgroundaudioplayer.instance.playerstate == playstate.playing)    {       if (backgroundaudioplayer.instance != null && backgroundaudioplayer.instance.track.source.tostring().contains("claps.mp3"))        {           backgroundaudioplayer.instance.stop();        }    } 

when convert code wp8.1 universal apps, replaced backgroundaudioplayer backgroundmediaplayer, , tried below code

if(backgroundmediaplayer.current.currentstate==mediaplayerstate.playing)     {       if(backgroundmediaplayer.current!=null && )        {          backgroundmediaplayer.current.pause();        }      } 

for second if condition compare present source track user input. how present track source in backgroundmediaplayer. please me solve error.

there no way directly source media player. need make own mechanism saving source somewhere after setting (like local settings) , checking it.


Popular posts from this blog