Handling the Play and Pause Commands

The Play and Pause buttons on the remote control generate separate commands, APPCOMMAND_MEDIA_PLAY and APPCOMMAND_MEDIA_PAUSE, respectively. In addition, some keyboards use a single button to switch between the playing and paused states, generating an APPCOMMAND_MEDIA_PLAY_PAUSE message. Applications should be able to process messages from either the remote control or the keyboard, while keeping track of the current playback state and responding appropriately.

The following table shows the playback state, the keyboard or remote control command, and the recommended action an application should take in response to these messages.

StateCommandAction
StoppedAPPCOMMAND_MEDIA_PLAYPlay
StoppedAPPCOMMAND_MEDIA_PAUSENothing
StoppedAPPCOMMAND_MEDIA_PLAY_PAUSEPlay
PlayingAPPCOMMAND_MEDIA_PLAYNothing
PlayingAPPCOMMAND_MEDIA_PAUSEPause
PlayingAPPCOMMAND_MEDIA_PLAY_PAUSEPause
PausedAPPCOMMAND_MEDIA_PLAYPlay
PausedAPPCOMMAND_MEDIA_PAUSENothing
PausedAPPCOMMAND_MEDIA_PLAY_PAUSEPlay

See Also

Show: