Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
711 B · 23 lines
123456789101112131415161718192021222324package media
import ( "testing"
"github.com/stretchr/testify/require" "stream.place/streamplace/pkg/livehls")
// Rendition names come from the window's rendition tracks (ids from// renditionTrackBase up), highest first, never the source track.func TestRenditionNames(t *testing.T) { names := renditionNames([]livehls.VideoTrack{ {ID: "1", Width: 1920, Height: 1080}, {ID: "102", Width: 426, Height: 240}, {ID: "100", Width: 1280, Height: 720}, {ID: "101", Width: 640, Height: 360}, {ID: "x", Height: 99}, }) require.Equal(t, []string{"720p", "360p", "240p"}, names) require.Empty(t, renditionNames([]livehls.VideoTrack{{ID: "1", Height: 1080}})) require.Empty(t, renditionNames(nil))}