mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
add partial client read example; fix #16
This commit is contained in:
@@ -10,8 +10,8 @@ import (
|
||||
)
|
||||
|
||||
// This example shows how to
|
||||
// * connect to a RTSP server
|
||||
// * query and print informations about tracks published on a path.
|
||||
// 1. connect to a RTSP server
|
||||
// 2. get and print informations about tracks published on a path.
|
||||
|
||||
func main() {
|
||||
u, err := base.ParseURL("rtsp://myserver/mypath")
|
||||
@@ -30,14 +30,10 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
tracks, res, err := conn.Describe(u)
|
||||
tracks, _, err := conn.Describe(u)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if res.StatusCode != base.StatusOK {
|
||||
panic(fmt.Errorf("server returned status %d", res.StatusCode))
|
||||
}
|
||||
|
||||
fmt.Println("available tracks: %v\n", tracks)
|
||||
}
|
||||
|
Reference in New Issue
Block a user