don't send black screen when Track be resumed (#352)

* don't send black screen when Track be resumed

* default flush
This commit is contained in:
cnderrauber
2022-01-19 18:14:38 +08:00
committed by GitHub
parent 5bea9debb7
commit 0acb0a9d66
6 changed files with 37 additions and 22 deletions
+2 -2
View File
@@ -249,7 +249,7 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, code
// RemoveSubscriber removes participant from subscription
// stop all forwarders to the client
func (t *MediaTrackSubscriptions) RemoveSubscriber(participantID livekit.ParticipantID) {
func (t *MediaTrackSubscriptions) RemoveSubscriber(participantID livekit.ParticipantID, resume bool) {
subTrack := t.getSubscribedTrack(participantID)
t.subscribedTracksMu.Lock()
@@ -257,7 +257,7 @@ func (t *MediaTrackSubscriptions) RemoveSubscriber(participantID livekit.Partici
t.subscribedTracksMu.Unlock()
if subTrack != nil {
subTrack.DownTrack().Close()
subTrack.DownTrack().CloseWithFlush(!resume)
}
t.maybeNotifyNoSubscribers()