From 3c69839fa8cad7f0e5c70aff2d88385aa87fed1d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 11 Apr 2020 18:59:35 +0200 Subject: [PATCH] Fix a issue with Google Chrome --- relay.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)