Disable UDPMux for WebRTC by default
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ func Init() {
|
|||||||
} `yaml:"webrtc"`
|
} `yaml:"webrtc"`
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.Mod.Listen = ":8555"
|
cfg.Mod.Listen = ":8555/tcp"
|
||||||
cfg.Mod.IceServers = []pion.ICEServer{
|
cfg.Mod.IceServers = []pion.ICEServer{
|
||||||
{URLs: []string{"stun:stun.l.google.com:19302"}},
|
{URLs: []string{"stun:stun.l.google.com:19302"}},
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-12
@@ -5,6 +5,7 @@ import (
|
|||||||
"github.com/pion/interceptor"
|
"github.com/pion/interceptor"
|
||||||
"github.com/pion/webrtc/v3"
|
"github.com/pion/webrtc/v3"
|
||||||
"net"
|
"net"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewAPI(address string) (*webrtc.API, error) {
|
func NewAPI(address string) (*webrtc.API, error) {
|
||||||
@@ -41,14 +42,18 @@ func NewAPI(address string) (*webrtc.API, error) {
|
|||||||
s.SetDTLSInsecureSkipHelloVerify(true)
|
s.SetDTLSInsecureSkipHelloVerify(true)
|
||||||
|
|
||||||
if address != "" {
|
if address != "" {
|
||||||
if ln, err := net.ListenPacket("udp", address); err == nil {
|
address, network, _ := strings.Cut(address, "/")
|
||||||
udpMux := webrtc.NewICEUDPMux(nil, ln)
|
if network == "" || network == "udp" {
|
||||||
s.SetICEUDPMux(udpMux)
|
if ln, err := net.ListenPacket("udp", address); err == nil {
|
||||||
|
udpMux := webrtc.NewICEUDPMux(nil, ln)
|
||||||
|
s.SetICEUDPMux(udpMux)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if network == "" || network == "tcp" {
|
||||||
if ln, err := net.Listen("tcp", address); err == nil {
|
if ln, err := net.Listen("tcp", address); err == nil {
|
||||||
tcpMux := webrtc.NewICETCPMux(nil, ln, 8)
|
tcpMux := webrtc.NewICETCPMux(nil, ln, 8)
|
||||||
s.SetICETCPMux(tcpMux)
|
s.SetICETCPMux(tcpMux)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +97,6 @@ func RegisterDefaultCodecs(m *webrtc.MediaEngine) error {
|
|||||||
{"nack", "pli"},
|
{"nack", "pli"},
|
||||||
}
|
}
|
||||||
for _, codec := range []webrtc.RTPCodecParameters{
|
for _, codec := range []webrtc.RTPCodecParameters{
|
||||||
// macOS Google Chrome 103.0.5060.134
|
|
||||||
{
|
{
|
||||||
RTPCodecCapability: webrtc.RTPCodecCapability{
|
RTPCodecCapability: webrtc.RTPCodecCapability{
|
||||||
MimeType: webrtc.MimeTypeH264,
|
MimeType: webrtc.MimeTypeH264,
|
||||||
@@ -100,7 +104,7 @@ func RegisterDefaultCodecs(m *webrtc.MediaEngine) error {
|
|||||||
SDPFmtpLine: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f",
|
SDPFmtpLine: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f",
|
||||||
RTCPFeedback: videoRTCPFeedback,
|
RTCPFeedback: videoRTCPFeedback,
|
||||||
},
|
},
|
||||||
PayloadType: 96, //102,
|
PayloadType: 96, // Chrome v110 - PayloadType: 102
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
RTPCodecCapability: webrtc.RTPCodecCapability{
|
RTPCodecCapability: webrtc.RTPCodecCapability{
|
||||||
@@ -109,15 +113,16 @@ func RegisterDefaultCodecs(m *webrtc.MediaEngine) error {
|
|||||||
SDPFmtpLine: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",
|
SDPFmtpLine: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",
|
||||||
RTCPFeedback: videoRTCPFeedback,
|
RTCPFeedback: videoRTCPFeedback,
|
||||||
},
|
},
|
||||||
PayloadType: 97, //125,
|
PayloadType: 97, // Chrome v110 - PayloadType: 106
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
RTPCodecCapability: webrtc.RTPCodecCapability{
|
RTPCodecCapability: webrtc.RTPCodecCapability{
|
||||||
MimeType: webrtc.MimeTypeH264,
|
MimeType: webrtc.MimeTypeH264,
|
||||||
ClockRate: 90000,
|
ClockRate: 90000,
|
||||||
SDPFmtpLine: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032",
|
SDPFmtpLine: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032",
|
||||||
RTCPFeedback: videoRTCPFeedback},
|
RTCPFeedback: videoRTCPFeedback,
|
||||||
PayloadType: 98, //123,
|
},
|
||||||
|
PayloadType: 98, // Chrome v110 - PayloadType: 112
|
||||||
},
|
},
|
||||||
// macOS Safari 15.1
|
// macOS Safari 15.1
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user