PlistCodec class

Parses Apple plist responses from AirPlay devices.

AirPlay 1 answers with an XML plist; AirPlay 2 answers the same endpoints with a binary plist. Both are handled here — see parsePlaybackInfoBytes, which picks a decoder from the Content-Type header and falls back to sniffing the bplist00 magic.

The XML parser supports the subset needed for AirPlay: <real>, <integer>, <string>, <true/>, <false/>, <dict>, and <array>.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

isBinaryPlist(List<int> body) bool
Whether body starts with the binary plist magic.
parsePlaybackInfo(String xml) PlaybackInfo
Parses an AirPlay /playback-info XML plist response.
parsePlaybackInfoBytes(List<int> body, {String contentType = ''}) PlaybackInfo
Parses an AirPlay /playback-info response body of either encoding.
parsePlist(List<int> body, {String contentType = ''}) Map<String, dynamic>
Decodes a plist body that may be binary or XML.
parseServerInfo(String xml) ServerInfo
Parses an AirPlay /server-info XML plist response.
parseXmlPlist(String xml) Map<String, dynamic>
Parses an XML plist string into a Map<String, dynamic>.

Constants

binaryPlistContentType → const String
Content type AirPlay 2 uses for binary plists.
binaryPlistMagic → const List<int>
Magic bytes at the start of every binary plist.