Wouldn't it be easier to simply use media buttons? Most, if not all, players should handle those.
private static void sendMediaButton(Context context, int keyCode) {
KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN, keyCode);
Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
intent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
context.sendOrderedBroadcast(intent, null);
keyEvent = new KeyEvent(KeyEvent.ACTION_UP, keyCode);
intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
intent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
context.sendOrderedBroadcast(intent, null);
}
Then you could use:
sendMediaButton(getApplicationContext(), KeyEvent.KEYCODE_MEDIA_PAUSE);
You could also send a stop key event. Here's a link with the relevant keys, http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_MEDIA_PAUSE