feat: add webrtc h265 support

This commit is contained in:
langhuihui
2025-05-15 19:16:40 +08:00
parent ecc3947016
commit bcc7defa97
7 changed files with 116 additions and 240 deletions

View File

@@ -85,6 +85,10 @@ func (conf *WebRTCPlugin) servePlay(w http.ResponseWriter, r *http.Request) {
return
}
conn.SDP = string(bytes)
// Check if client supports H265
if strings.Contains(strings.ToLower(conn.SDP), "h265") {
conn.SupportsH265 = true
}
if conn.PeerConnection, err = conf.api.NewPeerConnection(Configuration{
ICEServers: conf.ICEServers,
}); err != nil {
@@ -93,7 +97,7 @@ func (conf *WebRTCPlugin) servePlay(w http.ResponseWriter, r *http.Request) {
if rawQuery != "" {
streamPath += "?" + rawQuery
}
if conn.Subscriber, err = conf.Subscribe(conn.Context, streamPath); err != nil {
if conn.Subscriber, err = conf.Subscribe(conf.Context, streamPath); err != nil {
return
}
conn.Subscriber.RemoteAddr = r.RemoteAddr