add album page showing track listing
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/wildeyedskies/go-mpv/mpv"
|
||||
)
|
||||
@@ -226,6 +227,15 @@ func (p *Player) PlayFromBeginning() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Start playback from the specified track index in the play queue.
|
||||
func (p *Player) PlayTrackAt(idx int) error {
|
||||
err := p.mpv.Command([]string{"playlist-play-index", strconv.Itoa(idx)})
|
||||
if err == nil {
|
||||
p.setState(Playing)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// Begins playback if there is anything in the play queue and player is stopped or paused.
|
||||
// If player is playing, pauses playback.
|
||||
func (p *Player) PlayPause() error {
|
||||
|
||||
Reference in New Issue
Block a user