예제 #1
0
func VideoInfoWithQueryString(query string) (metadata *VideoInfo, err error) {
	param, err := url.ParseQuery(query)
	if err != nil {
		return nil, err
	}

	err = form.Bind(param, &metadata)
	if err != nil {
		return nil, err
	}
	return metadata, nil
}
예제 #2
0
func (this VideoInfo) CleanedVideoStreamInfoList(p string) (infoList []*VideoStreamInfo) {
	var ps = strings.Split(p, ",")

	infoList = make([]*VideoStreamInfo, 0, 0)

	for i := 0; i < len(ps); i++ {
		param, err := url.ParseQuery(ps[i])
		if err != nil {
			continue
		}

		var info *VideoStreamInfo
		err = form.Bind(param, &info)
		if err != nil {
			continue
		}
		infoList = append(infoList, info)
	}

	return infoList
}