AirPlayClient class
Low-level HTTP client for AirPlay video casting endpoints.
Sends requests to an AirPlay device at the given host and port.
All requests include User-Agent: MediaControl/1.0 and a consistent
X-Apple-Session-ID header that is regenerated after stop.
Constructors
- AirPlayClient({required String host, required int port, Client? httpClient})
-
Creates an AirPlayClient targeting the given
hostandport.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
The AirPlay device hostname or IP address.
final
- httpClient → Client
-
The underlying HTTP client. Exposed so pair-verify can share
the same connection for authenticated requests.
no setter
- port → int
-
The AirPlay device port (typically 7000).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sessionId → String
-
The current session ID.
no setter
Methods
-
close(
) → void - Closes the underlying HTTP client.
-
getPlaybackInfo(
) → Future< PlaybackInfo> - Gets detailed playback state as a PlaybackInfo.
-
getScrubPosition(
) → Future< ({double duration, double position})> - Gets the current scrub position as (duration, position) in seconds.
-
getServerInfo(
) → Future< ServerInfo> - Gets device information as a ServerInfo.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
play(
String url, {double startPosition = 0.0}) → Future< void> - Starts playback of a video URL on the AirPlay device.
-
probeDeviceInfo(
) → Future< ({bool authRequired, Map< String, dynamic> properties})> - Probes the device for its capability map.
-
rate(
num value) → Future< void> - Sets the playback rate (0 = pause, 1 = play).
-
scrub(
double positionSeconds) → Future< void> - Seeks to an absolute position in seconds.
-
stop(
) → Future< void> - Stops playback and generates a new session ID.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited