Do not send hidden participants after resume (#1689)
This commit is contained in:
@@ -8,7 +8,8 @@
|
|||||||
|
|
||||||
# LiveKit: Real-time video, audio and data for developers
|
# LiveKit: Real-time video, audio and data for developers
|
||||||
|
|
||||||
[LiveKit](https://livekit.io) is an open source project that provides scalable, multi-user conferencing based on WebRTC. It's designed to provide everything you need to build real-time video audio data capabilities in your applications.
|
[LiveKit](https://livekit.io) is an open source project that provides scalable, multi-user conferencing based on WebRTC.
|
||||||
|
It's designed to provide everything you need to build real-time video audio data capabilities in your applications.
|
||||||
|
|
||||||
LiveKit's server is written in Go, using the awesome [Pion WebRTC](https://github.com/pion/webrtc) implementation.
|
LiveKit's server is written in Go, using the awesome [Pion WebRTC](https://github.com/pion/webrtc) implementation.
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ https://docs.livekit.io
|
|||||||
|
|
||||||
## Live Demos
|
## Live Demos
|
||||||
|
|
||||||
- [LiveKit Meet](https://meet.livekit.io) ([source](https://github.com/livekit/meet))
|
- [LiveKit Meet](https://meet.livekit.io) ([source](https://github.com/livekit-examples/meet))
|
||||||
- [Spatial Audio](https://spatial-audio-demo.livekit.io/) ([source](https://github.com/livekit-examples/spatial-audio))
|
- [Spatial Audio](https://spatial-audio-demo.livekit.io/) ([source](https://github.com/livekit-examples/spatial-audio))
|
||||||
- Livestreaming from OBS Studio ([source](https://github.com/livekit-examples/livestream))
|
- Livestreaming from OBS Studio ([source](https://github.com/livekit-examples/livestream))
|
||||||
|
|
||||||
|
|||||||
+14
-1
@@ -412,7 +412,8 @@ func (r *Room) ResumeParticipant(p types.LocalParticipant, requestSource routing
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
updates := ToProtoParticipants(r.GetParticipants())
|
// include the local participant's info as well, since metadata could have been changed
|
||||||
|
updates := r.getOtherParticipantInfo("")
|
||||||
if err := p.SendParticipantUpdate(updates); err != nil {
|
if err := p.SendParticipantUpdate(updates); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -730,6 +731,18 @@ func (r *Room) SimulateScenario(participant types.LocalParticipant, simulateScen
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Room) getOtherParticipantInfo(identity livekit.ParticipantIdentity) []*livekit.ParticipantInfo {
|
||||||
|
participants := r.GetParticipants()
|
||||||
|
pi := make([]*livekit.ParticipantInfo, 0, len(participants))
|
||||||
|
for _, p := range participants {
|
||||||
|
if !p.Hidden() && p.Identity() != identity {
|
||||||
|
pi = append(pi, p.ToProto())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pi
|
||||||
|
}
|
||||||
|
|
||||||
// checks if participant should be autosubscribed to new tracks, assumes lock is already acquired
|
// checks if participant should be autosubscribed to new tracks, assumes lock is already acquired
|
||||||
func (r *Room) autoSubscribe(participant types.LocalParticipant) bool {
|
func (r *Room) autoSubscribe(participant types.LocalParticipant) bool {
|
||||||
opts := r.participantOpts[participant.Identity()]
|
opts := r.participantOpts[participant.Identity()]
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import (
|
|||||||
|
|
||||||
"github.com/livekit/protocol/livekit"
|
"github.com/livekit/protocol/livekit"
|
||||||
"github.com/livekit/protocol/logger"
|
"github.com/livekit/protocol/logger"
|
||||||
|
|
||||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -45,14 +43,6 @@ func UnpackDataTrackLabel(packed string) (participantID livekit.ParticipantID, t
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func ToProtoParticipants(participants []types.LocalParticipant) []*livekit.ParticipantInfo {
|
|
||||||
infos := make([]*livekit.ParticipantInfo, 0, len(participants))
|
|
||||||
for _, op := range participants {
|
|
||||||
infos = append(infos, op.ToProto())
|
|
||||||
}
|
|
||||||
return infos
|
|
||||||
}
|
|
||||||
|
|
||||||
func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription {
|
func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription {
|
||||||
return &livekit.SessionDescription{
|
return &livekit.SessionDescription{
|
||||||
Type: sd.Type.String(),
|
Type: sd.Type.String(),
|
||||||
|
|||||||
Reference in New Issue
Block a user