Manual negotiation and plan-b support

This commit is contained in:
David Zhao
2021-04-16 00:56:25 -07:00
parent 04f6b61ae1
commit 93d10b2640
16 changed files with 231 additions and 64 deletions
+3 -3
View File
@@ -68,7 +68,7 @@ func NewPCTransport(target livekit.SignalTarget, conf *WebRTCConfig) (*PCTranspo
debouncedNegotiate: debounce.New(negotiationFrequency),
}
t.negotiationState.Store(negotiationStateNone)
t.pc.OnNegotiationNeeded(t.negotiate)
//t.pc.OnNegotiationNeeded(t.Negotiate)
return t, nil
}
@@ -111,7 +111,7 @@ func (t *PCTransport) SetRemoteDescription(sd webrtc.SessionDescription) error {
t.negotiationState.Store(negotiationStateNone)
if state == negotiationRetry {
// need to Negotiate again
t.negotiate()
t.Negotiate()
}
return nil
@@ -122,7 +122,7 @@ func (t *PCTransport) OnOffer(f func(sd webrtc.SessionDescription)) {
t.onOffer = f
}
func (t *PCTransport) negotiate() {
func (t *PCTransport) Negotiate() {
t.debouncedNegotiate(t.handleNegotiate)
}