move TrackSubscribed trigger to MediaSubscription (#2916)

This commit is contained in:
cnderrauber
2024-08-07 22:30:52 +08:00
committed by GitHub
parent 2346c8a6b7
commit a8730b04b8
6 changed files with 70 additions and 22 deletions
+6
View File
@@ -161,6 +161,12 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
AdaptiveStream: sub.GetAdaptiveStream(),
})
subTrack.AddOnBind(func(err error) {
if err == nil {
t.params.MediaTrack.OnTrackSubscribed()
}
})
// Bind callback can happen from replaceTrack, so set it up early
var reusingTransceiver atomic.Bool
var dtState sfu.DownTrackState