Pass willBeResumed into RemovePublishedTrack (#789)
This commit is contained in:
@@ -410,7 +410,7 @@ func (p *ParticipantImpl) SetPermission(permission *livekit.ParticipantPermissio
|
||||
// publish permission has been revoked then remove all published tracks
|
||||
if !canPublish {
|
||||
for _, track := range p.GetPublishedTracks() {
|
||||
p.RemovePublishedTrack(track)
|
||||
p.RemovePublishedTrack(track, false)
|
||||
if p.ProtocolVersion().SupportsUnpublish() {
|
||||
p.sendTrackUnpublished(track.ID())
|
||||
} else {
|
||||
|
||||
@@ -86,7 +86,7 @@ func HandleParticipantSignal(room types.Room, participant types.LocalParticipant
|
||||
case *livekit.SignalRequest_SyncState:
|
||||
err := room.SyncState(participant, msg.SyncState)
|
||||
if err != nil {
|
||||
pLogger.Warnw("could not sync subscribe state", err,
|
||||
pLogger.Warnw("could not sync state", err,
|
||||
"state", msg.SyncState)
|
||||
}
|
||||
case *livekit.SignalRequest_Simulate:
|
||||
|
||||
@@ -141,10 +141,10 @@ func (u *UpTrackManager) AddSubscriber(sub types.LocalParticipant, params types.
|
||||
return n, nil
|
||||
}
|
||||
|
||||
func (u *UpTrackManager) RemoveSubscriber(sub types.LocalParticipant, trackID livekit.TrackID, resume bool) {
|
||||
func (u *UpTrackManager) RemoveSubscriber(sub types.LocalParticipant, trackID livekit.TrackID, willBeResumed bool) {
|
||||
track := u.GetPublishedTrack(trackID)
|
||||
if track != nil {
|
||||
track.RemoveSubscriber(sub.ID(), resume)
|
||||
track.RemoveSubscriber(sub.ID(), willBeResumed)
|
||||
}
|
||||
|
||||
u.lock.Lock()
|
||||
@@ -296,8 +296,8 @@ func (u *UpTrackManager) AddPublishedTrack(track types.MediaTrack) {
|
||||
})
|
||||
}
|
||||
|
||||
func (u *UpTrackManager) RemovePublishedTrack(track types.MediaTrack) {
|
||||
track.RemoveAllSubscribers(false)
|
||||
func (u *UpTrackManager) RemovePublishedTrack(track types.MediaTrack, willBeResumed bool) {
|
||||
track.RemoveAllSubscribers(willBeResumed)
|
||||
u.lock.Lock()
|
||||
delete(u.publishedTracks, track.ID())
|
||||
u.lock.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user