Documentation
¶
Index ¶
- Variables
- type Application
- type Conn
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) LocalAddr() (addr string, err error)
- func (c *Connection) MsgChan() chan *pb.CastMessage
- func (c *Connection) RemoteAddr() (addr string, err error)
- func (c *Connection) RemotePort() (port string, err error)
- func (c *Connection) Send(requestID int, payload Payload, sourceID, destinationID, namespace string) error
- func (c *Connection) SetDebug(debug bool)
- func (c *Connection) Start(addr string, port int) error
- type CustomData
- type DeviceInfo
- type Image
- type LaunchRequest
- type LoadMediaCommand
- type Media
- type MediaHeader
- type MediaItem
- type MediaMetadata
- type MediaStatusResponse
- type Payload
- type PayloadHeader
- type QueueData
- type QueueLoad
- type QueueLoadItem
- type QueueUpdate
- type ReceiverStatusRequest
- type ReceiverStatusResponse
- type SetVolume
- type Volume
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Known Payload headers ConnectHeader = PayloadHeader{Type: "CONNECT"} CloseHeader = PayloadHeader{Type: "CLOSE"} GetStatusHeader = PayloadHeader{Type: "GET_STATUS"} PongHeader = PayloadHeader{Type: "PONG"} // Response to PING payload LaunchHeader = PayloadHeader{Type: "LAUNCH"} // Launches a new chromecast app StopHeader = PayloadHeader{Type: "STOP"} // Stop playing current media PlayHeader = PayloadHeader{Type: "PLAY"} // Plays / unpauses the running app PauseHeader = PayloadHeader{Type: "PAUSE"} // Pauses the running app SeekHeader = PayloadHeader{Type: "SEEK"} // Seek into the running app VolumeHeader = PayloadHeader{Type: "SET_VOLUME"} // Sets the volume LoadHeader = PayloadHeader{Type: "LOAD"} // Loads an application onto the chromecast QueueLoadHeader = PayloadHeader{Type: "QUEUE_LOAD"} // Loads an application onto the chromecast QueueUpdateHeader = PayloadHeader{Type: "QUEUE_UPDATE"} // Loads an application onto the chromecast SkipHeader = PayloadHeader{Type: "SKIP_AD"} // Skip add based off https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages#.SKIP_AD )
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Conn ¶ added in v0.3.0
type Conn interface {
Start(addr string, port int) error
MsgChan() chan *pb.CastMessage
Close() error
SetDebug(debug bool)
LocalAddr() (addr string, err error)
RemoteAddr() (addr string, err error)
RemotePort() (addr string, err error)
Send(requestID int, payload Payload, sourceID, destinationID, namespace string) error
}
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection() *Connection
func (*Connection) Close ¶ added in v0.2.6
func (c *Connection) Close() error
func (*Connection) LocalAddr ¶ added in v0.0.15
func (c *Connection) LocalAddr() (addr string, err error)
func (*Connection) MsgChan ¶ added in v0.3.0
func (c *Connection) MsgChan() chan *pb.CastMessage
func (*Connection) RemoteAddr ¶ added in v0.3.3
func (c *Connection) RemoteAddr() (addr string, err error)
func (*Connection) RemotePort ¶ added in v0.3.3
func (c *Connection) RemotePort() (port string, err error)
func (*Connection) Send ¶
func (c *Connection) Send(requestID int, payload Payload, sourceID, destinationID, namespace string) error
func (*Connection) SetDebug ¶
func (c *Connection) SetDebug(debug bool)
type CustomData ¶ added in v0.2.11
type CustomData struct {
PlayerState int `json:"playerState"`
}
type DeviceInfo ¶ added in v0.3.3
type LaunchRequest ¶
type LaunchRequest struct {
PayloadHeader
AppId string `json:"appId"`
}
type LoadMediaCommand ¶
type LoadMediaCommand struct {
PayloadHeader
Media MediaItem `json:"media"`
CurrentTime int `json:"currentTime"`
Autoplay bool `json:"autoplay"`
QueueData QueueData `json:"queueData"`
CustomData interface{} `json:"customData"`
}
type Media ¶
type Media struct {
MediaSessionId int `json:"mediaSessionId"`
PlayerState string `json:"playerState"`
CurrentTime float32 `json:"currentTime"`
IdleReason string `json:"idleReason"`
Volume Volume `json:"volume"`
CurrentItemId int `json:"currentItemId"`
LoadingItemId int `json:"loadingItemId"`
CustomData CustomData `json:"customData"`
Media MediaItem `json:"media"`
}
type MediaHeader ¶
type MediaHeader struct {
PayloadHeader
MediaSessionId int `json:"mediaSessionId"`
CurrentTime float32 `json:"currentTime"`
RelativeTime float32 `json:"relativeTime,omitempty"`
ResumeState string `json:"resumeState"`
}
type MediaItem ¶
type MediaItem struct {
ContentId string `json:"contentId"`
ContentType string `json:"contentType"`
StreamType string `json:"streamType"`
Duration float32 `json:"duration"`
Metadata MediaMetadata `json:"metadata"`
}
type MediaMetadata ¶ added in v0.0.5
type MediaStatusResponse ¶
type MediaStatusResponse struct {
PayloadHeader
Status []Media `json:"status"`
}
type PayloadHeader ¶
func (*PayloadHeader) SetRequestId ¶
func (p *PayloadHeader) SetRequestId(id int)
type QueueLoad ¶
type QueueLoad struct {
PayloadHeader
MediaSessionId int `json:"mediaSessionId,omitempty"`
CurrentTime float32 `json:"currentTime"`
StartIndex int `json:"startIndex"`
RepeatMode string `json:"repeatMode"`
Items []QueueLoadItem `json:"items"`
}
type QueueLoadItem ¶
type QueueUpdate ¶
type QueueUpdate struct {
PayloadHeader
MediaSessionId int `json:"mediaSessionId,omitempty"`
Jump int `json:"jump,omitempty"`
}
type ReceiverStatusRequest ¶
type ReceiverStatusRequest struct {
PayloadHeader
Applications []Application `json:"applications"`
Volume Volume `json:"volume"`
}
type ReceiverStatusResponse ¶
type ReceiverStatusResponse struct {
PayloadHeader
Status struct {
Applications []Application `json:"applications"`
Volume Volume `json:"volume"`
} `json:"status"`
}
type SetVolume ¶ added in v0.0.5
type SetVolume struct {
PayloadHeader
Volume Volume `json:"volume"`
}
Click to show internal directories.
Click to hide internal directories.