Package roku (v1.10.7) [up] [repository]

Index

Types

type Connection

Connection represents the active session with the Roku API.

type Connection struct {
	AuthToken string
}

Functions

func NewConnection(current *User) (*Connection, error)

NewConnection initializes a session. User can be nil

Methods

func (c *Connection) LinkCode() (*LinkCode, error)

RequestLinkCode requests a new activation code from the server

func (c *Connection) Playback(rokuId string) (*Playback, error)

Playback fetches the DASH manifest and DRM information.

func (c *Connection) User(link *LinkCode) (*User, error)

GetUser exchanges the LinkCode for a permanent User token.

type Dash

type Dash struct {
	Body []byte
	Url  *url.URL
}

type LinkCode

LinkCode represents the activation code displayed to the user.

type LinkCode struct {
	Code string
}

Methods

func (l *LinkCode) String() string

String generates the user instructions

type Playback

Playback represents the media playback metadata.

type Playback struct {
	Drm struct {
		Widevine struct {
			LicenseServer string
		}
	}
	Url string // MPD
}

Methods

func (p *Playback) Dash() (*Dash, error)
func (p *Playback) Widevine(payload []byte) ([]byte, error)

Widevine fetches the license key

type User

User represents the persistent saved account token.

type User struct {
	Token string
}