mirror of
https://github.com/aler9/gortsplib
synced 2025-09-27 11:32:08 +08:00
client: add Start2; deprecate Start (#801)
This commit is contained in:
@@ -22,16 +22,19 @@ import (
|
||||
// apt install -y libavcodec-dev libswscale-dev gcc pkg-config
|
||||
|
||||
func main() {
|
||||
c := gortsplib.Client{}
|
||||
|
||||
// parse URL
|
||||
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
c := gortsplib.Client{
|
||||
Scheme: u.Scheme,
|
||||
Host: u.Host,
|
||||
}
|
||||
|
||||
// connect to the server
|
||||
err = c.Start(u.Scheme, u.Host)
|
||||
err = c.Start2()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user