streamd: preview quality picker, dashboard polish, C4 wrap keys
All checks were successful
release / build-and-upload (push) Successful in 6m18s
modules-release / build-and-upload (push) Successful in 5m18s

- Preview player can select FHD/HD/SD (or ABR master) from publish links
- Embed dashboard screenshots in README; Linux streamd+agent setup guide
- C4 Widevine wrap license mode + require --wvd; prefer Widevine PSSH
- Channel 4 and My5 modules; streamd auth, variants, schedules, HLS gate
This commit is contained in:
404errordeveloper 2026-10-09 20:57:43 +02:00
parent b3955bd81e
commit 066e018749
113 changed files with 19002 additions and 1541 deletions

View file

@ -11,8 +11,12 @@ import (
)
type Config struct {
StreamdURL string `yaml:"streamd_url"`
StreamdURL string `yaml:"streamd_url"`
// Token is this agent's streamd credential. It is now an API key created
// in the dashboard (Settings -> API keys, role operator) rather than the
// one shared secret; `api_key` is a clearer alias for the same field.
Token string `yaml:"token"`
APIKey string `yaml:"api_key"`
PollIntervalSec int `yaml:"poll_interval_sec"`
DataDir string `yaml:"data_dir"`
Workers int `yaml:"workers"`
@ -24,9 +28,19 @@ type Config struct {
UserAgent string `yaml:"user_agent"`
AgentID string `yaml:"agent_id"`
// SyncModules pushes local modules/<name>/module.yaml to streamd when missing/stale.
SyncModules bool `yaml:"sync_modules"`
ModulesDir string `yaml:"modules_dir"` // empty = repo modules/
ModulesSyncIntervalSec int `yaml:"modules_sync_interval_sec"`
SyncModules bool `yaml:"sync_modules"`
ModulesDir string `yaml:"modules_dir"` // empty = repo modules/
ModulesSyncIntervalSec int `yaml:"modules_sync_interval_sec"`
// OnDemandPriority lets a capture that streamd pushed — a viewer waking
// an on-demand stream, or a scheduled event about to start — jump ahead
// of routine refreshes in the queue.
OnDemandPriority *bool `yaml:"ondemand_priority"`
}
// PushedCapturesArePriority reports whether pushed captures jump the queue.
// Defaults to true: somebody is waiting on them.
func (c Config) PushedCapturesArePriority() bool {
return c.OnDemandPriority == nil || *c.OnDemandPriority
}
func (c Config) PollInterval() time.Duration {
@ -72,9 +86,15 @@ func applyDefaults(cfg Config, root string) Config {
if cfg.StreamdURL == "" {
cfg.StreamdURL = "http://127.0.0.1:8083"
}
if cfg.Token == "" {
cfg.Token = cfg.APIKey
}
if cfg.Token == "" {
cfg.Token = os.Getenv("STREAMD_TOKEN")
}
if cfg.Token == "" {
cfg.Token = os.Getenv("STREAMD_API_KEY")
}
if cfg.PollIntervalSec <= 0 {
cfg.PollIntervalSec = 30
}