org.bluez.MediaPlayer(5)

🎧 org.bluez.MediaPlayer(5) β€” the BlueZ D-Bus MediaPlayer API, explained πŸ’…

okay bestie, so this is a page from the Linux System Administration manual set, and it's all about org.bluez.MediaPlayer β€” the BlueZ D-Bus MediaPlayer API documentation. Think of it as the remote control energy for your Bluetooth audio/video player. Obsessed. Let's go. ✨


🌸 INTERFACE 🌸

Service πŸ’–

  • org.bluez (Controller role)

Interface πŸŽ€

  • org.bluez.MediaPlayer1

Object path πŸ¦‹

[variable prefix]/{hci0,hci1,...}/dev_{BDADDR}/player#

Used by πŸ‘‘


πŸ”₯ METHODS πŸ”₯

void Play()

Resumes playback. it's giving "press play on the aux, the vibes are back". πŸ’œ

Possible Errors:

  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

Examples:

bluetoothctl
       > player.play [item]

void Pause()

Pauses playback. dramatic pause, literally. 😭

Possible Errors:

  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

Examples:

bluetoothctl
       > player.pause

void Stop()

Stops playback. periodt, we're done here. πŸ’…

Possible Errors:

  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

Examples:

bluetoothctl
       > player.stop

void Next()

Skips to the next item. skip, next, slay. ⭐

Possible Errors:

  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

Examples:

bluetoothctl
       > player.next

void Previous()

Goes back to the previous item. we're rewinding the timeline bestie πŸ¦‹

Possible Errors:

  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

Examples:

bluetoothctl
       > player.previous

void FastForward()

Fast forwards playback β€” and heads up, this action is only stopped when another method in this interface is called. so it just keeps zooming until you do something else, no cap. πŸ”₯

Possible Errors:

  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

Examples:

bluetoothctl
       > player.fast-forward

void Rewind()

Rewinds playback β€” same deal, this action is only stopped when another method in this interface is called. it's giving throwback energy and it does not stop on its own. πŸŽ€

Possible Errors:

  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

Examples:

bluetoothctl
       > player.rewind

void Press(byte avc_key)

Presses a specific key, sent as a passthrough command. take avc_key, which is a byte.

The key gets released automatically β€” so if your whole intention is to hold the key down, use Hold() instead, bestie. πŸ’–

Possible Errors:

  • org.bluez.Error.InvalidArguments
  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

void Hold(byte avc_key)

Presses and holds a specific key, sent as a passthrough command. takes avc_key, a byte.

⚠️ it is the responsibility of the caller to make sure that Release() is called after calling this method. no cap, don't leave it hanging. πŸ’€

The held key will also be released when any other method in this interface is called. so it's not forever, it's just until you do literally anything else. πŸ™ˆ

Possible Errors:

  • org.bluez.Error.InvalidArguments
  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

void Release()

Releases the previously held key β€” the one you invoked using Hold(). closure, we love to see it. 🫢

Possible Errors:

  • org.bluez.Error.NotSupported
  • org.bluez.Error.Failed

✨ PROPERTIES ✨

string Equalizer [readwrite]

Indicates the Player Equalizer setting.

Possible values:

  • "off"
  • "on"

Examples:

bluetoothctl
       [player] > equalizer <on/off>

string Repeat [readwrite]

Indicates the Player Repeat setting.

Possible values:

  • "off"
  • "singletrack"
  • "alltracks"
  • "group"

Examples:

bluetoothctl
       [player] > repeat <singletrack/alltracks/group/off>

string Shuffle [readwrite]

Indicates the Player Shuffle setting.

Possible values:

  • "off"
  • "alltracks"
  • "group"

Examples:

bluetoothctl
       [player] > shuffle <alltracks/group/off>

string Scan [readwrite]

Indicates the Player Scan setting.

Possible values:

  • "off"
  • "alltracks"
  • "group"

Examples:

bluetoothctl
       [player] > scan <alltracks/group/off>

string Status [readonly]

Indicates the Player Status setting.

Possible status:

  • "playing"
  • "stopped"
  • "paused"
  • "forward-seek"
  • "reverse-seek"
  • "error"

uint32 Position [readonly]

Playback position in milliseconds.

Changing the position may generate additional events that will be sent to the remote device. When position is 0 it means the track is starting, and when it's greater than or equal to the track's duration the track has ended. main character timeline behaviour, honestly. ⏱️

Note that even if duration is not available in metadata, it's possible to signal its end by setting position to the maximum uint32 value. iykyk. πŸ’…

dict Track [readonly]

Track metadata. the whole lore of the song, in one dict πŸŽ€

Possible values:

  • string Title β€” Track title name
  • string Artist β€” Track artist name
  • string Album β€” Track album name
  • string Genre β€” Track genre name
  • uint32 NumberOfTracks β€” Number of tracks in total
  • uint32 TrackNumber β€” Track number
  • uint32 Duration β€” Track duration in milliseconds
  • string ImgHandle β€” [experimental] β€” Track image handle, available and valid only during the lifetime of an OBEX BIP connection to the ObexPort.

object Device [readonly]

Device object path.

string Name [readonly]

Player name. literally the name. πŸ’œ

string Type [readonly]

Player type.

Possible values:

  • "Audio"
  • "Video"
  • "Audio Broadcasting"
  • "Video Broadcasting"

string Subtype [readonly]

Player subtype.

Possible values:

  • "Audio Book"
  • "Podcast"

boolean Browsable [readonly]

If present, indicates the player can be browsed using the MediaFolder interface. πŸ‘€

Possible values:

  • True β€” Supported and active
  • False β€” Supported but inactive
Note: If supported but inactive, clients can enable it by using the org.bluez.MediaFolder(5) interface β€” but it might interfere in the playback of other players. so like, proceed with caution bestie. ⚠️

boolean Searchable [readonly]

If present, indicates the player can be searched using the MediaFolder interface. πŸ”

Possible values:

  • True β€” Supported and active
  • False β€” Supported but inactive
Note: If supported but inactive, clients can enable it by using the org.bluez.MediaFolder(5) interface β€” but it might interfere in the playback of other players. same warning, same energy. ⚠️

object Playlist

Playlist object path.

uint16 ObexPort [readonly, experimental]

If present, indicates the player can get cover art using BIP over OBEX on this PSM port. album art access, we stan. πŸ–ΌοΈ


🌈 and that's the whole page, bestie β€” brought to you by BlueZ, dated September 2023. go forth and control that media player, you absolute icon. πŸ‘‘πŸ’–

πŸ“¦ where this page comes from