For my current project, I need to create a WebRTC connection between an iOS app and a Python server.
I am using WebRTC-lib to create a connection and the code compiles and run, but I have encountered various issues:
- Video streaming doesn't function properly. That Python side doesn't receive the video frames and just gets stuck when trying to receive the frame.
- The connection fails for an unknown reason. Sometimes I run the app and the connection is established successfully, but more often the connection fails even though nothing change on the app nor on the Python side.
Has anyone encountered those issues, or know how to solve them?
This is my current code:
self.webRTCClient = WebRTCClient(iceServers: Constants.Config.defaultIceServers)
self.webRTCClient.delegate = self
self.webRTCClient.offer { (localSDP) in
ServerManager.shared().offer(sdp: localSDP.sdp) { remoteSDP in
let temp = RTCSessionDescription(type: RTCSdpType(rawValue: 2)!, sdp: remoteSDP)
self.webRTCClient.set(remoteSdp: temp) { (error) in
let string = "..."
guard let dataToSend = string.data(using: .utf8) else {
return
}
self.webRTCClient.sendData(dataToSend)
}
}
}
Thanks