player

package
v0.8.14 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendPlayer added in v0.8.13

type BackendPlayer interface {
	Play(url string) error
	Pause(value bool) error
	Stop() error

	// SetVolume:
	//
	//   - sets the volume to an absolute value in [0,100]
	//   - returns the set value and nil if succeeded, error if failed
	SetVolume(value int) (int, error)

	Metadata() *model.Metadata

	// Seek:
	//
	//   - seek by a +/- amount of seconds,
	//   - returns the metadata for the new playback position if succeeded, metadata with error if failed
	Seek(amtSec int) *model.Metadata

	Close() error
}

type Player

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

func NewPlayer added in v0.3.3

func NewPlayer(ctx context.Context, cfg *config.Value, internalPlayer BackendPlayer) (*Player, error)

func (*Player) AvailablePlayerTypes added in v0.8.0

func (p *Player) AvailablePlayerTypes() []config.PlayerType

func (*Player) Close added in v0.3.3

func (p *Player) Close() error

func (*Player) Metadata

func (p *Player) Metadata() *model.Metadata

func (*Player) Pause added in v0.3.3

func (p *Player) Pause(value bool) error

func (*Player) Play

func (p *Player) Play(url string) error

func (*Player) Seek added in v0.3.4

func (p *Player) Seek(amtSec int) *model.Metadata

Seek:

  • seek by a +/- amount of seconds,
  • returns the metadata for the new playback position if succeeded, metadata with error if failed

func (*Player) SetVolume added in v0.3.3

func (p *Player) SetVolume(value int) (int, error)

SetVolume:

  • sets the volume to an absolute value in [0,100]
  • returns the set value and nil if succeeded, or an irrelevant value and error if failed

func (*Player) Stop

func (p *Player) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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