You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SimpleWebRTC is a Unity-based WebRTC wrapper that facilitates peer-to-peer audio, video, and data communication over WebRTC using Unitys WebRTC package [https://docs.unity3d.com/Packages/[email protected]/manual/index.html](https://docs.unity3d.com/Packages/[email protected]/manual/index.html). It leverages NativeWebSocket [https://github.com/endel/NativeWebSocket](https://github.com/endel/NativeWebSocket) for signaling and supports both video and audio streaming.
3
5
@@ -8,6 +10,7 @@ SimpleWebRTC is a Unity-based WebRTC wrapper that facilitates peer-to-peer audio
8
10
- Data channel communication
9
11
- Logging and debugging tools
10
12
- Usage with Photon Fusion 2
13
+
- Usage with [SimpleWebRTC Web Client](https://github.com/FireDragonGameStudio/SimpleWebRTC-Web)
11
14
12
15
## Tutorial video
13
16
A tutorial YouTube video can be found here: [https://www.youtube.com/watch?v=-CwJTgt_Z3M](https://www.youtube.com/watch?v=-CwJTgt_Z3M)
@@ -22,10 +25,18 @@ A tutorial YouTube video can be found here: [https://www.youtube.com/watch?v=-Cw
22
25
2. Make sure, that the required dependencies are installed (`TextMeshPro`, `Unity WebRTC`, `NativeWebSocket`).
23
26
3. Import the package into your Unity project.
24
27
28
+
## Installation using Unity Package Manager
29
+
1. Create a new Unity project
30
+
2. Open the Package Manager, click on the + sign in the upper left/right corner
31
+
3. Select "Add package from git URL"
32
+
4. Enter URL: `https://github.com/endel/NativeWebSocket.git#upm` and click in Install
33
+
5. After the installation finished, click on the + sign in the upper left/right corner again
34
+
6. Enter URL `https://github.com/FireDragonGameStudio/SimpleWebRTC.git?path=/Assets/SimpleWebRTC` and click on Install
2. Import the Photon Fusion sample scene via Unity Package Manager.
40
53
3. Use the `_Generic` scripts and `PhotonSignalServer` to setup the WebRTC connection.
41
54
4. A tutorial/explanation YouTube video can be found here: [https://www.youtube.com/watch?v=z1F_cqfdU6o](https://www.youtube.com/watch?v=z1F_cqfdU6o)
42
55
56
+
### WebRTC Web Client
57
+
1. Make sure your WebSocket signaling server is reachable, up and running.
58
+
2. Checkout the [SimpleWebRTC Web Client](https://github.com/FireDragonGameStudio/SimpleWebRTC-Web)
59
+
3. Run `npm install` in the web client directory, to get everything ready
60
+
4. Start the web client either locally (`npm run dev` or `npx vite`) or deploy it to a webspace
61
+
5. (Optional) Start your Unity application and make sure the WebRTC logic is up and running.
62
+
6. Connect all clients to your WebSocket signaling server and wait until the signaling procedure is completed.
63
+
7. Stream your video, audio and/or data to every connected client.
64
+
43
65
### Public Properties
44
66
| Property | Type | Description |
45
67
|----------|------|-------------|
@@ -91,6 +113,7 @@ Following sample scenes are included in the pacakge:
91
113
* *WebRTC-SingleClient-STUNConnection*: Testing STUN connection for a single client. Works standalone and can be deployed to clients. Make sure to set the `LocalPeerId` for each client individually.
92
114
* *WebRTC-SingleClient-wLobby-STUNConnection*: A simple Lobby example for handling multiple STUN WebRTC clients. `SimpleLobbyManager.cs` shows an example, how to use **SimpleWebRTC** via C#.
93
115
* *WebRTC-MultipleClients-STUNConnection*: Shows how multiple clients can be connected via peer-to-peer connections and share data, video and audio transmissions.
116
+
* *WebRTC-SingleClient-STUNConnection-PhotonFusion*: Testing STUN connection for a single client using Photon Fusion 2 as signaling server. Works standalone and can be deployed to clients. Make sure to set the `LocalPeerId` for each client individually.
0 commit comments