0

Using the following I'm able to control Play, Stop, Pause, ect of the default music player on Android through musicservicecommand. How would I go about playing a specific track instead on the default player? I have both the track ID and the path, I just don't know how to execute it.

  Intent i;
  Context context=this.cordova.getActivity().getApplicationContext();

  i = new Intent("com.android.music.musicservicecommand");
  i.putExtra("command", action);
  context.sendBroadcast(i);
  callbackContext.success("Executed Music Control Cmd: "+action);
Dustin
  • 6,207
  • 19
  • 61
  • 93
  • This thread should help you. http://stackoverflow.com/questions/9528238/playing-audio-file-from-sdcard – Vilas Jan 14 '15 at 08:45
  • Doesn't this just explain how to play how a sound in general instead of a song on the default player (Google Music at the moment.)? – Dustin Jan 14 '15 at 14:54

0 Answers0