player

package
v0.0.0-...-b3e936c Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMoreMedia = errors.New("no more media in the list")
View Source
var ErrPlayerNotInitialized = errors.New("player wasn't initialized")
View Source
var VideoFiles map[string]struct{} = map[string]struct{}{
	".avi": {},
	".mp4": {},
	".mkv": {},
}

Functions

This section is empty.

Types

type MediaList

type MediaList struct {
	SortStrategy MediaListSortStrategy
	// contains filtered or unexported fields
}

func FromFolder

func FromFolder(folderPath string) (*MediaList, error)

func NewMediaList

func NewMediaList(list []string, sortStrat MediaListSortStrategy) (*MediaList, error)

func (*MediaList) Advance

func (ml *MediaList) Advance() string

func (*MediaList) All

func (ml *MediaList) All() []string

func (*MediaList) Current

func (ml *MediaList) Current() string

func (*MediaList) Next

func (ml *MediaList) Next() string

type MediaListSortStrategy

type MediaListSortStrategy interface {
	Sort([]string)
}

type NullPlayer

type NullPlayer struct {
	// contains filtered or unexported fields
}

NullPlayer advances the current item in the MediaList every 30 minutes. It (poorly) mimics the list of media being watched, as if it was on another channel.

func (*NullPlayer) Current

func (n *NullPlayer) Current() string

func (*NullPlayer) Init

func (n *NullPlayer) Init() error

func (*NullPlayer) Next

func (n *NullPlayer) Next() string

func (*NullPlayer) Play

func (n *NullPlayer) Play(list *MediaList) error

func (*NullPlayer) PlayNext

func (n *NullPlayer) PlayNext() error

func (*NullPlayer) Shutdown

func (n *NullPlayer) Shutdown() error

type Player

type Player interface {
	Init() error

	Play(list *MediaList) error
	PlayNext() error

	Next() string
	Current() string

	Shutdown() error
}

type SortStratRandom

type SortStratRandom struct{}

func (SortStratRandom) Sort

func (s SortStratRandom) Sort(list []string)

type VLCPlayer

type VLCPlayer struct {
	// contains filtered or unexported fields
}

func (*VLCPlayer) Current

func (p *VLCPlayer) Current() string

func (*VLCPlayer) Init

func (p *VLCPlayer) Init() error

func (*VLCPlayer) Next

func (p *VLCPlayer) Next() string

func (*VLCPlayer) Play

func (p *VLCPlayer) Play(list *MediaList) error

func (*VLCPlayer) PlayNext

func (p *VLCPlayer) PlayNext() error

func (*VLCPlayer) Shutdown

func (p *VLCPlayer) Shutdown() error

Jump to

Keyboard shortcuts

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