Documentation ¶
Index ¶
- Variables
- type App
- type Application
- func (a *Application) AddMessageFunc(f CastMessageFunc)
- func (a *Application) App() *cast.Application
- func (a *Application) Close(stopMedia bool) error
- func (a *Application) Load(filenameOrUrl string, startTime int, contentType string, ...) error
- func (a *Application) LoadApp(appID, contentID string) error
- func (a *Application) Media() *cast.Media
- func (a *Application) MediaFinished()
- func (a *Application) MediaStart()
- func (a *Application) MediaWait()
- func (a *Application) Next() error
- func (a *Application) Pause() error
- func (a *Application) PlayableMediaType(filename string) bool
- func (a *Application) PlayedItems() map[string]PlayedItem
- func (a *Application) Previous() error
- func (a *Application) QueueLoad(filenames []string, contentType string, transcode bool) error
- func (a *Application) Seek(value int) error
- func (a *Application) SeekFromStart(value int) error
- func (a *Application) SeekToTime(value float32) error
- func (a *Application) SetCacheDisabled(cacheDisabled bool)
- func (a *Application) SetConn(conn cast.Conn)
- func (a *Application) SetConnectionRetries(connectionRetries int)
- func (a *Application) SetDebug(debug bool)
- func (a *Application) SetIface(iface *net.Interface)
- func (a *Application) SetMuted(value bool) error
- func (a *Application) SetServerPort(serverPort int)
- func (a *Application) SetVolume(value float32) error
- func (a *Application) Skip() error
- func (a *Application) Skipad() error
- func (a *Application) Slideshow(filenames []string, duration int, repeat bool) error
- func (a *Application) Start(addr string, port int) error
- func (a *Application) Status() (*cast.Application, *cast.Media, *cast.Volume)
- func (a *Application) Stop() error
- func (a *Application) StopMedia() error
- func (a *Application) Transcode(contentType string, command string, args ...string) error
- func (a *Application) Unpause() error
- func (a *Application) Update() error
- func (a *Application) Volume() *cast.Volume
- type ApplicationOption
- func WithCacheDisabled(cacheDisabled bool) ApplicationOption
- func WithConnection(conn cast.Conn) ApplicationOption
- func WithConnectionRetries(connectionRetries int) ApplicationOption
- func WithDebug(debug bool) ApplicationOption
- func WithIface(iface *net.Interface) ApplicationOption
- func WithServerPort(port int) ApplicationOption
- type CastMessageFunc
- type PlayedItem
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") ErrNoMediaSkipad = errors.New("No ad detected, there is nothing to skip") ErrVolumeOutOfRange = errors.New("specified volume is out of range (0 - 1)") ErrAdMaxLoop = errors.New("Unable to skip ad for unknown reason") )
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface { SetConn(conn cast.Conn) SetIface(*net.Interface) SetDebug(bool) SetCacheDisabled(bool) SetConnectionRetries(int) SetServerPort(int) Start(addr string, port int) error Close(stopMedia bool) error LoadApp(appID, contentID string) error Status() (*cast.Application, *cast.Media, *cast.Volume) Update() error Pause() error Unpause() error Stop() error StopMedia() error Seek(value int) error SeekFromStart(value int) error SeekToTime(value float32) error Skipad() error Load(filenameOrUrl string, startTime int, contentType string, transcode, detach, forceDetach bool) error QueueLoad(filenames []string, contentType string, transcode bool) error Transcode(contentType string, command string, args ...string) error Next() error Previous() error SetVolume(value float32) error SetMuted(value bool) error Slideshow(filenames []string, duration int, repeat bool) error AddMessageFunc(f CastMessageFunc) PlayedItems() map[string]PlayedItem PlayableMediaType(filename string) bool }
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(opts ...ApplicationOption) *Application
func (*Application) AddMessageFunc ¶
func (a *Application) AddMessageFunc(f CastMessageFunc)
func (*Application) App ¶
func (a *Application) App() *cast.Application
func (*Application) Close ¶
func (a *Application) Close(stopMedia bool) error
func (*Application) LoadApp ¶
func (a *Application) LoadApp(appID, contentID string) error
func (*Application) Media ¶
func (a *Application) Media() *cast.Media
func (*Application) MediaFinished ¶
func (a *Application) MediaFinished()
func (*Application) MediaStart ¶
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 ¶
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 ¶
func (a *Application) SeekToTime(value float32) error
func (*Application) SetCacheDisabled ¶
func (a *Application) SetCacheDisabled(cacheDisabled bool)
func (*Application) SetConn ¶
func (a *Application) SetConn(conn cast.Conn)
func (*Application) SetConnectionRetries ¶
func (a *Application) SetConnectionRetries(connectionRetries int)
func (*Application) SetDebug ¶
func (a *Application) SetDebug(debug bool)
func (*Application) SetIface ¶
func (a *Application) SetIface(iface *net.Interface)
func (*Application) SetMuted ¶
func (a *Application) SetMuted(value bool) error
func (*Application) SetServerPort ¶
func (a *Application) SetServerPort(serverPort int)
func (*Application) SetVolume ¶
func (a *Application) SetVolume(value float32) error
func (*Application) Skip ¶
func (a *Application) Skip() error
func (*Application) Skipad ¶
func (a *Application) Skipad() error
func (*Application) Slideshow ¶
func (a *Application) Slideshow(filenames []string, duration int, repeat bool) 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 ¶
func (a *Application) Transcode(contentType string, command string, args ...string) error
func (*Application) Unpause ¶
func (a *Application) Unpause() error
func (*Application) Update ¶
func (a *Application) Update() error
func (*Application) Volume ¶
func (a *Application) Volume() *cast.Volume
type ApplicationOption ¶
type ApplicationOption func(*Application)
func WithCacheDisabled ¶
func WithCacheDisabled(cacheDisabled bool) ApplicationOption
func WithConnection ¶
func WithConnection(conn cast.Conn) ApplicationOption
func WithConnectionRetries ¶
func WithConnectionRetries(connectionRetries int) ApplicationOption
func WithDebug ¶
func WithDebug(debug bool) ApplicationOption
func WithIface ¶
func WithIface(iface *net.Interface) ApplicationOption
func WithServerPort ¶
func WithServerPort(port int) ApplicationOption
type CastMessageFunc ¶
type CastMessageFunc func(*pb.CastMessage)
type PlayedItem ¶
Click to show internal directories.
Click to hide internal directories.