streaming icon indicating copy to clipboard operation
streaming copied to clipboard

m3u8: no easy test cases for parsing Variant, Rendition

Open ollytom opened this issue 1 year ago • 0 comments

The functions for parsing Variant and Renditions

func parseVariant(items chan item) (*Variant, error) {
func parseRendition(items chan item) (*Rendition, error) {

take chan item. Right now we don't have an easy way to add test cases. Ideally, I think, we could test these functions by having a single string with a HLS tag, e.g.

#EXT-X-STREAM-INF:BANDWIDTH=1280000,RESOLUTION=640x360
url_0/high.m3u8

and the data structure we want to parse from it, e.g.

Variant{
	URI: "url_0/high.m3u8",
	Bandwidth: 1280000,
	Resolution: [2]int{640, 360},
}

Maybe we want to have a way of taking in a string and returning a chan item from it?

ollytom avatar Aug 12 '24 06:08 ollytom