streaming

Media streaming and broadcast systems in Go
Log | Files | Refs | README | LICENSE

cmcd_test.go (374B)


      1 package cmcd
      2 
      3 import (
      4 	"fmt"
      5 	"net/url"
      6 )
      7 
      8 func ExampleParseInfo() {
      9 	ex := "http://test.example.com/?CMCD=br%3D3200%2Cbs%2Cd%3D4004%2Cmtp%3D25400"
     10 	u, err := url.Parse(ex)
     11 	param := u.Query().Get("CMCD")
     12 	fmt.Println(param)
     13 	info, err := ParseInfo(param)
     14 	if err != nil {
     15 		// handle...
     16 	}
     17 	fmt.Println(info.Bitrate)
     18 	// Output:
     19 	// br=3200,bs,d=4004,mtp=25400
     20 	// 3200
     21 }