Documentation ¶
Index ¶
- Constants
- func Close(key string) state
- func Debug(key string, format string, a ...interface{}) state
- func NewError(key string, err error) state
- func NewEvent(device *Cast, app *App, volume *Volume, flags gopi.CastFlag, reqId int) gopi.CastEvent
- func NewState(key string, req int, values ...interface{}) state
- type App
- type Cast
- func (this *Cast) Addr() string
- func (this *Cast) Call(id int) error
- func (this *Cast) Connect(key, addr string, timeout time.Duration, state chan<- state) error
- func (this *Cast) ConnectWithTimeout(timeout time.Duration, state chan<- state) error
- func (this *Cast) Debugf(format string, a ...interface{})
- func (this *Cast) Disconnect() error
- func (this *Cast) Dispose()
- func (this *Cast) Id() string
- func (this *Cast) InitWithTimeout(timeout time.Duration)
- func (this *Cast) Model() string
- func (this *Cast) Name() string
- func (this *Cast) ReqAppConnect(fn func() error) error
- func (this *Cast) ReqLaunchAppWithId(appId string) error
- func (this *Cast) ReqLoadURL(url *url.URL, mimetype string, autoplay bool) error
- func (this *Cast) ReqMediaConnect(fn func() error) error
- func (this *Cast) ReqMuted(muted bool) error
- func (this *Cast) ReqPause(state bool) error
- func (this *Cast) ReqPlay(state bool) error
- func (this *Cast) ReqSeekAbs(value float32) error
- func (this *Cast) ReqSeekRel(value float32) error
- func (this *Cast) ReqStop() error
- func (this *Cast) ReqVolumeLevel(level float32) error
- func (this *Cast) Service() string
- func (this *Cast) Set(id int, fn func() error)
- func (this *Cast) SetApp(a App) (gopi.CastFlag, error)
- func (this *Cast) SetMedia(m Media) (gopi.CastFlag, error)
- func (this *Cast) SetState(s state) (gopi.CastFlag, error)
- func (this *Cast) SetVolume(v Volume) (gopi.CastFlag, error)
- func (this *Cast) State() uint
- func (this *Cast) String() string
- func (this *Cast) UpdateState() error
- type LaunchAppRequest
- type LoadMediaRequest
- type LoadQueueItem
- type LoadQueueRequest
- type Manager
- func (this *Manager) App(cast gopi.Cast) (gopi.CastApp, error)
- func (this *Manager) Connect(device gopi.Cast) error
- func (this *Manager) Devices(ctx context.Context) ([]gopi.Cast, error)
- func (this *Manager) Disconnect(device gopi.Cast) error
- func (this *Manager) Dispose() error
- func (this *Manager) LaunchAppWithId(cast gopi.Cast, appId string) error
- func (this *Manager) LoadURL(cast gopi.Cast, url *url.URL, autoplay bool) error
- func (this *Manager) New(gopi.Config) error
- func (this *Manager) Run(ctx context.Context) error
- func (this *Manager) SeekAbs(cast gopi.Cast, value time.Duration) error
- func (this *Manager) SeekRel(cast gopi.Cast, value time.Duration) error
- func (this *Manager) SetMuted(cast gopi.Cast, value bool) error
- func (this *Manager) SetPause(cast gopi.Cast, value bool) error
- func (this *Manager) SetPlay(cast gopi.Cast, value bool) error
- func (this *Manager) SetVolume(cast gopi.Cast, value float32) error
- func (this *Manager) Stop(cast gopi.Cast) error
- func (this *Manager) String() string
- func (this *Manager) Volume(cast gopi.Cast) (float32, bool, error)
- type Media
- type MediaImage
- type MediaItem
- type MediaMetadata
- type MediaRequest
- type MediaStatusResponse
- type Payload
- type PayloadHeader
- type QueueUpdate
- type ReceiverStatusResponse
- type SetVolumeRequest
- type Volume
Constants ¶
View Source
const ( CAST_DEFAULT_SENDER = "sender-0" CAST_DEFAULT_RECEIVER = "receiver-0" CAST_NS_CONN = "urn:x-cast:com.google.cast.tp.connection" CAST_NS_HEARTBEAT = "urn:x-cast:com.google.cast.tp.heartbeat" CAST_NS_RECV = "urn:x-cast:com.google.cast.receiver" CAST_NS_MEDIA = "urn:x-cast:com.google.cast.media" CAST_NS_MULTIZONE = "urn:x-cast:com.google.cast.multizone" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type Cast ¶
func NewCastFromRecord ¶
func NewCastFromRecord(r gopi.ServiceRecord) *Cast
func (*Cast) ConnectWithTimeout ¶
func (*Cast) Disconnect ¶
func (*Cast) InitWithTimeout ¶
func (*Cast) ReqAppConnect ¶
func (*Cast) ReqLaunchAppWithId ¶
func (*Cast) ReqLoadURL ¶
func (*Cast) ReqMediaConnect ¶
func (*Cast) ReqSeekAbs ¶ added in v3.0.15
func (*Cast) ReqSeekRel ¶ added in v3.0.15
func (*Cast) ReqVolumeLevel ¶
func (*Cast) UpdateState ¶
type LaunchAppRequest ¶
type LaunchAppRequest struct { PayloadHeader AppId string `json:"appId"` }
func (*LaunchAppRequest) WithId ¶
func (this *LaunchAppRequest) WithId(id int) Payload
type LoadMediaRequest ¶
type LoadMediaRequest struct { PayloadHeader Media MediaItem `json:"media"` CurrentTime int `json:"currentTime,omitempty"` Autoplay bool `json:"autoplay,omitempty"` ResumeState string `json:"resumeState,omitempty"` }
func (*LoadMediaRequest) WithId ¶
func (this *LoadMediaRequest) WithId(id int) Payload
type LoadQueueItem ¶
type LoadQueueItem struct { PayloadHeader Media MediaItem `json:"media"` Autoplay bool `json:"autoplay"` PlaybackDuration uint `json:"playbackDuration"` }
type LoadQueueRequest ¶
type LoadQueueRequest struct { PayloadHeader RepeatMode string `json:"repeatMode"` Items []LoadQueueItem `json:"items"` }
type Manager ¶
type Manager struct { sync.RWMutex gopi.Unit gopi.ServiceDiscovery gopi.Publisher gopi.Logger // contains filtered or unexported fields }
func (*Manager) Disconnect ¶
func (*Manager) LaunchAppWithId ¶
type Media ¶
type Media struct { MediaSessionId int `json:"mediaSessionId"` // PLAYING, BUFFERING, PAUSED, IDLE or UNKNOWN PlayerState string `json:"playerState"` // CurrentTime in seconds 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 MediaImage ¶
type MediaImage struct { URL string `json:"url"` Height int `json:"height"` Width int `json:"width"` }
func (MediaImage) String ¶
func (m MediaImage) String() string
type MediaItem ¶
type MediaItem struct { ContentId string `json:"contentId"` // Mimetype ContentType string `json:"contentType,omitempty"` // BUFFERED, LIVE or UNKNOWN StreamType string `json:"streamType,omitempty"` // Duration in seconds Duration float32 `json:"duration,omitempty"` Metadata *MediaMetadata `json:"metadata,omitempty"` }
type MediaMetadata ¶
type MediaMetadata struct { MetadataType int `json:"metadataType,omitempty"` Artist string `json:"artist,omitempty"` Title string `json:"title,omitempty"` Subtitle string `json:"subtitle,omitempty"` Images []MediaImage `json:"images,omitempty"` ReleaseDate string `json:"releaseDate,omitempty"` }
func (*MediaMetadata) Equals ¶
func (m *MediaMetadata) Equals(other *MediaMetadata) bool
func (MediaMetadata) String ¶
func (m MediaMetadata) String() string
type MediaRequest ¶
type MediaRequest struct { PayloadHeader MediaSessionId int `json:"mediaSessionId"` CurrentTime float32 `json:"currentTime,omitempty"` RelativeTime float32 `json:"relativeTime,omitempty"` ResumeState string `json:"resumeState,omitempty"` }
func (*MediaRequest) WithId ¶ added in v3.0.15
func (this *MediaRequest) WithId(id int) Payload
type MediaStatusResponse ¶
type MediaStatusResponse struct { PayloadHeader Status []Media `json:"status"` }
type PayloadHeader ¶
func (*PayloadHeader) WithId ¶
func (this *PayloadHeader) WithId(id int) Payload
type QueueUpdate ¶
type QueueUpdate struct { PayloadHeader Media MediaItem `json:"media"` Autoplay bool `json:"autoplay"` PlaybackDuration uint `json:"playbackDuration"` }
type ReceiverStatusResponse ¶
type ReceiverStatusResponse struct { PayloadHeader Status struct { Apps []App `json:"applications"` Volume `json:"volume"` } `json:"status"` }
type SetVolumeRequest ¶
type SetVolumeRequest struct { PayloadHeader Volume `json:"volume"` }
func (*SetVolumeRequest) WithId ¶
func (this *SetVolumeRequest) WithId(id int) Payload
Click to show internal directories.
Click to hide internal directories.