youtube

package
v0.0.0-...-700dddc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2018 License: MIT Imports: 9 Imported by: 1

Documentation

Index

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

func FormatSessionParameters(params map[string][]string, requestCount int) map[string][]string

FormatSessionParameters formats session parameters to what youtube wants the keys to be.

func ParseResponse

func ParseResponse(bindResponse *req.Resp) (sessionID string, gSessionID string, err error)

ParseResponse attempts to grab relevant session info from a youtube screen/loungetoken bind request response.

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

func NewSession(screenID string) *Session

NewSession constructs a new session object

func (*Session) AddToQueue

func (s *Session) AddToQueue(videoID string)

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

func (s *Session) InitializeQueue(videoID string, listID string) error

InitializeQueue restarts the playlist to something else.

func (*Session) IsInitialized

func (s *Session) IsInitialized() bool

IsInitialized is used to check if the session has initialized or not

func (*Session) PlayNext

func (s *Session) PlayNext(videoID string)

PlayNext adds a video to be played next in the current playlist

func (*Session) RemoveFromQueue

func (s *Session) RemoveFromQueue(videoID string)

RemoveFromQueue removes a video from the videoplaylist TODO

func (*Session) StartSession

func (s *Session) StartSession() error

StartSession initializes the session.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL