upnp

package
v0.0.0-...-2d55c8d Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceProperties

func DeviceProperties(url string) (upnpDevice_XML, error)

func Discover

func Discover(filter string, manufacturer string, devType string) []device.DeviceInfo

Types

type GetCurrentMuteStatusResponse

type GetCurrentMuteStatusResponse struct {
	Envelope struct {
		Body struct {
			GetMuteResponse struct {
				CurrentMute string `json:"CurrentMute"`
			} `json:"GetMuteResponse"`
		} `json:"Body"`
	} `json:"Envelope"`
}

type GetDeviceVolumeResponse

type GetDeviceVolumeResponse struct {
	Envelope struct {
		Body struct {
			GetVolumeResponse struct {
				CurrentVolume string `json:"CurrentVolume"`
			} `json:"GetVolumeResponse"`
		} `json:"Body"`
	} `json:"Envelope"`
}

type GetPositionInfoResponse

type GetPositionInfoResponse struct {
	Envelope struct {
		Body struct {
			GetPositionResponse struct {
				Track         string
				RelTime       string
				TrackDuration string
				TrackMetaData string
				TrackURI      string
			} `json:"GetPositionInfoResponse"`
		} `json:"Body"`
	} `json:"Envelope"`
}

type Item_XML

type Item_XML struct {
	XMLName     xml.Name `xml:"item"`
	Title       string   `xml:"title"`
	Album       string   `xml:"album"`
	AlbumArtUri string   `xml:"albumArtURI"`
	Creator     string   `xml:"creator"`
}

type TrackMetaData_XML

type TrackMetaData_XML struct {
	XMLName xml.Name `xml:"DIDL-Lite"`
	Item    Item_XML `xml:"item"`
}

type UpnpClient

type UpnpClient struct {
	BaseUrl func(string) *url.URL
}

func (*UpnpClient) GetCurrentMedia

func (s *UpnpClient) GetCurrentMedia() (interface{}, error)

GetCurrentMedia will return the status of the current media playing

TODO

  • This has to been tested with any bad input, should be regarded as not stable.
  • This requires to be tested, it has not been ran to close any applications yet.

func (*UpnpClient) GetCurrentMuteStatus

func (s *UpnpClient) GetCurrentMuteStatus() (bool, error)

GetCurrentMuteStatus returns true if and only if the TV is currently muted

TODO

  • This has to been tested with any bad input, should be regarded as not stable.

func (*UpnpClient) GetCurrentVolume

func (s *UpnpClient) GetCurrentVolume() (int, error)

GetCurrentVolume returns the value of the current volume level

TODO

  • This has to been tested with any bad input, should be regarded as not stable.

func (*UpnpClient) GetPositionInfo

func (s *UpnpClient) GetPositionInfo() (map[string]string, error)

GetPositionInfo will return the status of the current media playing

func (*UpnpClient) Pause

func (s *UpnpClient) Pause() error

Pause will attempt to pause playback.

func (*UpnpClient) PlayCurrentMedia

func (s *UpnpClient) PlayCurrentMedia() error

PlayCurrentMedia will attempt to play the current media already set on the display.

TODO

  • This has to been tested with any bad input, should be regarded as not stable.
  • This requires to be tested, it has not been ran to close any applications yet.

func (*UpnpClient) PlayNext

func (s *UpnpClient) PlayNext() error

PlayNext will attempt to play the next media in playlist.

func (*UpnpClient) PlayPrevious

func (s *UpnpClient) PlayPrevious() error

PlayPrev will attempt to play the next media in playlist.

func (*UpnpClient) SetCurrentMedia

func (s *UpnpClient) SetCurrentMedia(url string) error

SetCurrentMedia will tell the display to play the current media via the URL.

TODO

  • This has to been tested with any bad input, should be regarded as not stable.
  • This requires to be tested, it has not been ran to close any applications yet.

func (*UpnpClient) SetVolume

func (s *UpnpClient) SetVolume(volume int) error

SetVolume will update the current volume of the display to the provided value.

TODO

  • This has to been tested with any bad input, should be regarded as not stable.

Jump to

Keyboard shortcuts

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