mirror of
https://github.com/aler9/gortsplib
synced 2025-09-27 19:42:11 +08:00
client: add Start2; deprecate Start (#801)
This commit is contained in:
@@ -17,16 +17,19 @@ import (
|
||||
// 3. re-publish all medias on another path.
|
||||
|
||||
func main() {
|
||||
reader := gortsplib.Client{}
|
||||
|
||||
// parse source URL
|
||||
sourceURL, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
reader := gortsplib.Client{
|
||||
Scheme: sourceURL.Scheme,
|
||||
Host: sourceURL.Host,
|
||||
}
|
||||
|
||||
// connect to the server
|
||||
err = reader.Start(sourceURL.Scheme, sourceURL.Host)
|
||||
err = reader.Start2()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user