hls

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Master

type Master struct {
	Variants []*Variant
	// contains filtered or unexported fields
}

Master is a struct for interacting with the master playlist.

func NewMaster

func NewMaster(url string) *Master

NewMaster creates a new Master

func (*Master) Get

func (m *Master) Get() error

Get loads the data into memory to be used later.

func (*Master) GetVariant

func (m *Master) GetVariant(index int) (*Variant, error)

GetVariant returns a Variant struct representing the variant's data.

func (*Master) GetVariantList

func (m *Master) GetVariantList() string

GetVariantList gets a printable list of variants

type Session

type Session struct {
	URL     string
	Master  *Master
	Variant *Variant
}

Session Stores state information

func NewSession

func NewSession(URL string) (*Session, error)

NewSession return a new session

func (*Session) GetMasterPlaylistOptions

func (sess *Session) GetMasterPlaylistOptions(width int) string

GetMasterPlaylistOptions return the possible playlist options.

func (*Session) GetVariantPrintData

func (sess *Session) GetVariantPrintData(width int, count int) string

GetVariantPrintData return the last n segments of a variant.

func (*Session) SetVariant

func (sess *Session) SetVariant(index int)

SetVariant sets the variant used for requesting data

type Variant

type Variant struct {
	Tags       []string
	URL        string
	Resolution string
	Bandwidth  int
	Codecs     string
	Segments   [][]string
	// contains filtered or unexported fields
}

Variant is a struct for storing data about a variant.

func (*Variant) Get

func (v *Variant) Get() error

Get makes the http request to get the latest data.

func (*Variant) GetHeaderTagsToPrint added in v1.0.11

func (v *Variant) GetHeaderTagsToPrint() string

GetHeaderTagsToPrint returns a the header tags for printing.

func (*Variant) GetSegmentsToPrint

func (v *Variant) GetSegmentsToPrint(count int) string

GetSegmentsToPrint compiles the text list of segments to print.

func (*Variant) Process

func (v *Variant) Process()

Process will loop through the tags and populate convenience properties.

func (*Variant) Refresh added in v1.0.11

func (v *Variant) Refresh() error

Refresh gets fresh segments that can be processed

Jump to

Keyboard shortcuts

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