streamd: copyable m3u8 links + FHD/HD/SD output variants
Some checks failed
release / build-and-upload (push) Failing after 3m33s
Some checks failed
release / build-and-upload (push) Failing after 3m33s
- WebUI Copy button for absolute m3u8 URLs (no player) - Per-stream variants ladder; HD/SD live-transcoded as sibling HLS - variants_json in DB/API; supervisor spawns scaled ffmpeg packagers
This commit is contained in:
parent
ac8701b5a6
commit
3cb259c9b6
12 changed files with 913 additions and 62 deletions
32
apps/streamd/internal/db/variants_test.go
Normal file
32
apps/streamd/internal/db/variants_test.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package db
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNormalizeVariantsEnsuresFHD(t *testing.T) {
|
||||
got := NormalizeVariants([]VariantSpec{
|
||||
{ID: "hd", Enabled: true, Height: 720},
|
||||
})
|
||||
if len(got) < 2 {
|
||||
t.Fatalf("len=%d", len(got))
|
||||
}
|
||||
if got[0].ID != "fhd" || got[0].Height != 0 || !got[0].Enabled {
|
||||
t.Fatalf("source = %+v", got[0])
|
||||
}
|
||||
if path := VariantPlayPath("rte-one", "hd", 720); path != "/hls/rte-one-hd/index.m3u8" {
|
||||
t.Fatalf("path=%s", path)
|
||||
}
|
||||
if path := VariantPlayPath("rte-one", "fhd", 0); path != "/hls/rte-one/index.m3u8" {
|
||||
t.Fatalf("fhd path=%s", path)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseVariantsJSONDefault(t *testing.T) {
|
||||
got := ParseVariantsJSON("")
|
||||
if len(got) != 3 {
|
||||
t.Fatalf("default len=%d", len(got))
|
||||
}
|
||||
scaled := ScaledVariants(got)
|
||||
if len(scaled) != 0 {
|
||||
t.Fatalf("default scaled=%v", scaled)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue