Skip to content

Commit ba18966

Browse files
update starter docs
1 parent 6133cc0 commit ba18966

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

Assets/SimpleWebRTC/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SimpleWebRTC is a Unity-based WebRTC wrapper that facilitates peer-to-peer audio
1010
- Data channel communication
1111
- Logging and debugging tools
1212
- Usage with Photon Fusion 2
13+
- Usage with [SimpleWebRTC Web Client](https://github.com/FireDragonGameStudio/SimpleWebRTC-Web)
1314

1415
## Tutorial video
1516
A tutorial YouTube video can be found here: [https://www.youtube.com/watch?v=-CwJTgt_Z3M](https://www.youtube.com/watch?v=-CwJTgt_Z3M)
@@ -35,7 +36,7 @@ A tutorial YouTube video can be found here: [https://www.youtube.com/watch?v=-Cw
3536
## Manual Installation
3637
1. Clone the repository:
3738
```sh
38-
git clone https://github.com/yourusername/simplewebrtc.git
39+
git clone https://github.com/firedragongamestudio/simplewebrtc.git
3940
```
4041
2. Open the Unity project in the Unity Editor.
4142
3. Ensure that the required dependencies (such as `TextMeshPro`, `Unity WebRTC` and `NativeWebSocket`) are installed.
@@ -52,6 +53,15 @@ The `WebRTCConnection` component manages the WebRTC connection and can be attach
5253
3. Use the `_Generic` scripts and `PhotonSignalServer` to setup the WebRTC connection.
5354
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)
5455

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+
5565
### Public Properties
5666
| Property | Type | Description |
5767
|----------|------|-------------|

Assets/SimpleWebRTC/Runtime/Starter-Documentation.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
![simple-webrtc-logo](https://github.com/user-attachments/assets/4a243ff7-8260-4277-8d7a-844f67ffdcff)
2+
13
# SimpleWebRTC
24
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.
35

@@ -8,6 +10,7 @@ SimpleWebRTC is a Unity-based WebRTC wrapper that facilitates peer-to-peer audio
810
- Data channel communication
911
- Logging and debugging tools
1012
- Usage with Photon Fusion 2
13+
- Usage with [SimpleWebRTC Web Client](https://github.com/FireDragonGameStudio/SimpleWebRTC-Web)
1114

1215
## Tutorial video
1316
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
2225
2. Make sure, that the required dependencies are installed (`TextMeshPro`, `Unity WebRTC`, `NativeWebSocket`).
2326
3. Import the package into your Unity project.
2427

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
35+
2536
## Manual Installation
2637
1. Clone the repository:
2738
```sh
28-
git clone https://github.com/yourusername/simplewebrtc.git
39+
git clone https://github.com/firedragongamestudio/simplewebrtc.git
2940
```
3041
2. Open the Unity project in the Unity Editor.
3142
3. Ensure that the required dependencies (such as `TextMeshPro`, `Unity WebRTC` and `NativeWebSocket`) are installed.
@@ -34,12 +45,23 @@ A tutorial YouTube video can be found here: [https://www.youtube.com/watch?v=-Cw
3445
### WebRTCConnection Component
3546
The `WebRTCConnection` component manages the WebRTC connection and can be attached to a GameObject in Unity.
3647

48+
![image](https://github.com/user-attachments/assets/e13c49e9-c9dc-4a5c-9200-94efd4800b1c)
49+
3750
### Photon Fusion 2 Integration
3851
1. Install Photon Fusion 2 from Unity AssetStore -> [Photon Fusion 2](https://assetstore.unity.com/packages/tools/network/photon-fusion-267958)
3952
2. Import the Photon Fusion sample scene via Unity Package Manager.
4053
3. Use the `_Generic` scripts and `PhotonSignalServer` to setup the WebRTC connection.
4154
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)
4255

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+
4365
### Public Properties
4466
| Property | Type | Description |
4567
|----------|------|-------------|
@@ -91,6 +113,7 @@ Following sample scenes are included in the pacakge:
91113
* *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.
92114
* *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#.
93115
* *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.
94117

95118
## Example code
96119
```csharp

Packages/packages-lock.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
},
1717
"url": "https://packages.unity.com"
1818
},
19+
"com.unity.asset-store-tools": {
20+
"version": "file:com.unity.asset-store-tools",
21+
"depth": 0,
22+
"source": "embedded",
23+
"dependencies": {
24+
"com.unity.nuget.newtonsoft-json": "3.2.1"
25+
}
26+
},
1927
"com.unity.burst": {
2028
"version": "1.8.21",
2129
"depth": 2,
@@ -107,6 +115,13 @@
107115
"dependencies": {},
108116
"url": "https://packages.unity.com"
109117
},
118+
"com.unity.nuget.newtonsoft-json": {
119+
"version": "3.2.1",
120+
"depth": 1,
121+
"source": "registry",
122+
"dependencies": {},
123+
"url": "https://packages.unity.com"
124+
},
110125
"com.unity.render-pipelines.core": {
111126
"version": "17.1.0",
112127
"depth": 1,

0 commit comments

Comments
 (0)