mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
client: add clientconn.Seek()
This commit is contained in:
@@ -1574,6 +1574,16 @@ func (cc *ClientConn) Pause() (*base.Response, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Seek asks the server to re-start the stream from a specific timestamp.
|
||||
func (cc *ClientConn) Seek(ra *headers.Range) (*base.Response, error) {
|
||||
_, err := cc.Pause()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return cc.Play(ra)
|
||||
}
|
||||
|
||||
// ReadFrames starts reading frames.
|
||||
func (cc *ClientConn) ReadFrames(onFrame func(int, StreamType, []byte)) error {
|
||||
cc.readCBMutex.Lock()
|
||||
|
Reference in New Issue
Block a user