- Xcode 12.1 or later
- iOS 12 or later
- Node.js + npm (For NodeJS Signaling server)
- OR -
macOS 10.15 (For Swift signaling server)
- Start the signaling server (Either NodeJS or Swift)
- Navigate to
WebRTC-Demo-appfolder - Open
WebRTC-Demo.xcworkspace - Open
Config.swiftand set thedefaultSignalingServerUrlvariable to your signaling server ip/host. Don't uselocalhostor127.0.0.1if you plan to connect other devices in your network to your mac. - Build and run on devices or on a simulator (video capture is not supported on a simulator).
1. Navigate to the `signaling/NodeJS` folder.
2. Run `npm install` to install all dependencies.
3. Run `node app.js` to start the server.
Note: This step requires MacOS 10.15
1. Navigate to the `signaling/Swift` folder.
2. Run `make`
3. Run `./server` to start the server
- Run the app on two physical devices (Or one physical device and one simulator) with the signaling server running.
- Make sure both of the devices are connected to the signaling server.
- On the first device, click on 'Send offer' - this will generate a local offer SDP and send it to the other client using the signaling server. If you're using a simulator as one of the peers - click on 'Send offer' on the simulator.
- Wait until the second device receives the offer from the first device (you should see that a remote SDP has arrived).
- Click on 'Send answer' on the second device.
- when the answer arrives to the first device, both of the devices should be now connected to each other using webRTC, try to talk or click on the 'video' button to start capturing video.
- There's a bug in the code. Video stream from the camera should work from the physical device to the simulator or to a physical device (simulator should not send video stream in our case), but due to a bug, the video stream is not working. Find the bug and fix it. You should make the stream from the iphone's camera sent to the device of the simulator (or the other pysical device).
- Create a new button named "touch" that will:
- Open a new white and empty screen
- Capture the user's touch on that screen (x and y coordinates only)
- Coordinates will be sent to the other peer using a data channel from webrtc protocol
- Only if the other peer will press on the "touch" button on his phone, that will open the white screen, a small red circle will be drawn on the screen every time it gets a new x,y coordinates. The circle will be with a fixed size such that the center of the circle is x,y
- Of course, both peers will be able to touch their screens and see the touchs of the other peer
- If you're using a simulator as one of the peers - it is not mandatory to support touch events from the simulator. only from the pysical device.