streaming
streaming copied to clipboard
m3u8: no easy test cases for parsing Variant, Rendition
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?