Documentation ¶
Index ¶
- type Client
- func (c *Client) GetPlaybackInfo() (*PlaybackInfo, error)
- func (c *Client) Photo(path string)
- func (c *Client) PhotoWithSlide(path string, transition SlideTransition)
- func (c *Client) Play(url string) <-chan error
- func (c *Client) PlayAt(url string, position float64) <-chan error
- func (c *Client) Rate(rate float64)
- func (c *Client) Scrub(position float64)
- func (c Client) SetPassword(password string)
- func (c *Client) Stop()
- type ClientParam
- type DNSResponseParseError
- type Device
- type DeviceExtra
- type PlaybackInfo
- type SlideTransition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func FirstClient ¶
FirstClient return the AirPlay Client that has the first found AirPlay device in LAN
func NewClient ¶
func NewClient(params *ClientParam) (*Client, error)
func (*Client) GetPlaybackInfo ¶
func (c *Client) GetPlaybackInfo() (*PlaybackInfo, error)
GetPlaybackInfo retrieves playback informations.
func (*Client) Photo ¶
Photo show a JPEG picture. It can specify both remote or local file.
A trivial example:
// local file client.Photo("/path/to/gopher.jpg") // remote file client.Photo("http://blog.golang.org/gopher/plush.jpg")
func (*Client) PhotoWithSlide ¶
func (c *Client) PhotoWithSlide(path string, transition SlideTransition)
PhotoWithSlide show a JPEG picture in the transition specified.
func (*Client) Play ¶
Play start content playback.
When playback is finished, sends termination status on the returned channel. If non-nil, not a successful termination.
func (*Client) PlayAt ¶
PlayAt start content playback by specifying the start position.
Returned channel is the same as Play().
func (*Client) Rate ¶
Rate change the playback rate in playing content.
If rate is 0, content is paused. if rate is 1, content playing at the normal speed.
func (Client) SetPassword ¶
type ClientParam ¶
type DNSResponseParseError ¶
func NewDNSResponseParseError ¶
func NewDNSResponseParseError(t string, r []dns.RR) *DNSResponseParseError
func (*DNSResponseParseError) Error ¶
func (e *DNSResponseParseError) Error() string
type Device ¶
type Device struct { Name string Addr string Port int Extra DeviceExtra }
A Device is an AirPlay Device.
func FirstDevice ¶
func FirstDevice() Device
FirstDevice return the first found AirPlay device in LAN.
type DeviceExtra ¶
type DeviceExtra struct { Model string Features string MacAddress string ServerVersion string IsPasswordRequired bool }
A DeviceExtra is extra information of AirPlay device.
type PlaybackInfo ¶
type PlaybackInfo struct { // IsReadyToPlay, if true, content is currently playing or ready to play. IsReadyToPlay bool `plist:"readyToPlay"` // ReadyToPlayValue represents the information on whether content is currently playing, ready to play or not. ReadyToPlayValue interface{} `plist:"readyToPlay"` // Duration represents playback duration in seconds. Duration float64 `plist:"duration"` // Position represents playback position in seconds. Position float64 `plist:"position"` }
A PlaybackInfo is a playback information of playing content.
type SlideTransition ¶
type SlideTransition string
SlideTransition represents transition that used when show the picture.
const ( SlideNone SlideTransition = "None" SlideDissolve SlideTransition = "Dissolve" SlideLeft SlideTransition = "SlideLeft" SlideRight SlideTransition = "SlideRight" )