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
+12 -8
View File
@@ -24,10 +24,12 @@ type MessageSource interface {
}
type ParticipantInit struct {
Identity string
Metadata string
Reconnect bool
Permission *livekit.ParticipantPermission
Identity string
Metadata string
Reconnect bool
Permission *livekit.ParticipantPermission
ProtocolVersion int32
UsePlanB bool
}
type NewParticipantCallback func(roomName string, pi ParticipantInit, requestSource MessageSource, responseSink MessageSink)
@@ -45,16 +47,18 @@ type Router interface {
GetNode(nodeId string) (*livekit.Node, error)
ListNodes() ([]*livekit.Node, error)
// participant signal connection is ready to start
// StartParticipantSignal participant signal connection is ready to start
StartParticipantSignal(roomName string, pi ParticipantInit) (connectionId string, reqSink MessageSink, resSource MessageSource, err error)
// sends a message to RTC node
// CreateRTCSink sends a message to RTC node
CreateRTCSink(roomName, identity string) (MessageSink, error)
// when a new participant's RTC connection is ready to start
// OnNewParticipantRTC is called to start a new participant's RTC connection
OnNewParticipantRTC(callback NewParticipantCallback)
// messages to be delivered to RTC node
// OnRTCMessage is called to execute actions on the RTC node
OnRTCMessage(callback RTCMessageCallback)
Start() error
Stop()
}