Send an "offer" string over websocket to Unreal Engine to start the WebRTC handshake.
(wsConn *websocket.Conn, peerConnection *webrtc.PeerConnection)
| 244 | |
| 245 | // Send an "offer" string over websocket to Unreal Engine to start the WebRTC handshake. |
| 246 | func sendOffer(wsConn *websocket.Conn, peerConnection *webrtc.PeerConnection) { |
| 247 | |
| 248 | offerString, err := createOffer(peerConnection) |
| 249 | |
| 250 | if err != nil { |
| 251 | log.Printf("Error creating offer. Error: %s", err.Error()) |
| 252 | } else { |
| 253 | // Write our offer over websocket: "{"type":"offer","sdp":"v=0\r\no=- 2927396662845926191 2 IN IP4 127.0.0.1....." |
| 254 | writeWSMessage(wsConn, offerString) |
| 255 | fmt.Println("Sending offer...") |
| 256 | fmt.Println(offerString) |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | // Send our local ICE candidate to Unreal Engine using websockets. |
| 261 | func sendLocalIceCandidate(wsConn *websocket.Conn, localIceCandidate *webrtc.ICECandidate) { |
no test coverage detected