mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 20:41:59 -08:00
This commit is contained in:
parent
4ed1a39da2
commit
bfa83fcd33
1 changed files with 7 additions and 5 deletions
|
|
@ -23,7 +23,8 @@ type WHIPClient struct {
|
|||
URL *url.URL
|
||||
Log logger.Writer
|
||||
|
||||
pc *PeerConnection
|
||||
pc *PeerConnection
|
||||
patchIsSupported bool
|
||||
}
|
||||
|
||||
// Publish publishes tracks.
|
||||
|
|
@ -290,10 +291,7 @@ func (c *WHIPClient) postOffer(
|
|||
return nil, fmt.Errorf("bad Content-Type: expected 'application/sdp', got '%s'", contentType)
|
||||
}
|
||||
|
||||
acceptPatch := res.Header.Get("Accept-Patch")
|
||||
if acceptPatch != "application/trickle-ice-sdpfrag" {
|
||||
return nil, fmt.Errorf("wrong Accept-Patch: expected 'application/trickle-ice-sdpfrag', got '%s'", acceptPatch)
|
||||
}
|
||||
c.patchIsSupported = (res.Header.Get("Accept-Patch") == "application/trickle-ice-sdpfrag")
|
||||
|
||||
Location := res.Header.Get("Location")
|
||||
|
||||
|
|
@ -325,6 +323,10 @@ func (c *WHIPClient) patchCandidate(
|
|||
etag string,
|
||||
candidate *webrtc.ICECandidateInit,
|
||||
) error {
|
||||
if !c.patchIsSupported {
|
||||
return nil
|
||||
}
|
||||
|
||||
frag, err := ICEFragmentMarshal(offer.SDP, []*webrtc.ICECandidateInit{candidate})
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue