From e9fdd5d2fd20008693075b9e4464e5945b0cdd10 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Sat, 19 Dec 2020 16:18:58 -0800 Subject: [PATCH] ignore placeholder data channel --- pkg/rtc/participant.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 8234645cf..f1af7cf60 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -19,7 +19,8 @@ import ( ) const ( - sdBatchSize = 20 + placeholderDataChannel = "_private" + sdBatchSize = 20 ) type Participant struct { @@ -366,7 +367,10 @@ func (p *Participant) onMediaTrack(track *webrtc.TrackRemote, rtpReceiver *webrt } func (p *Participant) onDataChannel(dc *webrtc.DataChannel) { - logger.GetLogger().Debugw("dataChannel added", "participantId", p.ID(), "id", dc.ID()) + if dc.Label() == placeholderDataChannel { + return + } + logger.GetLogger().Debugw("dataChannel added", "participantId", p.ID(), "label", dc.Label()) dt := NewDataTrack(p.id, dc) p.lock.Lock()