Documentation
¶
Overview ¶
Package dlna is a minimal DLNA / UPnP ContentDirectory browse client. It talks to a MediaServer's ContentDirectory:1 service via SOAP Browse actions, and parses the DIDL-Lite responses into structured Go types.
Device discovery lives in pkg/discovery; this package is only the browse half.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MimeFromProtocolInfo ¶
MimeFromProtocolInfo extracts the MIME type from a DLNA protocolInfo string. Format is "protocol:network:contentType:additionalInfo", e.g. "http-get:*:audio/mpeg:*". Returns the third colon-separated field.
Types ¶
type BrowseResult ¶
BrowseResult holds one page of a ContentDirectory Browse response.
func Browse ¶
func Browse(ctx context.Context, srv discovery.MediaServer, objectID string, start, count int) (BrowseResult, error)
Browse calls ContentDirectory:Browse on srv and returns one page of results. objectID "0" is the server root. start is the page offset, count the page size (0 defaults to 50 on the caller side so the request is always bounded).
type Item ¶
type Item struct {
ID string
ParentID string
Title string
Artist string
Album string
Class string
MimeType string
StreamURL string
AlbumArtURL string
DurationSec int
}
Item is a single playable object (track, photo, video). Use IsAudioItem to check whether a SoundTouch renderer can play it.
func (Item) IsAudioItem ¶
IsAudioItem reports whether the item is an audio track. Photos, videos, and unrecognised items return false.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dlnatest provides an in-process DLNA / UPnP MediaServer for use in unit tests (via httptest.Server) and as a real LAN-visible server.
|
Package dlnatest provides an in-process DLNA / UPnP MediaServer for use in unit tests (via httptest.Server) and as a real LAN-visible server. |