track published response, to allow client to assign sid to published tracks

This commit is contained in:
David Zhao
2020-12-17 21:48:48 -08:00
parent 2665026830
commit 2111513fde
3 changed files with 69 additions and 38 deletions
+7
View File
@@ -368,6 +368,13 @@ func (p *Participant) onTrack(track *webrtc.TrackRemote, rtpReceiver *webrtc.RTP
p.lock.Unlock()
pt.Start()
// confirm publication
p.sigConn.WriteResponse(&livekit.SignalResponse{
Message: &livekit.SignalResponse_TrackPublished{
TrackPublished: pt.ToProto(),
},
})
if p.OnParticipantTrack != nil {
// caller should hook up what happens when the peer remoteTrack is available
go p.OnParticipantTrack(p, pt)