File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
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 // indirect
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 @@ -2,9 +2,10 @@ package sfu
2
2
3
3
import (
4
4
"sync"
5
+ "time"
5
6
7
+ "github.com/bep/debounce"
6
8
"github.com/gammazero/deque"
7
-
8
9
"github.com/lucsky/cuid"
9
10
log "github.com/pion/ion-log"
10
11
"github.com/pion/sdp/v3"
@@ -219,7 +220,10 @@ func (p *WebRTCTransport) OnICECandidate(f func(c *webrtc.ICECandidate)) {
219
220
220
221
// OnNegotiationNeeded handler
221
222
func (p * WebRTCTransport ) OnNegotiationNeeded (f func ()) {
222
- p .negotiate = f
223
+ debounced := debounce .New (100 * time .Millisecond )
224
+ p .negotiate = func () {
225
+ debounced (f )
226
+ }
223
227
}
224
228
225
229
// OnTrack handler
You can’t perform that action at this time.
0 commit comments