Use constants (#875)

This commit is contained in:
Raja Subramanian
2022-08-06 00:15:00 +05:30
committed by GitHub
parent ab4d57ab5b
commit 4703e30047
2 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -695,7 +695,7 @@ func (t *PCTransport) filterCandidates(sd webrtc.SessionDescription) webrtc.Sess
filterAttributes := func(attrs []sdp.Attribute) []sdp.Attribute {
filteredAttrs := make([]sdp.Attribute, 0, len(attrs))
for _, a := range attrs {
if a.Key == "candidate" {
if a.Key == sdp.AttrKeyCandidate {
if t.preferTCP {
if strings.Contains(a.Value, "tcp") {
filteredAttrs = append(filteredAttrs, a)
@@ -729,7 +729,7 @@ func (t *PCTransport) filterCandidates(sd webrtc.SessionDescription) webrtc.Sess
func getMidValue(media *sdp.MediaDescription) string {
for _, attr := range media.Attributes {
if attr.Key == "mid" {
if attr.Key == sdp.AttrKeyMID {
return attr.Value
}
}