Documentation
¶
Overview ¶
Package nowplaying provides Experimental system media metadata and media keys.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("nowplaying: session closed")
ErrClosed is returned when updating a closed session.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
ID string // application identifier, e.g. "com.example.player"
Name string
Play, Pause, Toggle, Next, Previous func()
Seek func(time.Duration)
// contains filtered or unexported fields
}
Options identifies the application and supplies its supported controls. Leave unsupported callbacks nil. Callbacks run on the app's main thread.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session owns a system media session. Create it in OnReady or once the app is running. The session is closed when the app terminates.
func New ¶
New registers a system media session. A backend without media integration returns tango.ErrUnsupported.
type State ¶
type State struct {
Title, Artist, Album, TrackID string
Duration, Position time.Duration
Rate float64
Playback Playback
// contains filtered or unexported fields
}
State is a playback snapshot. Position and Duration use media time. Rate defaults to 1. TrackID identifies the item across metadata updates.