application

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrApplicationNotSet      = errors.New("application isn't set")
	ErrMediaNotYetInitialised = errors.New("media not yet initialised")
	ErrNoMediaNext            = errors.New("media not yet initialised, there is nothing to go to next")
	ErrNoMediaPause           = errors.New("media not yet initialised, there is nothing to pause")
	ErrNoMediaPrevious        = errors.New("media not yet initialised, there is nothing previous")
	ErrNoMediaSkip            = errors.New("media not yet initialised, there is nothing to skip")
	ErrNoMediaStop            = errors.New("media not yet initialised, there is nothing to stop")
	ErrNoMediaUnpause         = errors.New("media not yet initialised, there is nothing to unpause")
	ErrVolumeOutOfRange       = errors.New("specified volume is out of range (0 - 1)")
)

Functions

This section is empty.

Types

type Application

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

func NewApplication

func NewApplication(opts ...ApplicationOption) *Application

func (*Application) AddMessageFunc added in v0.2.6

func (a *Application) AddMessageFunc(f CastMessageFunc)

func (*Application) Application added in v0.2.6

func (a *Application) Application() *cast.Application

func (*Application) Close

func (a *Application) Close(stopMedia bool) error

func (*Application) Load

func (a *Application) Load(filenameOrUrl, contentType string, transcode, detach, forceDetach bool) error

func (*Application) Media added in v0.2.6

func (a *Application) Media() *cast.Media

func (*Application) MediaFinished added in v0.2.6

func (a *Application) MediaFinished()

func (*Application) MediaStart added in v0.2.6

func (a *Application) MediaStart()

TODO: Clean-up: these Media* methods are a hack around trying to use the mediaFinished channel when it hasn't been properly set up. This is happening because there is some instances where we don't have any running media ('watch' command) but yet the 'mediaFinished' is littered throughout the codebase. This needs a redesign now that we do things other than just loading and playing media files.

func (*Application) MediaWait added in v0.2.6

func (a *Application) MediaWait()

func (*Application) Next

func (a *Application) Next() error

func (*Application) Pause

func (a *Application) Pause() error

func (*Application) PlayableMediaType

func (a *Application) PlayableMediaType(filename string) bool

func (*Application) PlayedItems

func (a *Application) PlayedItems() map[string]PlayedItem

func (*Application) Previous

func (a *Application) Previous() error

func (*Application) QueueLoad

func (a *Application) QueueLoad(filenames []string, contentType string, transcode bool) error

func (*Application) Seek

func (a *Application) Seek(value int) error

func (*Application) SeekFromStart

func (a *Application) SeekFromStart(value int) error

func (*Application) SeekToTime added in v0.2.6

func (a *Application) SeekToTime(value float32) error

func (*Application) SetDebug

func (a *Application) SetDebug(debug bool)

func (*Application) SetMuted added in v0.2.6

func (a *Application) SetMuted(value bool) error

func (*Application) SetVolume added in v0.2.6

func (a *Application) SetVolume(value float32) error

func (*Application) Skip

func (a *Application) Skip() error

func (*Application) Slideshow added in v0.2.6

func (a *Application) Slideshow(filenames []string, duration int, repeat bool) error

func (*Application) Start

func (a *Application) Start(addr string, port int) error

func (*Application) Status

func (a *Application) Status() (*cast.Application, *cast.Media, *cast.Volume)

func (*Application) Stop

func (a *Application) Stop() error

func (*Application) StopMedia

func (a *Application) StopMedia() error

func (*Application) Transcode added in v0.2.6

func (a *Application) Transcode(command string, contentType string) error

func (*Application) Unpause

func (a *Application) Unpause() error

func (*Application) Update

func (a *Application) Update() error

func (*Application) Volume added in v0.2.6

func (a *Application) Volume() *cast.Volume

type ApplicationOption added in v0.2.6

type ApplicationOption func(*Application)

func WithCacheDisabled added in v0.2.6

func WithCacheDisabled(cacheDisabled bool) ApplicationOption

func WithConnectionRetries added in v0.2.6

func WithConnectionRetries(connectionRetries int) ApplicationOption

func WithDebug added in v0.2.6

func WithDebug(debug bool) ApplicationOption

func WithIface added in v0.2.6

func WithIface(iface *net.Interface) ApplicationOption

type CastMessageFunc added in v0.2.6

type CastMessageFunc func(*pb.CastMessage)

type PlayedItem

type PlayedItem struct {
	ContentID string `json:"content_id"`
	Started   int64  `json:"started"`
	Finished  int64  `json:"finished"`
}

Jump to

Keyboard shortcuts

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