adafruit_ble_apple_media

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

Documented by Apple here: https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleMediaService_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40014716-CH2-SW1

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

album

Current track’s album name.

artist

Current track’s artist name.

bookmark_track() None

Bookmarks the current track

dislike_track() None

Dislikes the current track

duration

Current track’s duration as a string.

elapsed_time

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.

fast_forwarding

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.

paused

True when playback is paused. False otherwise.

play() None

Plays the current track. Does nothing if already playing.

playback_rate

Playback rate as a decimal of normal speed.

player_name

Name of the media player app

playing

True when playback is playing. False otherwise.

previous_track() None

Stops playing the current track and plays the previous track.

queue_index

Current track’s index in the queue.

queue_length

Count of tracks in the queue.

repeat_mode

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

rewinding

True when playback is rewinding. False otherwise.

shuffle_mode

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

title

Current track’s title.

toggle_play_pause() None

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

volume

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.