Skip to content

Commit

Permalink
Enable SCTP optimization on client side
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 committed Dec 19, 2024
1 parent 877ca24 commit f558e9c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions client/rtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ const (
pingInterval = time.Second
)

var (
rtpVideoExtensions = []string{
"urn:ietf:params:rtp-hdrext:sdes:mid",
"urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id",
"urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id",
}
)
var rtpVideoExtensions = []string{
"urn:ietf:params:rtp-hdrext:sdes:mid",
"urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id",
"urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id",
}

func (c *Client) handleWSEventSignal(evData map[string]any) error {
data, ok := evData["data"].(string)
Expand Down Expand Up @@ -213,7 +211,10 @@ func (c *Client) initRTCSession() error {
}
}

api := webrtc.NewAPI(webrtc.WithMediaEngine(&m), webrtc.WithInterceptorRegistry(&i))
s := webrtc.SettingEngine{}
s.EnableSCTPZeroChecksum(true)

api := webrtc.NewAPI(webrtc.WithMediaEngine(&m), webrtc.WithInterceptorRegistry(&i), webrtc.WithSettingEngine(s))

pc, err := api.NewPeerConnection(cfg)
if err != nil {
Expand Down

0 comments on commit f558e9c

Please sign in to comment.