allow user to mute before track is fully published (#82)
fixes https://github.com/livekit/client-sdk-js/issues/28
This commit is contained in:
@@ -182,7 +182,6 @@ func (t *MediaTrack) AddSubscriber(sub types.Participant) error {
|
||||
downTrack.SetTransceiver(transceiver)
|
||||
// when outtrack is bound, start loop to send reports
|
||||
downTrack.OnBind(func() {
|
||||
subTrack.SetPublisherMuted(t.IsMuted())
|
||||
go t.sendDownTrackBindingReports(sub)
|
||||
})
|
||||
|
||||
@@ -227,6 +226,7 @@ func (t *MediaTrack) AddSubscriber(sub types.Participant) error {
|
||||
})
|
||||
|
||||
t.subscribedTracks[sub.ID()] = subTrack
|
||||
subTrack.SetPublisherMuted(t.IsMuted())
|
||||
|
||||
t.receiver.AddDownTrack(downTrack, t.shouldStartWithBestQuality())
|
||||
// since sub will lock, run it in a goroutine to avoid deadlocks
|
||||
|
||||
Reference in New Issue
Block a user