File tree 3 files changed +8
-1
lines changed
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module github.com/pion/ion-sfu
3
3
go 1.13
4
4
5
5
require (
6
+ github.com/bep/debounce v1.2.0
6
7
github.com/gammazero/deque v0.0.0-20201010052221-3932da5530cc
7
8
github.com/golang/protobuf v1.4.3
8
9
github.com/gorilla/websocket v1.4.2
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
30
30
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 /go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8 =
31
31
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 /go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q =
32
32
github.com/beorn7/perks v1.0.0 /go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8 =
33
+ github.com/bep/debounce v1.2.0 h1:wXds8Kq8qRfwAOpAxHrJDbCXgC5aHSzgQb/0gKsHQqo =
34
+ github.com/bep/debounce v1.2.0 /go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0 =
33
35
github.com/bgentry/speakeasy v0.1.0 /go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs =
34
36
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c /go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84 =
35
37
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625 /go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g =
Original file line number Diff line number Diff line change 6
6
"sync"
7
7
"time"
8
8
9
+ "github.com/bep/debounce"
9
10
"github.com/lucsky/cuid"
10
11
log "github.com/pion/ion-log"
11
12
"github.com/pion/rtcp"
@@ -300,7 +301,10 @@ func (p *WebRTCTransport) OnICECandidate(f func(c *webrtc.ICECandidate)) {
300
301
301
302
// OnNegotiationNeeded handler
302
303
func (p * WebRTCTransport ) OnNegotiationNeeded (f func ()) {
303
- p .pc .OnNegotiationNeeded (f )
304
+ debounced := debounce .New (100 * time .Millisecond )
305
+ p .pc .OnNegotiationNeeded (func () {
306
+ debounced (f )
307
+ })
304
308
}
305
309
306
310
// OnTrack handler
You can’t perform that action at this time.
0 commit comments