PlayersEndpoint class
Player related endpoints/data for Music Assistant.
Constructors
- PlayersEndpoint(MusicAssistantClient _client)
- Create a PlayersEndpoint instance
Properties
Methods
-
createGroupPlayer(
String provider, String name, List< String> members, {bool? isDynamic}) → Future<Player> - Create a new (permanent) Group Player.
-
fetchState(
) → Future< void> - Fetch initial state once the server is connected.
-
getByName(
String name) → Future< Player> - Return Player by name.
-
group(
String playerId, String targetPlayer) → Future< void> - Handle GROUP command for given player.
-
groupVolume(
String playerId, int volumeLevel) → Future< void> - Send VOLUME_SET command to given playergroup.
-
groupVolumeDown(
String playerId) → Future< void> - Send VOLUME_DOWN command to given playergroup.
-
groupVolumeUp(
String playerId) → Future< void> - Send VOLUME_UP command to given playergroup.
-
join(
String targetPlayer, List< String> childPlayerIds) → Future<void> - Join given player(s) to target player.
-
nextTrack(
String playerId) → Future< void> - Handle NEXT TRACK command for given player.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
String playerId) → Future< void> - Send PAUSE command to given player (directly).
-
play(
String playerId) → Future< void> - Send PLAY command to given player (directly).
-
playAnnouncement(
String playerId, String url, {bool? preAnnounce, int? volumeLevel, String? preAnnounceUrl}) → Future< void> - Handle playback of an announcement (url) on given player.
-
playPause(
String playerId) → Future< void> - Send PLAY_PAUSE (toggle) command to given player (directly).
-
pluginSource(
String sourceId) → Future< PlayerSource> - Return PluginSource by source_id.
-
pluginSources(
) → Future< List< PlayerSource> > - Return all available plugin sources.
-
power(
String playerId, bool powered) → Future< void> - Send POWER command to given player.
-
previousTrack(
String playerId) → Future< void> - Handle PREVIOUS TRACK command for given player.
-
remove(
String playerId) → Future< void> - Remove a player from a provider.
-
removeGroupPlayer(
String playerId) → Future< void> - Remove a group player.
-
resume(
String playerId, {String? source, PlayerMedia? media}) → Future< void> - Add the currently playing item/track on given player to the favorites. TODO Send RESUME command to given player.
-
seek(
String playerId, double position) → Future< void> - Handle SEEK command for the given player (directly).
-
selectSoundMode(
String playerId, String soundMode) → Future< void> - Handle SELECT SOUND MODE command on given player.
-
selectSource(
String playerId, String source) → Future< void> - Handle SELECT SOURCE command on given player.
-
setMembers(
String targetPlayer, {List< String> ? playerIdsToAdd, List<String> ? playerIdsToRemove}) → Future<void> - Join/unjoin given player(s) to/from target player.
-
setOption(
String playerId, String optionKey, dynamic optionValue) → Future< void> - Handle SET_OPTION command on given player.
-
stop(
String playerId) → Future< void> - Send STOP command to given player (directly).
-
toString(
) → String -
A string representation of this object.
inherited
-
ungroup(
String playerId) → Future< void> - Handle UNGROUP command for given player.
-
ungroupMany(
List< String> playerIds) → Future<void> - Handle UNGROUP command for all the given players.
-
volumeDown(
String playerId) → Future< void> - Send VOLUME DOWN command to given player.
-
volumeMute(
String playerId, bool muted) → Future< void> - Send VOLUME MUTE command to given player.
-
volumeSet(
String playerId, int volumeLevel) → Future< void> - Send VOLUME SET command to given player.
-
volumeUp(
String playerId) → Future< void> - Send VOLUME UP command to given player.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String playerId) → Player? - Get a fetched player by id.