Documentation ¶
Index ¶
- Constants
- Variables
- func Query(params *QueryParam) error
- type ApplicationSession
- type Bus
- type CC
- func (cc *CC) ClearQueue() (*ReceiverStatus, error)
- func (cc *CC) Close() error
- func (cc *CC) Disconnect()
- func (cc *CC) EnsureDmrRunning() error
- func (cc *CC) FetchItems(itemId int, nextCount, prevCount *int) (*MediaStatus, error)
- func (cc *CC) GetCachedQueue() *CachedQueue
- func (cc *CC) GetCachedQueueIds() *[]int
- func (cc *CC) GetCurrentState() *State
- func (cc *CC) GetItemsInfo(itemIds []int) (*[]QueueItem, error)
- func (cc *CC) GetMediaFiles(itemIds []int) (*[]MediaFile, error)
- func (cc *CC) GetMediaStatus() (*MediaStatus, error)
- func (cc *CC) GetReceiverStatus() (*ReceiverStatus, error)
- func (cc *CC) GetState() (*State, error)
- func (cc *CC) InsertQueue(files *[]*MediaFile, options *InsertQueueOptions) (*MediaStatus, error)
- func (cc *CC) IsDmrRunning() bool
- func (cc *CC) Load(file *MediaFile) (*MediaStatus, error)
- func (cc *CC) LoadQueue(files *[]*MediaFile, options *LoadQueueOptions) (*MediaStatus, error)
- func (cc *CC) Mute(truefalse bool) (*ReceiverStatus, error)
- func (cc *CC) Next() (*MediaStatus, error)
- func (cc *CC) Pause() (*MediaStatus, error)
- func (cc *CC) Play() (*MediaStatus, error)
- func (cc *CC) PollState(interval time.Duration) (chan *State, func())
- func (cc *CC) Previous() (*MediaStatus, error)
- func (cc *CC) QueueGetItemIds() (*[]int, error)
- func (cc *CC) RefreshQueue() (*CachedQueue, error)
- func (cc *CC) RemoveQueue(itemIds []int, options *RemoveQueueOptions) (*MediaStatus, error)
- func (cc *CC) ReorderQueue(itemIds []int, options *ReorderQueueOptions) (*MediaStatus, error)
- func (cc *CC) Seek(seconds float64) (*MediaStatus, error)
- func (cc *CC) SetDeviceDebug(tf bool)
- func (cc *CC) SetRepeatMode(repeatMode *string) (*MediaStatus, error)
- func (cc *CC) ShuffleQueue() (*[]int, error)
- func (cc *CC) Start() error
- func (cc *CC) StateTicker(interval time.Duration) (chan *State, func())
- func (cc *CC) Stop() error
- func (cc *CC) SubscribeStateChanges() (chan *State, func())
- func (cc *CC) UnshuffleQueue() (*[]int, error)
- func (cc *CC) UpdateQueue(options *UpdateQueueOptions) (*MediaStatus, error)
- func (cc *CC) Volume(level float64) (*ReceiverStatus, error)
- type CachedQueue
- type CastMessage
- func (*CastMessage) Descriptor() ([]byte, []int)deprecated
- func (x *CastMessage) GetDestinationId() string
- func (x *CastMessage) GetNamespace() string
- func (x *CastMessage) GetPayloadBinary() []byte
- func (x *CastMessage) GetPayloadType() CastMessage_PayloadType
- func (x *CastMessage) GetPayloadUtf8() string
- func (x *CastMessage) GetProtocolVersion() CastMessage_ProtocolVersion
- func (x *CastMessage) GetSourceId() string
- func (*CastMessage) ProtoMessage()
- func (x *CastMessage) ProtoReflect() protoreflect.Message
- func (x *CastMessage) Reset()
- func (x *CastMessage) String() string
- type CastMessage_PayloadType
- func (CastMessage_PayloadType) Descriptor() protoreflect.EnumDescriptor
- func (x CastMessage_PayloadType) Enum() *CastMessage_PayloadType
- func (CastMessage_PayloadType) EnumDescriptor() ([]byte, []int)deprecated
- func (x CastMessage_PayloadType) Number() protoreflect.EnumNumber
- func (x CastMessage_PayloadType) String() string
- func (CastMessage_PayloadType) Type() protoreflect.EnumType
- func (x *CastMessage_PayloadType) UnmarshalJSON(b []byte) errordeprecated
- type CastMessage_ProtocolVersion
- func (CastMessage_ProtocolVersion) Descriptor() protoreflect.EnumDescriptor
- func (x CastMessage_ProtocolVersion) Enum() *CastMessage_ProtocolVersion
- func (CastMessage_ProtocolVersion) EnumDescriptor() ([]byte, []int)deprecated
- func (x CastMessage_ProtocolVersion) Number() protoreflect.EnumNumber
- func (x CastMessage_ProtocolVersion) String() string
- func (CastMessage_ProtocolVersion) Type() protoreflect.EnumType
- func (x *CastMessage_ProtocolVersion) UnmarshalJSON(b []byte) errordeprecated
- type FetchItemsCommand
- type Finder
- type GenericMetadata
- type GetItemsInfoCommand
- type Headers
- type HeartbeatBus
- type Image
- type InsertQueueOptions
- type ItemsInfoResponse
- type LaunchCmd
- type LoadCommand
- type LoadQueueOptions
- type Manager
- type MediaBus
- type MediaCommand
- type MediaFile
- type MediaInformation
- type MediaResponse
- type MediaStatus
- type MetadataVariant
- type MovieMetadata
- type MusicMetadata
- type Namespace
- type Namespaces
- type PayloadHeader
- type PayloadVariant
- type PhotoMetadata
- type QueryParam
- type Queue
- type QueueChangeResponse
- type QueueCmd
- type QueueGetItemIdsCommand
- type QueueIdsResponse
- type QueueInsertCommand
- type QueueItem
- type QueueLoadCommand
- type QueueRemoveCommand
- type QueueReorderCommand
- type QueueUpdateCommand
- type ReceiverBus
- type ReceiverResponse
- type ReceiverStatus
- type RemoveQueueOptions
- type ReorderQueueOptions
- type RepeatModes
- type SeekCommand
- type ServiceEntry
- type SetPlaybackRateCommand
- type ShuffleQueueCommand
- type State
- func (s *State) AppId() *string
- func (s *State) CurrentItemId() *int
- func (s *State) IsFinished() bool
- func (s *State) IsIdleScreen() bool
- func (s *State) MediaSessionId() *int
- func (s *State) RepeatMode() *string
- func (s *State) SessionId() *string
- func (s *State) Title() *string
- func (s *State) Url() *string
- func (s *State) Volume() *Volume
- type Stream
- type TvMetadata
- type UpdateQueueOptions
- type Volume
Constants ¶
const ( DefaultMediaReceiver = "CC1AD845" Backdrop = "E8C28D3C" )
const (
ISO8601Layout = "2006-01-02T15:04:05-0700"
)
Variables ¶
var ( CastMessage_ProtocolVersion_name = map[int32]string{ 0: "CASTV2_1_0", } CastMessage_ProtocolVersion_value = map[string]int32{ "CASTV2_1_0": 0, } )
Enum value maps for CastMessage_ProtocolVersion.
var ( CastMessage_PayloadType_name = map[int32]string{ 0: "STRING", 1: "BINARY", } CastMessage_PayloadType_value = map[string]int32{ "STRING": 0, "BINARY": 1, } )
Enum value maps for CastMessage_PayloadType.
var File_cast_clean_proto protoreflect.FileDescriptor
var Repeat = RepeatModes{
Off: pStr("REPEAT_OFF"),
All: pStr("REPEAT_ALL"),
Single: pStr("REPEAT_SINGLE"),
AllAndShuffle: pStr("REPEAT_ALL_AND_SHUFFLE"),
}
Functions ¶
func Query ¶
func Query(params *QueryParam) error
Query looks up a given service, in a domain, waiting at most for a timeout before finishing the query. The results are streamed to a channel. Sends will not block, so clients should make sure to either read or buffer.
Types ¶
type ApplicationSession ¶
type ApplicationSession struct { AppID *string `json:"appId,omitempty"` DisplayName *string `json:"displayName,omitempty"` Namespaces []*Namespace `json:"namespaces,omitempty"` IsIdleScreen bool `json:"isIdleScreen,omitempty"` SessionID *string `json:"sessionId,omitempty"` StatusText *string `json:"statusText,omitempty"` TransportId *string `json:"transportId,omitempty"` }
type CC ¶
type CC struct { IP string `json:"ip"` Port int `json:"port"` Kind string `json:"kind"` Name string `json:"name"` ID string `json:"id"` // contains filtered or unexported fields }
func (*CC) ClearQueue ¶
func (cc *CC) ClearQueue() (*ReceiverStatus, error)
func (*CC) Disconnect ¶
func (cc *CC) Disconnect()
Disconnect from cast device with stopping playback or disrupting queue
func (*CC) EnsureDmrRunning ¶
func (*CC) FetchItems ¶
func (cc *CC) FetchItems(itemId int, nextCount, prevCount *int) (*MediaStatus, error)
FetchItems ...
func (*CC) GetCachedQueue ¶
func (cc *CC) GetCachedQueue() *CachedQueue
func (*CC) GetCachedQueueIds ¶
func (*CC) GetCurrentState ¶
GetCurrentState returns the State object as it currently exists without polling the device.
func (*CC) GetItemsInfo ¶
GetItemsInfo returns an array of QueueItems for currently loaded items in the queue. QueueItems directly match the format returned from the cast device
func (*CC) GetMediaFiles ¶
GetMediaFiles returns an array of MediaFiles for currently loaded items in the queue, which is parsed from the QueueItems returned from the cast device. This format matches the format used to load the queue.
func (*CC) GetMediaStatus ¶
func (cc *CC) GetMediaStatus() (*MediaStatus, error)
GetMediaStatus polls the device for its current media state and returns the full response
func (*CC) GetReceiverStatus ¶
func (cc *CC) GetReceiverStatus() (*ReceiverStatus, error)
GetReceiverStatus polls the device for its current receiver state and returns the full response
func (*CC) GetState ¶
GetState polls the device for its current receiver and media states and parses those into a combined State object with the most relevant fields, which is returned here.
func (*CC) InsertQueue ¶
func (cc *CC) InsertQueue(files *[]*MediaFile, options *InsertQueueOptions) (*MediaStatus, error)
InsertQueue will append multiple urls to the existing queue for playback in the Default Media Receiver.
func (*CC) IsDmrRunning ¶
func (*CC) Load ¶
func (cc *CC) Load(file *MediaFile) (*MediaStatus, error)
Load will load a single url for playback in the Default Media Receiver. Load takes an instance of MediaFile as it's only parameter
func (*CC) LoadQueue ¶
func (cc *CC) LoadQueue(files *[]*MediaFile, options *LoadQueueOptions) (*MediaStatus, error)
LoadQueue will load multiple urls for playback in the Default Media Receiver. options can be nil to use defaults
func (*CC) Mute ¶
func (cc *CC) Mute(truefalse bool) (*ReceiverStatus, error)
Mute either mutes or unmutes audio at the device level depending on the boolean parameter given
func (*CC) Next ¶
func (cc *CC) Next() (*MediaStatus, error)
Next skips to the next item in the current queue
func (*CC) Pause ¶
func (cc *CC) Pause() (*MediaStatus, error)
Pause playback of the currently loaded media
func (*CC) Play ¶
func (cc *CC) Play() (*MediaStatus, error)
Play resumes playback of the currently loaded media
func (*CC) PollState ¶
PollState periodically polls the device on the given interval for the current receiver and media states and parses those in a combined State object with the most relevant fields, which is then passed through the channel given in the first return value. The second return value is a function that should be called to stop the polling and close the channel
func (*CC) Previous ¶
func (cc *CC) Previous() (*MediaStatus, error)
Previous skips to the previous item in the current queue
func (*CC) QueueGetItemIds ¶
GetQueueIds returns the item ids of the items in the currently loaded queue in the order those items occur in the queue.
func (*CC) RefreshQueue ¶
func (cc *CC) RefreshQueue() (*CachedQueue, error)
func (*CC) RemoveQueue ¶
func (cc *CC) RemoveQueue(itemIds []int, options *RemoveQueueOptions) (*MediaStatus, error)
RemoveQueue ...
func (*CC) ReorderQueue ¶
func (cc *CC) ReorderQueue(itemIds []int, options *ReorderQueueOptions) (*MediaStatus, error)
ReorderQueue changes the order of the currently loaded queue. Specify one or more itemIds with no ReorderQueueOptions to move those items to the end of the queue. Specify one or more itemIds with ReorderQueueOptions.InsertBefore to move those items within the queue.
func (*CC) Seek ¶
func (cc *CC) Seek(seconds float64) (*MediaStatus, error)
Seek sets the current position in the stream for the currently loaded media. The parameter specifies the number of seconds since the beginning of the content.
func (*CC) SetDeviceDebug ¶
func (*CC) SetRepeatMode ¶
func (cc *CC) SetRepeatMode(repeatMode *string) (*MediaStatus, error)
SetRepeatMode - set repeat mode in queue
func (*CC) StateTicker ¶
StateTicker watches for changes using the same method as SubscribeStateChanges (as opposed to actively polling the device). Additionally, a ticker is maintained internally and on the given interval, the position field is advanced by "interval" seconds in the local maintained copy of State while the media is playing, which is passed through the channel on the same interval. This allows you to, for example, set up a ticker that updates your web page every second without having to poll the device for changes.
func (*CC) Stop ¶
Stop interrupts playback of the currently loaded media and closes the Default Media Receiver application
func (*CC) SubscribeStateChanges ¶
SubscribeStateChanges will watch the device for all receiver and media status updates that are automatically passed whenever the state of the device changes. Any change such as playback started, playback paused or stopped, or the track changing will be passed by the device at the time they occur. Those updates are parsed into the State object which is passed through the channel returned as the first return value. The second return value is a function that should be called to stop the updates and close the channel
func (*CC) UpdateQueue ¶
func (cc *CC) UpdateQueue(options *UpdateQueueOptions) (*MediaStatus, error)
UpdateQueue ...
type CachedQueue ¶
type CastMessage ¶
type CastMessage struct { ProtocolVersion *CastMessage_ProtocolVersion `` /* 146-byte string literal not displayed */ SourceId *string `protobuf:"bytes,2,req,name=source_id,json=sourceId" json:"source_id,omitempty"` DestinationId *string `protobuf:"bytes,3,req,name=destination_id,json=destinationId" json:"destination_id,omitempty"` Namespace *string `protobuf:"bytes,4,req,name=namespace" json:"namespace,omitempty"` PayloadType *CastMessage_PayloadType `` /* 130-byte string literal not displayed */ PayloadUtf8 *string `protobuf:"bytes,6,opt,name=payload_utf8,json=payloadUtf8" json:"payload_utf8,omitempty"` PayloadBinary []byte `protobuf:"bytes,7,opt,name=payload_binary,json=payloadBinary" json:"payload_binary,omitempty"` // contains filtered or unexported fields }
func (*CastMessage) Descriptor
deprecated
func (*CastMessage) Descriptor() ([]byte, []int)
Deprecated: Use CastMessage.ProtoReflect.Descriptor instead.
func (*CastMessage) GetDestinationId ¶
func (x *CastMessage) GetDestinationId() string
func (*CastMessage) GetNamespace ¶
func (x *CastMessage) GetNamespace() string
func (*CastMessage) GetPayloadBinary ¶
func (x *CastMessage) GetPayloadBinary() []byte
func (*CastMessage) GetPayloadType ¶
func (x *CastMessage) GetPayloadType() CastMessage_PayloadType
func (*CastMessage) GetPayloadUtf8 ¶
func (x *CastMessage) GetPayloadUtf8() string
func (*CastMessage) GetProtocolVersion ¶
func (x *CastMessage) GetProtocolVersion() CastMessage_ProtocolVersion
func (*CastMessage) GetSourceId ¶
func (x *CastMessage) GetSourceId() string
func (*CastMessage) ProtoMessage ¶
func (*CastMessage) ProtoMessage()
func (*CastMessage) ProtoReflect ¶
func (x *CastMessage) ProtoReflect() protoreflect.Message
func (*CastMessage) Reset ¶
func (x *CastMessage) Reset()
func (*CastMessage) String ¶
func (x *CastMessage) String() string
type CastMessage_PayloadType ¶
type CastMessage_PayloadType int32
const ( CastMessage_STRING CastMessage_PayloadType = 0 CastMessage_BINARY CastMessage_PayloadType = 1 )
func (CastMessage_PayloadType) Descriptor ¶
func (CastMessage_PayloadType) Descriptor() protoreflect.EnumDescriptor
func (CastMessage_PayloadType) Enum ¶
func (x CastMessage_PayloadType) Enum() *CastMessage_PayloadType
func (CastMessage_PayloadType) EnumDescriptor
deprecated
func (CastMessage_PayloadType) EnumDescriptor() ([]byte, []int)
Deprecated: Use CastMessage_PayloadType.Descriptor instead.
func (CastMessage_PayloadType) Number ¶
func (x CastMessage_PayloadType) Number() protoreflect.EnumNumber
func (CastMessage_PayloadType) String ¶
func (x CastMessage_PayloadType) String() string
func (CastMessage_PayloadType) Type ¶
func (CastMessage_PayloadType) Type() protoreflect.EnumType
func (*CastMessage_PayloadType) UnmarshalJSON
deprecated
func (x *CastMessage_PayloadType) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type CastMessage_ProtocolVersion ¶
type CastMessage_ProtocolVersion int32
const (
CastMessage_CASTV2_1_0 CastMessage_ProtocolVersion = 0
)
func (CastMessage_ProtocolVersion) Descriptor ¶
func (CastMessage_ProtocolVersion) Descriptor() protoreflect.EnumDescriptor
func (CastMessage_ProtocolVersion) Enum ¶
func (x CastMessage_ProtocolVersion) Enum() *CastMessage_ProtocolVersion
func (CastMessage_ProtocolVersion) EnumDescriptor
deprecated
func (CastMessage_ProtocolVersion) EnumDescriptor() ([]byte, []int)
Deprecated: Use CastMessage_ProtocolVersion.Descriptor instead.
func (CastMessage_ProtocolVersion) Number ¶
func (x CastMessage_ProtocolVersion) Number() protoreflect.EnumNumber
func (CastMessage_ProtocolVersion) String ¶
func (x CastMessage_ProtocolVersion) String() string
func (CastMessage_ProtocolVersion) Type ¶
func (CastMessage_ProtocolVersion) Type() protoreflect.EnumType
func (*CastMessage_ProtocolVersion) UnmarshalJSON
deprecated
func (x *CastMessage_ProtocolVersion) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type FetchItemsCommand ¶
type FetchItemsCommand struct { PayloadHeader MediaSessionId *int `json:"mediaSessionId,omitempty"` ItemId int `json:"itemId"` NextCount *int `json:"nextCount,omitempty"` PrevCount *int `json:"prevCount,omitempty"` }
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
func NewDefaultFinder ¶
func NewDefaultFinder() *Finder
type GenericMetadata ¶
type GenericMetadata struct { MetadataType int `json:"metadataType"` // 0: generic, 1: movie, 2: tv, 3: music, 4: photo Title *string `json:"title,omitempty"` // optional: descriptive title text Subtitle *string `json:"subtitle,omitempty"` // optional: descriptive subtitle text (not caption) Images *[]Image `json:"images,omitempty"` // optional: array of image urls associated with content ReleaseDate *string `json:"releaseDate,omitempty"` // optional: ISO 8601 date and time of release }
func (GenericMetadata) GetDescription ¶
func (m GenericMetadata) GetDescription() *string
func (GenericMetadata) GetMetadataType ¶
func (m GenericMetadata) GetMetadataType() int
func (GenericMetadata) GetTitle ¶
func (m GenericMetadata) GetTitle() *string
type GetItemsInfoCommand ¶
type GetItemsInfoCommand struct { PayloadHeader MediaSessionId *int `json:"mediaSessionId,omitempty"` ItemIds []int `json:"itemIds"` }
type Headers ¶
type Headers struct { Connect PayloadHeader Close PayloadHeader GetStatus PayloadHeader Ping PayloadHeader Pong PayloadHeader Launch PayloadHeader Stop PayloadHeader Play PayloadHeader Pause PayloadHeader Seek PayloadHeader Next PayloadHeader Previous PayloadHeader SetVolume PayloadHeader Load PayloadHeader QueueLoad PayloadHeader QueueInsert PayloadHeader QueueUpdate PayloadHeader QueueRemove PayloadHeader QueueReorder PayloadHeader QueueShuffle PayloadHeader QueueGetItemRange PayloadHeader QueueGetItems PayloadHeader FetchItems PayloadHeader GetItemsInfo PayloadHeader QueueGetItemIds PayloadHeader }
type HeartbeatBus ¶
type HeartbeatBus struct {
Bus
}
type InsertQueueOptions ¶
type ItemsInfoResponse ¶
type ItemsInfoResponse struct { PayloadHeader Items *[]QueueItem `json:"items"` }
https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages.ItemsInfo
type LaunchCmd ¶
type LaunchCmd struct { PayloadHeader AppId string `json:"appId"` }
type LoadCommand ¶
type LoadCommand struct { PayloadHeader Media MediaInformation `json:"media"` // optional: default is true Autoplay *bool `json:"autoplay,omitempty"` // optional: seconds from start of content to begin playback CurrentTime *int `json:"currentTime,omitempty"` PlaybackRate *int `json:"playbackRate,omitempty"` }
type LoadQueueOptions ¶
type Manager ¶
type Manager struct { DeviceDebug bool Current map[int]chan *CastMessage Handlers map[string]func(*CastMessage) Closers map[string]func(*CastMessage) // contains filtered or unexported fields }
func NewManager ¶
func NewManager() *Manager
type MediaCommand ¶
type MediaCommand struct { PayloadHeader MediaSessionID *int `json:"mediaSessionId,omitempty"` }
type MediaFile ¶
type MediaFile struct { // required Url string `json:"url"` Mime string `json:"mime"` // optional: option 1 Title *string `json:"title"` Description *string `json:"description"` // optional: option 2 Metadata MetadataVariant }
type MediaInformation ¶
type MediaInformation struct { ContentId string `json:"contentId"` // url to content StreamType string `json:"streamType"` // NONE, BUFFERED, or LIVE ContentType string `json:"contentType"` // MIME type of content MediaCategory string `json:"mediaCategory"` // VIDEO, AUDIO, IMAGE Metadata MetadataVariant `json:"metadata,omitempty"` // generic, movie, tv, music, or photo metadata struct Duration *float64 `json:"duration,omitempty"` // optional }
func (*MediaInformation) UnmarshalJSON ¶
func (m *MediaInformation) UnmarshalJSON(b []byte) error
type MediaResponse ¶
type MediaResponse struct { PayloadHeader Status []*MediaStatus `json:"status,omitempty"` }
type MediaStatus ¶
type MediaStatus struct { MediaSessionId *int `json:"mediaSessionId,omitempty"` PlaybackRate *int `json:"playbackRate,omitempty"` PlayerState *string `json:"playerState,omitempty"` IdleReason *string `json:"idleReason,omitempty"` CurrentTime *float64 `json:"currentTime,omitempty"` SupportedMediaCommands *int `json:"supportedMediaCommands,omitempty"` Volume *Volume `json:"volume,omitempty"` ActiveTrackIds []interface{} `json:"activeTrackIds,omitempty"` Media *MediaInformation `json:"media,omitempty"` QueueData *struct { RepeatMode string `json:"repeatMode,omitempty"` Shuffle bool `json:"shuffle,omitempty"` StartIndex int `json:"startIndex,omitempty"` } `json:"queueData,omitempty"` CurrentItemId int `json:"currentItemId,omitempty"` Items []struct { ItemId int `json:"itemId,omitempty"` Media *MediaInformation `json:"media,omitempty"` Autoplay bool `json:"autoplay,omitempty"` OrderId int `json:"orderId,omitempty"` } `json:"items,omitempty"` RepeatMode string `json:"repeatMode,omitempty"` }
type MetadataVariant ¶
type MovieMetadata ¶
type MovieMetadata struct { MetadataType int `json:"metadataType"` // 0: generic, 1: movie, 2: tv, 3: music, 4: photo Title *string `json:"title,omitempty"` // optional: descriptive title text Subtitle *string `json:"subtitle,omitempty"` // optional: descriptive subtitle text (not caption) Studio *string `json:"studio,omitempty"` // optional Images *[]Image `json:"images,omitempty"` // optional: array of image urls associated with content ReleaseDate *string `json:"releaseDate,omitempty"` // optional: ISO 8601 date and time of release }
func (MovieMetadata) GetDescription ¶
func (m MovieMetadata) GetDescription() *string
func (MovieMetadata) GetMetadataType ¶
func (m MovieMetadata) GetMetadataType() int
func (MovieMetadata) GetTitle ¶
func (m MovieMetadata) GetTitle() *string
type MusicMetadata ¶
type MusicMetadata struct { MetadataType int `json:"metadataType"` // 0: generic, 1: movie, 2: tv, 3: music, 4: photo AlbumName *string `json:"albumName,omitempty"` // optional Title *string `json:"title,omitempty"` // optional: song title AlbumArtist *string `json:"albumArtist,omitempty"` // optional Artist *string `json:"artist,omitempty"` // optional Composer *string `json:"composer,omitempty"` // optional TrackNumber *int `json:"trackNumber,omitempty"` // optional DiscNumber *int `json:"discNumber,omitempty"` // optional Images *[]Image `json:"images,omitempty"` // optional: array of image urls associated with content ReleaseDate *string `json:"releaseDate,omitempty"` // optional: ISO 8601 date and time of release }
func (MusicMetadata) GetDescription ¶
func (m MusicMetadata) GetDescription() *string
func (MusicMetadata) GetMetadataType ¶
func (m MusicMetadata) GetMetadataType() int
func (MusicMetadata) GetTitle ¶
func (m MusicMetadata) GetTitle() *string
type Namespaces ¶
type Namespaces struct {
// contains filtered or unexported fields
}
type PayloadHeader ¶
type PayloadVariant ¶
type PayloadVariant interface {
// contains filtered or unexported methods
}
type PhotoMetadata ¶
type PhotoMetadata struct { MetadataType int `json:"metadataType"` // 0: generic, 1: movie, 2: tv, 3: music, 4: photo Title *string `json:"title,omitempty"` // optional: descriptive title text Artist *string `json:"artist,omitempty"` // optional Location *string `json:"location,omitempty"` // optional: descriptive location -> "Madrid, Spain" Latitude *float64 `json:"latitude,omitempty"` // optional Longitude *float64 `json:"longitude,omitempty"` // optional Height *int `json:"height,omitempty"` // optional Width *int `json:"width,omitempty"` // optional CreationDateTime *string `json:"creationDateTime,omitempty"` // optional: ISO 8601 date and time }
func (PhotoMetadata) GetDescription ¶
func (m PhotoMetadata) GetDescription() *string
func (PhotoMetadata) GetMetadataType ¶
func (m PhotoMetadata) GetMetadataType() int
func (PhotoMetadata) GetTitle ¶
func (m PhotoMetadata) GetTitle() *string
type QueryParam ¶
type QueryParam struct { Service string // Service to lookup Domain string // Lookup domain, default "local" Timeout time.Duration // Lookup timeout, default 1 second Interface *net.Interface // Multicast interface to use Entries chan<- *ServiceEntry // Entries Channel WantUnicastResponse bool // Unicast response desired, as per 5.4 in RFC }
QueryParam is used to customize how a Lookup is performed
func DefaultParams ¶
func DefaultParams(service string) *QueryParam
DefaultParams is used to return a default set of QueryParam's
type QueueChangeResponse ¶
type QueueChangeResponse struct { PayloadHeader // INSERT, REMOVE, ITEMS_CHANGE, UPDATE, NO_CHANGE, undefined/nil ChangeType *string `json:"changeType,omitempty"` ItemIds *[]int `json:"itemIds,omitempty"` InsertBefore *int `json:"insertBefore,omitempty"` SequenceNumber *int `json:"sequenceNumber,omitempty"` }
https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages.QueueChange
type QueueCmd ¶
type QueueCmd struct { PayloadHeader // number of seconds into content to begin playback after queue change CurrentTime *float32 `json:"currentTime,omitempty"` MediaSessionId *int `json:"mediaSessionId,omitempty"` }
type QueueGetItemIdsCommand ¶
type QueueGetItemIdsCommand struct { PayloadHeader MediaSessionId *int `json:"mediaSessionId,omitempty"` }
type QueueIdsResponse ¶
type QueueIdsResponse struct { PayloadHeader ItemIds *[]int `json:"itemIds,omitempty"` }
https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages.QueueIds
type QueueInsertCommand ¶
type QueueItem ¶
type QueueItem struct { Media MediaInformation `json:"media"` Autoplay *bool `json:"autoplay,omitempty"` PlaybackDuration *int `json:"playbackDuration,omitempty"` // specify how long in seconds until the end of the previous item should preload of this item occur PreloadTime *int `json:"preloadTime,omitempty"` // specify how far in seconds into this item should playback begin StartTime *int `json:"startTime,omitempty"` }
https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages.QueueItem
type QueueLoadCommand ¶
type QueueRemoveCommand ¶
type QueueReorderCommand ¶
type QueueUpdateCommand ¶
type QueueUpdateCommand struct { QueueCmd Jump *int `json:"jump,omitempty"` // id of current media item after change CurrentItemId *int `json:"currentItemId,omitempty"` Items *[]QueueItem `json:"items,omitempty"` Shuffle *bool `json:"shuffle,omitempty"` // REPEAT_OFF, REPEAT_ALL, REPEAT_SINGLE, REPEAT_ALL_AND_SHUFFLE, undefined/nil RepeatMode *string `json:"repeatMode,omitempty"` }
type ReceiverBus ¶
type ReceiverBus struct {
Bus
}
type ReceiverResponse ¶
type ReceiverResponse struct { PayloadHeader Status *ReceiverStatus `json:"status,omitempty"` }
type ReceiverStatus ¶
type ReceiverStatus struct { PayloadHeader Applications []*ApplicationSession `json:"applications,omitempty"` Volume *Volume `json:"volume,omitempty"` }
type RemoveQueueOptions ¶
type ReorderQueueOptions ¶
type RepeatModes ¶
type RepeatModes struct {
Off, All, Single, AllAndShuffle *string
}
type SeekCommand ¶
type SeekCommand struct { PayloadHeader MediaSessionID *int `json:"mediaSessionId,omitempty"` // optional: PLAYBACK_START or PLAYBACK_PAUSE. if not set, current playing state is retained ResumeState *string `json:"resumeState,omitempty"` // seconds since beginning of content CurrentTime *float64 `json:"currentTime,omitempty"` }
type ServiceEntry ¶
type ServiceEntry struct { Name string Host string AddrV4 net.IP AddrV6 net.IP Port int Info string InfoFields []string // contains filtered or unexported fields }
ServiceEntry is returned after we query for a service
type SetPlaybackRateCommand ¶
type SetPlaybackRateCommand struct { PayloadHeader MediaSessionId *int `json:"mediaSessionId,omitempty"` // New playback rate (>0). PlaybackRate *float64 `json:"playbackRate"` // rate relative to current. 1.1 will increase rate by 10% RelativePlaybackRate *float64 `json:"relativePlaybackRate"` }
type ShuffleQueueCommand ¶
type ShuffleQueueCommand struct { PayloadHeader MediaSessionId *int `json:"mediaSessionId,omitempty"` CurrentItemId *int `json:"currentItemId,omitempty"` CurrentTime *float32 `json:"currentTime,omitempty"` }
type State ¶
type State struct { Media *MediaStatus Receiver *ReceiverStatus Queue *Queue }
func (*State) CurrentItemId ¶
func (*State) IsFinished ¶
func (*State) IsIdleScreen ¶
func (*State) MediaSessionId ¶
func (*State) RepeatMode ¶
type TvMetadata ¶
type TvMetadata struct { MetadataType int `json:"metadataType"` // 0: generic, 1: movie, 2: tv, 3: music, 4: photo SeriesTitle *string `json:"seriesTitle,omitempty"` // optional Subtitle *string `json:"subtitle,omitempty"` // optional: descriptive subtitle text (not caption) Season *int `json:"season,omitempty"` // optional: season number Episode *int `json:"episode,omitempty"` // optional: episode number Images *[]Image `json:"images,omitempty"` // optional: array of image urls associated with content OriginalAirDate *string `json:"originalAirDate,omitempty"` // optional: ISO 8601 date and time of first airing }
func (TvMetadata) GetDescription ¶
func (m TvMetadata) GetDescription() *string
func (TvMetadata) GetMetadataType ¶
func (m TvMetadata) GetMetadataType() int
func (TvMetadata) GetTitle ¶
func (m TvMetadata) GetTitle() *string