Remove un-preferred codecs for android firefox (#2183)

* Remove un-preferred codecs for android firefox

Android firefox don't comply with the codec order in answer sdp and
has problem to publish h.264, remove other codecs to fix this.

* false(false) is true
This commit is contained in:
cnderrauber
2023-10-25 16:59:37 +08:00
committed by GitHub
parent 48dba9d589
commit 0296a5bd86
2 changed files with 12 additions and 1 deletions
+4 -1
View File
@@ -180,7 +180,10 @@ func (p *ParticipantImpl) setCodecPreferencesVideoForPublisher(offer webrtc.Sess
}
unmatchVideo.MediaName.Formats = append(unmatchVideo.MediaName.Formats[:0], preferredCodecs...)
unmatchVideo.MediaName.Formats = append(unmatchVideo.MediaName.Formats, leftCodecs...)
// if the client don't comply with codec order in SDP answer, only keep preferred codecs to force client to use it
if p.params.ClientInfo.ComplyWithCodecOrderInSDPAnswer() {
unmatchVideo.MediaName.Formats = append(unmatchVideo.MediaName.Formats, leftCodecs...)
}
}
}