Documentation ¶
Index ¶
- Constants
- func Discover() ([]string, error)
- type MediaMetadata
- type Player
- func (p *Player) IsBuffering() bool
- func (p *Player) IsIdle() bool
- func (p *Player) IsMuted() bool
- func (p *Player) IsPaused() bool
- func (p *Player) IsPlaying() bool
- func (p *Player) Load(media *url.URL, metadata omnicast.MediaMetadata) error
- func (p *Player) MediaDuration() time.Duration
- func (p *Player) MediaMetadata() omnicast.MediaMetadata
- func (p *Player) MediaURL() *url.URL
- func (p *Player) Mute()
- func (p *Player) Name() string
- func (p *Player) Pause()
- func (p *Player) Play()
- func (p *Player) PlaybackPosition() time.Duration
- func (p *Player) PlaybackRate() float32
- func (p *Player) PlaybackStatus() string
- func (p *Player) SeekTo(pos time.Duration)
- func (p *Player) SetVolumeLevel(level float64)
- func (p *Player) Stop()
- func (p *Player) Unmute()
- func (p *Player) VolumeLevel() float64
Constants ¶
const ( DBusPath = "org.mpris.MediaPlayer2" DBusInterface = "/org/mpris/MediaPlayer2" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MediaMetadata ¶
type MediaMetadata map[string]dbus.Variant
MediaMetadata is a mapping from metadata attribute names to values.
https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata/
func (MediaMetadata) ImageURL ¶
func (m MediaMetadata) ImageURL() *url.URL
ImageURL returns the URL of the image.
func (MediaMetadata) MediaDuration ¶
func (m MediaMetadata) MediaDuration() time.Duration
MediaDuration returns the duration of the media.
func (MediaMetadata) MediaURL ¶
func (m MediaMetadata) MediaURL() *url.URL
MediaURL returns the URL of the media content.
func (MediaMetadata) Subtitle ¶
func (m MediaMetadata) Subtitle() string
Subtitle returns the descriptive subtitle of the content. Usually, the name of the album.
func (MediaMetadata) Title ¶
func (m MediaMetadata) Title() string
Title returns the descriptive title of the content.
func (MediaMetadata) TrackID ¶
func (m MediaMetadata) TrackID() dbus.ObjectPath
TrackID returns the track ID as a D-Bus object path.
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player represents a MPRIS player.
func (*Player) IsBuffering ¶
IsBuffering always returns false as the MPRIS API does not provide this information.
func (*Player) MediaDuration ¶
MediaDuration returns the duration of current loaded media.
func (*Player) MediaMetadata ¶
func (p *Player) MediaMetadata() omnicast.MediaMetadata
MediaMetadata returns the metadata of current loaded media.
func (*Player) PlaybackPosition ¶
PlaybackPosition returns the current position of media playback from the beginning of media content.
func (*Player) PlaybackRate ¶
PlaybackRate returns the ratio of speed that media is played at.
func (*Player) PlaybackStatus ¶
PlaybackStatus return the current playback status.
func (*Player) SetVolumeLevel ¶
SetVolumeLevel sets receiver volume level.
func (*Player) Stop ¶
func (p *Player) Stop()
Stop stops the playback and resets the playback position.
func (*Player) VolumeLevel ¶
VolumeLevel returns receiver volume as a number between 0.0 and 1.0.