This example is based on the Roll-a-Ball tutorial. It adds the ability to receive the output from the Unity game player camera as a WebRTC video stream.
The screenshots below shows the game running in both the Unity Editor and as a standalone executable. The camera stream from the Unity game is displayed in a Windows Form or Web Browser after it has been transported over a WebRTC connection.
In this example both the source and viewer programs are on the same machine but the point of using WebRTC is that the two programs could be anywhere on the Internet and still able to communicate.
-
Start node-dss with
npm start, -
Run the Roller Ball game by pressing the
Playbutton in the Unity Editor or by building and runningRollerBall.exe. The C# script in the Unity game should post an SDP offer to thenode-dssserver, -
Open the
webrtc-viewer.htmlin a browser that can reach thenode-dssserver and clickStart. The browser will connect to thenode-dssserver, establish a WebRTC peer connection with the Unity game and then display the video stream from the duplicate player camera.
-
Start node-dss with
npm start, -
Run the Roller Ball game by pressing the
Playbutton in the Unity Editor or by building and runningRollerBall.exe. The C# script in the Unity game should post an SDP offer to thenode-dssserver, -
Execute the WebRTCClient program. It will connect to the
node-dssserver, establish a WebRTC peer connection with the Unity game and then display the video stream from the duplicate player camera.

