Table of Contents

Class MulticastAirPlayDiscovery

Namespace
AppleTvControlLibrary.Discovery.AirPlay
Assembly
AppleTvControlLibrary.Discovery.dll

Discovers AirPlay devices by sending DNS-SD PTR queries to the mDNS multicast group and collecting responses.

public sealed class MulticastAirPlayDiscovery : IAirPlayDiscovery
Inheritance
MulticastAirPlayDiscovery
Implements
Inherited Members

Methods

DiscoveryAsync(string, TimeSpan, CancellationToken)

Discovers an AirPlay device by its mDNS service instance name and completes as soon as that service has been fully resolved.

public static Task<AirPlayDiscoveryResult?> DiscoveryAsync(string appleTvName, TimeSpan timeout, CancellationToken cancellationToken = default)

Parameters

appleTvName string

The exact mDNS service instance name to locate.

timeout TimeSpan

The maximum time to wait for the named device.

cancellationToken CancellationToken

A token to cancel the lookup.

Returns

Task<AirPlayDiscoveryResult>

The matching device, or null when it is not discovered before the timeout.

ScanAsync(TimeSpan, CancellationToken)

Scans the network for AirPlay devices.

public Task<IReadOnlyList<AirPlayDiscoveryResult>> ScanAsync(TimeSpan timeout, CancellationToken cancellationToken = default)

Parameters

timeout TimeSpan

How long to wait for responses.

cancellationToken CancellationToken

A token to cancel the scan.

Returns

Task<IReadOnlyList<AirPlayDiscoveryResult>>

The discovered AirPlay devices.