mirror of
https://github.com/livekit/livekit.git
synced 2026-10-22 21:53:22 +00:00
Manual negotiation and plan-b support
This commit is contained in:
1 parent
04f6b61ae1
commit
93d10b2640
16 files changed
+231
-64
No files matched your search
@@ -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()
|
||||
}
|
||||
|
||||
@@ -153,9 +153,11 @@ func (r *RedisRouter) StartParticipantSignal(roomName string, pi ParticipantInit
|
||||
Identity: pi.Identity,
|
||||
Metadata: pi.Metadata,
|
||||
// connection id is to allow the RTC node to identify where to route the message back to
|
||||
ConnectionId: connectionId,
|
||||
Reconnect: pi.Reconnect,
|
||||
Permission: pi.Permission,
|
||||
ConnectionId: connectionId,
|
||||
Reconnect: pi.Reconnect,
|
||||
Permission: pi.Permission,
|
||||
ProtocolVersion: pi.ProtocolVersion,
|
||||
UsePlanB: pi.UsePlanB,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
@@ -217,10 +219,12 @@ func (r *RedisRouter) startParticipantRTC(ss *livekit.StartSession, participantK
|
||||
}
|
||||
|
||||
pi := ParticipantInit{
|
||||
Identity: ss.Identity,
|
||||
Metadata: ss.Metadata,
|
||||
Reconnect: ss.Reconnect,
|
||||
Permission: ss.Permission,
|
||||
Identity: ss.Identity,
|
||||
Metadata: ss.Metadata,
|
||||
Reconnect: ss.Reconnect,
|
||||
Permission: ss.Permission,
|
||||
ProtocolVersion: ss.ProtocolVersion,
|
||||
UsePlanB: ss.UsePlanB,
|
||||
}
|
||||
|
||||
reqChan := r.getOrCreateMessageChannel(r.requestChannels, participantKey)
|
||||
|
||||
Reference in new issue
Block a user