Class MrpClient
- Namespace
- AppleTvControlLibrary.Mrp.PlayerState
- Assembly
- AppleTvControlLibrary.Mrp.dll
Represents a single MRP media player client (identified by bundle identifier).
public sealed class MrpClient
- Inheritance
-
MrpClient
- Inherited Members
Constructors
MrpClient(NowPlayingClient)
Initializes a new instance of the MrpClient class.
public MrpClient(NowPlayingClient client)
Parameters
clientNowPlayingClientThe client identity to initialize from.
Properties
ActivePlayer
Gets or sets the currently active player for this client.
public MrpPlayerState ActivePlayer { get; set; }
Property Value
- MrpPlayerState
The currently active player for this client.
BundleIdentifier
Gets the client's bundle identifier.
public string? BundleIdentifier { get; }
Property Value
- string
The client's bundle identifier.
DisplayName
Gets the client's display name.
public string? DisplayName { get; }
Property Value
- string
The client's display name.
Players
Gets the players known for this client, keyed by player identifier.
public Dictionary<string, MrpPlayerState> Players { get; }
Property Value
- Dictionary<string, MrpPlayerState>
The players known for this client, keyed by player identifier.
SupportedCommands
Gets the default supported commands for this client.
public List<CommandInfo> SupportedCommands { get; }
Property Value
- List<CommandInfo>
The default supported commands for this client.
Methods
GetPlayer(NowPlayingPlayer)
Gets state for a player, creating it if it does not already exist.
public MrpPlayerState GetPlayer(NowPlayingPlayer player)
Parameters
playerNowPlayingPlayerThe player identity to look up.
Returns
- MrpPlayerState
The existing or newly created state for the requested player.
HandleSetDefaultSupportedCommands(SetDefaultSupportedCommandsMessage)
Updates the default supported commands for this client.
public void HandleSetDefaultSupportedCommands(SetDefaultSupportedCommandsMessage supportedCommands)
Parameters
supportedCommandsSetDefaultSupportedCommandsMessageThe decoded SetDefaultSupportedCommandsMessage.
HandleSetNowPlayingPlayer(NowPlayingPlayer)
Handles a change of now-playing player for this client.
public void HandleSetNowPlayingPlayer(NowPlayingPlayer player)
Parameters
playerNowPlayingPlayerThe player identity that is now active.
Update(NowPlayingClient)
Updates client metadata from a NowPlayingClient payload.
public void Update(NowPlayingClient client)
Parameters
clientNowPlayingClientThe client identity to update from.