diff --git a/relay.go b/relay.go index 5b901bc..56a6389 100644 --- a/relay.go +++ b/relay.go @@ -255,7 +255,14 @@ func newCall(mainOffer receivedSignal, r activeRelay) { }() // Create a local track, all our SFU clients will be fed via this track - localTrack, newTrackErr := mainPeerConnection.NewTrack(remoteTrack.PayloadType(), remoteTrack.SSRC(), remoteTrack.ID(), remoteTrack.Label()) + trackID := "audio" + trackLabel := "pion" // We need only one track label + if remoteTrack.Kind() == webrtc.RTPCodecTypeVideo { + trackID = "video" // We need two different track ids + } + + localTrack, newTrackErr := mainPeerConnection.NewTrack(remoteTrack.PayloadType(), remoteTrack.SSRC(), trackID, trackLabel) + if newTrackErr != nil { log.Println("New track error!", err) askForClose(r)