server to support mutes

This commit is contained in:
David Zhao
2020-12-31 14:21:19 -08:00
parent be6086ce95
commit 313236e3d3
11 changed files with 231 additions and 150 deletions
+6 -1
View File
@@ -15,7 +15,7 @@ const (
)
// DataTrack wraps a WebRTC DataChannel to satisfy the PublishedTrack interface
// it shall forward tracks to all of its subscribers
// it shall forward publishedTracks to all of its subscribers
type DataTrack struct {
id string
participantId string
@@ -65,6 +65,11 @@ func (t *DataTrack) StreamID() string {
return t.dataChannel.Label()
}
// DataTrack cannot be muted
func (t *DataTrack) IsMuted() bool {
return false
}
func (t *DataTrack) AddSubscriber(participant Participant) error {
label := PackDataTrackLabel(t.participantId, t.ID(), t.dataChannel.Label())
downChannel, err := participant.PeerConnection().CreateDataChannel(label, t.dataChannelOptions())