Documentation ¶
Index ¶
- Constants
- Variables
- type Player
- func (p *Player) AddToQueue(c *gumble.Client, url *url.URL) ([]*Track, error)
- func (p *Player) ClearQueue()
- func (p *Player) GetCurrentSong() (string, error)
- func (p *Player) GetNextSongs() (string, error)
- func (p *Player) GetVolume() float32
- func (p *Player) SearchAndAdd(c *gumble.Client, apiKey, query string) (*Track, error)
- func (p *Player) SetVolume(vol int) error
- func (p *Player) Skip() error
- func (p *Player) Start(c *gumble.Client) error
- func (p *Player) Stop() error
- type Thumbnail
- type Track
Constants ¶
View Source
const MaxNextSongs = 20
View Source
const MaxPlaylistSize = 100
Variables ¶
View Source
var ( ErrNoFormat = errors.New("no format found") ErrEmpty = errors.New("empty playlist") ErrPlaying = errors.New("the playlist is already playing") ErrStopped = errors.New("the playlist is already stopped") ErrVolumeRange = errors.New("the volume level is incorrect") ErrEmptyPlaylist = errors.New("playlist empty") ErrIncorrectURL = errors.New("incorrect url") )
View Source
var ErrThumbDownload = errors.New("could not get thumbnail")
Functions ¶
This section is empty.
Types ¶
type Player ¶
type Player struct { SongList []string // contains filtered or unexported fields }
func (*Player) AddToQueue ¶
Add the song from the URL to the playlist Returns the track that is added.
func (*Player) GetCurrentSong ¶
Returns info about the current song
func (*Player) GetNextSongs ¶
Get songs that are going to play next
func (*Player) SearchAndAdd ¶
Searches youtube using the query argument and adds the first result to the playlist. Returns the track that is added.
type Thumbnail ¶
func NewThumbnail ¶
Initializes a new thumbail from a give url string
type Track ¶
type Track struct { Stream *gumbleffmpeg.Stream Duration time.Duration StreamURL string PublicURL string Title string Artist string Thumbnail *Thumbnail }
func YoutubePlaylistToTracks ¶
func YoutubePlaylistToTracks(gc *gumble.Client, yc *youtube.Client, p *youtube.Playlist) ([]*Track, error)
Returns a slice of tracks from a playlist
Click to show internal directories.
Click to hide internal directories.