MCPcopy Index your code
hub / github.com/TensorWorks/Unreal-PixelStreaming-RTP-Bridge / sendLocalIceCandidate

Function sendLocalIceCandidate

main.go:261–274  ·  view source on GitHub ↗

Send our local ICE candidate to Unreal Engine using websockets.

(wsConn *websocket.Conn, localIceCandidate *webrtc.ICECandidate)

Source from the content-addressed store, hash-verified

259
260// Send our local ICE candidate to Unreal Engine using websockets.
261func sendLocalIceCandidate(wsConn *websocket.Conn, localIceCandidate *webrtc.ICECandidate) {
262 var iceCandidateInit webrtc.ICECandidateInit = localIceCandidate.ToJSON()
263 var respPayload ueICECandidateResp = ueICECandidateResp{Type: "iceCandidate", Candidate: iceCandidateInit}
264
265 jsonPayload, err := json.Marshal(respPayload)
266
267 if err != nil {
268 log.Printf("Error turning local ice candidate into JSON. Error: %s", err.Error())
269 }
270
271 jsonStr := string(jsonPayload)
272 writeWSMessage(wsConn, jsonStr)
273 fmt.Println(fmt.Sprintf("Sending our local ice candidate to UE...%s", jsonStr))
274}
275
276func createUDPConnection(address string, port int, payloadType uint8) (*udpConn, error) {
277

Callers 2

handleRemoteAnswerFunction · 0.85
mainFunction · 0.85

Calls 1

writeWSMessageFunction · 0.85

Tested by

no test coverage detected