Support for the Apple Media Service which provides media playback info and control.

Documented by Apple here:

class adafruit_ble_apple_media.AppleMediaService(**kwargs)

View and control currently playing media.

Exact functionality varies with different media apps. For example, Spotify will include the album name and artist name in title when controlling playback on a remote device. artist includes a description of the remote playback.

advance_repeat_mode() None

Advances the repeat mode. Modes are: Off, One and All

advance_shuffle_mode() None

Advances the shuffle mode. Modes are: Off, One and All


Current track’s album name.


Current track’s artist name.

bookmark_track() None

Bookmarks the current track

dislike_track() None

Dislikes the current track


Current track’s duration as a string.


Time elapsed in the current track. Not updated as the track plays. Use (the amount of time since read elapsed time) * playback_rate to estimate the current elapsed_time.


True when playback is fast-forwarding. False otherwise.

like_track() None

Likes the current track

next_track() None

Stops playing the current track and plays the next one.

pause() None

Pauses the current track. Does nothing if already paused.


True when playback is paused. False otherwise.

play() None

Plays the current track. Does nothing if already playing.


Playback rate as a decimal of normal speed.


Name of the media player app


True when playback is playing. False otherwise.

previous_track() None

Stops playing the current track and plays the previous track.


Current track’s index in the queue.


Count of tracks in the queue.


Current repeat mode as an integer. Off (0), One (1), and All (2)


True when playback is rewinding. False otherwise.


Current shuffle mode as an integer. Off (0), One (1), and All (2)

skip_backward() None

Skips backwards in the current track

skip_forward() None

Skips forwards in the current track


Current track’s title.

toggle_play_pause() None

Plays the current track if it is paused. Otherwise it pauses the track.


Current volume

volume_down() None

Decreases the playback volume.

volume_up() None

Increases the playback volume.

exception adafruit_ble_apple_media.UnsupportedCommand

Raised when the command isn’t available with current media player app.