Restore Announce method for RTSP

This commit is contained in:
Alexey Khit
2023-02-17 09:20:46 +03:00
parent a8612fca43
commit e43b1e4ab6
+20 -18
View File
@@ -319,24 +319,26 @@ func (c *Conn) Describe() error {
return nil
}
//func (c *Conn) Announce() (err error) {
// req := &tcp.Request{
// Method: MethodAnnounce,
// URL: c.URL,
// Header: map[string][]string{
// "Content-Type": {"application/sdp"},
// },
// }
//
// //req.Body, err = c.sdp.Marshal()
// if err != nil {
// return
// }
//
// _, err = c.Do(req)
//
// return
//}
func (c *Conn) Announce() (err error) {
req := &tcp.Request{
Method: MethodAnnounce,
URL: c.URL,
Header: map[string][]string{
"Content-Type": {"application/sdp"},
},
}
req.Body, err = streamer.MarshalSDP(c.SessionName, c.Medias)
if err != nil {
return err
}
res, err := c.Do(req)
_ = res
return
}
func (c *Conn) Setup() error {
for _, media := range c.Medias {