Documentation
¶
Overview ¶
Package player provides the core media player functionality for dapp.fm It can be used both as Wails bindings (memory speed) or HTTP server (fallback)
Index ¶
- Variables
- func GetDemoTrack() ([]byte, error)
- func GetIndex() ([]byte, error)
- type AttachmentInfo
- type DecryptResult
- type ManifestInfo
- type Player
- func (p *Player) Decrypt(encrypted string, password string) (*DecryptResult, error)
- func (p *Player) GetLicenseInfo(encrypted string) (map[string]interface{}, error)
- func (p *Player) GetManifest(encrypted string) (*ManifestInfo, error)
- func (p *Player) IsLicenseValid(encrypted string) (bool, error)
- func (p *Player) QuickDecrypt(encrypted string, password string) (string, error)
- func (p *Player) Serve(addr string) error
- func (p *Player) Startup(ctx context.Context)
- type TrackInfo
Constants ¶
This section is empty.
Variables ¶
var Assets fs.FS
Assets returns the embedded filesystem with frontend/ prefix stripped
Functions ¶
func GetDemoTrack ¶
GetDemoTrack returns the embedded demo track content
Types ¶
type AttachmentInfo ¶
type AttachmentInfo struct {
Name string `json:"name"`
MimeType string `json:"mime_type"`
Size int `json:"size"`
DataURL string `json:"data_url"` // Base64 data URL for direct playback
}
AttachmentInfo describes a decrypted attachment
type DecryptResult ¶
type DecryptResult struct {
Body string `json:"body"`
Subject string `json:"subject,omitempty"`
From string `json:"from,omitempty"`
Attachments []AttachmentInfo `json:"attachments,omitempty"`
}
DecryptResult holds the decrypted message data
type ManifestInfo ¶
type ManifestInfo struct {
Title string `json:"title,omitempty"`
Artist string `json:"artist,omitempty"`
Album string `json:"album,omitempty"`
Genre string `json:"genre,omitempty"`
Year int `json:"year,omitempty"`
ReleaseType string `json:"release_type,omitempty"`
Duration int `json:"duration,omitempty"`
Format string `json:"format,omitempty"`
ExpiresAt int64 `json:"expires_at,omitempty"`
IssuedAt int64 `json:"issued_at,omitempty"`
LicenseType string `json:"license_type,omitempty"`
Tracks []TrackInfo `json:"tracks,omitempty"`
IsExpired bool `json:"is_expired"`
TimeRemaining string `json:"time_remaining,omitempty"`
}
ManifestInfo holds public metadata (readable without decryption)
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player provides media decryption and playback services Methods are exposed to JavaScript via Wails bindings
func (*Player) Decrypt ¶
func (p *Player) Decrypt(encrypted string, password string) (*DecryptResult, error)
Decrypt decrypts the SMSG content and returns playable media This is memory-speed via Wails bindings - no HTTP, no WASM
func (*Player) GetLicenseInfo ¶
GetLicenseInfo returns detailed license information
func (*Player) GetManifest ¶
func (p *Player) GetManifest(encrypted string) (*ManifestInfo, error)
GetManifest returns public metadata without decryption This is memory-speed via Wails bindings
func (*Player) IsLicenseValid ¶
IsLicenseValid checks if the license has expired This is memory-speed via Wails bindings
func (*Player) QuickDecrypt ¶
QuickDecrypt returns just the first attachment as a data URL Optimized for single-track playback