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