Documentation ¶
Index ¶
- func CreateBindRequest(requestID int, loungeToken string) generic.RequestComponents
- func FormatSessionParameters(params map[string][]string, requestCount int) map[string][]string
- func ParseResponse(bindResponse *req.Resp) (sessionID string, gSessionID string, err error)
- type GetLoungeIDRequest
- type GetScreenIDRequest
- type LoungeTokenResponse
- type ScreenStatus
- type ScreenStatusData
- type ScreenTokenData
- type Session
- func (s *Session) AddToQueue(videoID string)
- func (s *Session) ClearQueue()
- func (s *Session) InitializeQueue(videoID string, listID string) error
- func (s *Session) IsInitialized() bool
- func (s *Session) PlayNext(videoID string)
- func (s *Session) RemoveFromQueue(videoID string)
- func (s *Session) StartSession() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBindRequest ¶
func CreateBindRequest(requestID int, loungeToken string) generic.RequestComponents
CreateBindRequest creates a bind request from relevant data.
func FormatSessionParameters ¶
FormatSessionParameters formats session parameters to what youtube wants the keys to be.
Types ¶
type GetLoungeIDRequest ¶
type GetLoungeIDRequest struct {
ScreenIDs string `json:"screen_ids"`
}
GetLoungeIDRequest is a Request body for a request for a lounge id to attach to.
type GetScreenIDRequest ¶
type GetScreenIDRequest struct { primitives.PayloadHeaders ScreenID int `json:"screen_ids"` }
GetScreenIDRequest for getting a screen ID for an existing youtube application.
type LoungeTokenResponse ¶
type LoungeTokenResponse struct {
Screens []*ScreenTokenData `json:"screens"`
}
LoungeTokenResponse is all the screen/loungetoken pairings requested.
type ScreenStatus ¶
type ScreenStatus struct { primitives.PayloadHeaders Data ScreenStatusData `json:"data"` }
ScreenStatus is returned status of the youtube chromecast channel.
type ScreenStatusData ¶
type ScreenStatusData struct { //ScreenId for the screen that has a youtube session. ScreenID string `json:"screenId"` }
ScreenStatusData is the internal data of the returned status.
type ScreenTokenData ¶
type ScreenTokenData struct { ScreenID string `json:"screenId"` LoungeToken string `json:"loungeToken"` Expiration int64 `json:"expiration"` }
ScreenTokenData is the internal data structure for a screen/loungetoken pairing.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a connection to the youtube chromecast api.
func NewSession ¶
NewSession constructs a new session object
func (*Session) AddToQueue ¶
AddToQueue adds the video to the end of the current playlist
func (*Session) ClearQueue ¶
func (s *Session) ClearQueue()
ClearQueue removes all the videos from the current playlist
func (*Session) InitializeQueue ¶
InitializeQueue restarts the playlist to something else.
func (*Session) IsInitialized ¶
IsInitialized is used to check if the session has initialized or not
func (*Session) RemoveFromQueue ¶
RemoveFromQueue removes a video from the videoplaylist TODO
func (*Session) StartSession ¶
StartSession initializes the session.