Did you check the headphoned app that I linked? It is for Maemo 5 and already sends one command (pause) to Mediaplayer.