return error when moving egree/agent participant (#3741)

This commit is contained in:
cnderrauber
2025-06-18 15:10:08 +08:00
committed by GitHub
parent 7542cf0723
commit e754a86068
3 changed files with 25 additions and 13 deletions
+14 -2
View File
@@ -73,6 +73,10 @@ const (
PingTimeoutSeconds = 15
)
var (
ErrMoveOldClientVersion = errors.New("participant client version does not support moving")
)
// -------------------------------------------------
type pendingTrackInfo struct {
@@ -3591,8 +3595,16 @@ func (p *ParticipantImpl) SupportsCodecChange() bool {
return p.params.ClientInfo.SupportsCodecChange()
}
func (p *ParticipantImpl) SupportsMoving() bool {
return p.ProtocolVersion().SupportsMoving()
func (p *ParticipantImpl) SupportsMoving() error {
if !p.ProtocolVersion().SupportsMoving() {
return ErrMoveOldClientVersion
}
if kind := p.Kind(); kind == livekit.ParticipantInfo_EGRESS || kind == livekit.ParticipantInfo_AGENT {
return fmt.Errorf("%s participants cannot be moved", kind.String())
}
return nil
}
func (p *ParticipantImpl) MoveToRoom(params types.MoveToRoomParams) {