Class AirPlayServiceInfo
- Namespace
- AppleTvControlLibrary.Discovery.AirPlay
- Assembly
- AppleTvControlLibrary.Discovery.dll
AirPlay specific constants and parsing helpers for mDNS discovery.
public static class AirPlayServiceInfo
- Inheritance
-
AirPlayServiceInfo
- Inherited Members
Fields
SERVICE_TYPE
The AirPlay mDNS service type.
public const string SERVICE_TYPE = "_airplay._tcp.local"
Field Value
Methods
GetPairingRequirement(IReadOnlyDictionary<string, string>)
Derives the pairing requirement for an AirPlay service from its "acl", "model", and "sf"/"flags"/"act" TXT records.
public static AirPlayPairingRequirement GetPairingRequirement(IReadOnlyDictionary<string, string> properties)
Parameters
propertiesIReadOnlyDictionary<string, string>The service's decoded TXT record properties.
Returns
- AirPlayPairingRequirement
The derived pairing requirement.
GetUniqueId(IReadOnlyDictionary<string, string>)
Returns the stable unique identifier for an AirPlay service, from the "deviceid" TXT record, or null if not present.
public static string? GetUniqueId(IReadOnlyDictionary<string, string> properties)
Parameters
propertiesIReadOnlyDictionary<string, string>The service's decoded TXT record properties.
Returns
IsAppleTv(IReadOnlyDictionary<string, string>)
Determines whether a discovered AirPlay service's "model" TXT record identifies it as an Apple TV, as opposed to another AirPlay-capable device (e.g. a receiver or speaker).
public static bool IsAppleTv(IReadOnlyDictionary<string, string> properties)
Parameters
propertiesIReadOnlyDictionary<string, string>The service's decoded TXT record properties.
Returns
RemoveNameCollisionSuffix(string)
Removes a trailing mDNS instance-name disambiguation suffix (e.g. " (2)") from a service name, for display and storage purposes. The suffix is added by the network's mDNS responder when the same name is advertised by more than one device (e.g. an Apple TV and an unrelated AirPlay device both named "Office") and carries no protocol meaning.
public static string RemoveNameCollisionSuffix(string name)
Parameters
namestringThe raw mDNS service instance name.
Returns
- string
The name with any trailing " (n)" suffix removed.
ToDiscoveryResult(Service)
Converts a parsed mDNS Service into an AirPlayDiscoveryResult.
public static AirPlayDiscoveryResult ToDiscoveryResult(Service service)
Parameters
serviceServiceThe parsed mDNS service.
Returns
- AirPlayDiscoveryResult
The AirPlay-specific discovery result.