mediamtx/internal/conf/webrtc_ice_server.go

23 lines
613 B
Go

package conf
import "encoding/json"
// WebRTCICEServer is a WebRTC ICE Server.
type WebRTCICEServer struct {
URL string `json:"url"`
Username string `json:"username"`
Password string `json:"password"`
ClientOnly bool `json:"clientOnly"`
}
// WebRTCICEServers is a list of WebRTCICEServer
type WebRTCICEServers []WebRTCICEServer
// UnmarshalJSON implements json.Unmarshaler.
func (s *WebRTCICEServers) UnmarshalJSON(b []byte) error {
// remove default value before loading new value
// https://github.com/golang/go/issues/21092
*s = nil
return json.Unmarshal(b, (*[]WebRTCICEServer)(s))
}