Add a flag to signal need to close underlying media track. (#1038)
With migration in, once the local track is published, the remote track should be closed. Add a flag to `RemovePublishedTrack` to control the close behaviour. Invoke `Close` if specified. Without, the remote track is not closed if it is waiting to resolve, i. e. not yet attached. That remote track is left hanging.
This commit is contained in:
@@ -308,7 +308,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, false)
|
||||
p.RemovePublishedTrack(track, false, false)
|
||||
if p.ProtocolVersion().SupportsUnpublish() {
|
||||
p.sendTrackUnpublished(track.ID())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user