Fix a issue with Google Chrome

This commit is contained in:
Pierre HUBERT 2020-04-11 18:59:35 +02:00
parent ea73efb0b0
commit 3c69839fa8

View File

@ -255,7 +255,14 @@ func newCall(mainOffer receivedSignal, r activeRelay) {
}() }()
// Create a local track, all our SFU clients will be fed via this track // 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 { if newTrackErr != nil {
log.Println("New track error!", err) log.Println("New track error!", err)
askForClose(r) askForClose(r)