Documentation
¶
Index ¶
- Variables
- type Application
- type Connection
- 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 )
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(recvMsgChan chan *pb.CastMessage) *Connection
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) LocalAddr ¶
func (c *Connection) LocalAddr() (addr string, err error)
func (*Connection) Send ¶
func (c *Connection) Send(requestID int64, payload Payload, sourceID, destinationID, namespace string) error
func (*Connection) SetDebug ¶
func (c *Connection) SetDebug(debug bool)
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"`
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 ¶
type MediaStatusResponse ¶
type MediaStatusResponse struct {
PayloadHeader
Status []Media `json:"status"`
}
type PayloadHeader ¶
type PayloadHeader struct {
Type string `json:"type"`
RequestId int64 `json:"requestId,omitempty"`
}
func (*PayloadHeader) SetRequestId ¶
func (p *PayloadHeader) SetRequestId(id int64)
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 ¶
type SetVolume struct {
PayloadHeader
Volume Volume `json:"volume"`
}
Click to show internal directories.
Click to hide internal directories.