Hello, I am building an app that requires players joined to an online game session and to have a video chat with both of their front cameras turned on. I currently know that GameKit supports the voice chat option but could not find any source for video chat. Is it possible set up a video chat on an online game session?. What libraries can I use that have support in implementing the video chat (AVFoundation) ?
Your assistance is greatly appreciated.
Hello @Useraugenkunst,
First, I recommend that you file an enhancement request for GameKit to add a video chat API using Feedback Assistant.
Having said that, it is possible to implement this functionality, though it is quite complex, here is a brief outline of steps:
- You establish a connection between the two devices (there are several options for this, but probably using Network.framework)
- Each device captures a video stream (using AVCaptureSession)
- Each device compresses their respective video stream (using VTCompressionSession)
- Each device sends their compressed stream to the other device over the connection
- Each receiving device decompresses and presents the received stream