• Stars
    star
    108
  • Rank 319,991 (Top 7 %)
  • Language
    C#
  • Created over 5 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cross-platform Webrtc support for Unity apps ☁🎲

Webrtc Unity Plugin

🚨 You probably want Microsoft/MixedReality-WebRTC instead! 🚨

plugin logo

Cross-platform Webrtc support for Unity apps 🎲

Why

We needed a cross-platform webrtc solution for Unity, based on webrtc's unityplugin example that supports win32, and winuwp (theoretically linux and mac are supported as well, but untested). The magic of this repository is threefold:

  1. We support a winuwp (hololens compatible) binary
  2. We include a sample signalling implementation
  3. We provide a working end-to-end example

How to use

Officially supports Unity 2017.4.x (LTS) and Unity 2018.3.x

Webrtc Basic Signal Example

The basic signal example (WebrtcBasicSignalExample.unity) is designed to quickly demonstrate what managed code we'd need to write to configure a peer instance using a service to exchange sdp information (handshake) and ice candidates (NAT traversal).

To use it, one needs to set up a few dependencies:

  • Clone, setup, and run an instance of node-dss (instructions at link).
  • Modify the WebrtcSignalControls script via the inspector, on the WebrtcSignalControls object to point at your node-dss server url.

screenshot showing modifying the server url

Once the server is running and Unity is configured, both clients should be able to exchange information by device id. The device id is displayed across the top left of the screen, and should be typed into the remote peers input field.

For instance, to connect Peer A (device id: 1) with Peer B (device id: 2) the targetId input field for Peer A should have the value 2. For Peer B, it should have the value 1. A connection can not succeed unless both peers have the input field populated.

Once the targetId field is filled on both peers, either peer can begin the connection by clicking the offerButton.

At this point, sdp messages (handshake data) and ice candidates (NAT traversal data) should be sent via the server, and the clients should be able to connect successfully.

Reference Docs

To better understand the API space of this solution, take a look at the hosted API docs.

For more information, check out the brief overview video.

Running

In editor, Win32 is supported - this means if you're on Windows and you hit "Play" in the Unity Editor, your application should just work. For other platforms, one must produce a Unity Player build in order to fully test.

example v01

Contributing

No contributing guidelines at this time. However, to produce a new unitypackage when a new Release is needed, one must use Unity and select these fields:

producing a unitypackage

License

MIT

More Repositories

1

browserd

Headless electron app platform for the cloud 🤕☁✨
TypeScript
66
star
2

node-dss

dead simple signalling for webrtc.
JavaScript
57
star
3

overlayed

stream overlays that broadcasters can see 🎬🔴
TypeScript
28
star
4

vscode-node-readme

A vscode extension to view javascript module documentation in editor.
TypeScript
20
star
5

webrtc-signal-http

opinionated webrtc signal provider using http as a protocol
TypeScript
19
star
6

docker-xvfb

Dockerfiles for running headless x11 apps 📦🤕✨
Dockerfile
18
star
7

unity-fucking-singletons

A framework of patterns for avoiding antipatterns in Unity
C#
15
star
8

Unity-Pixelation-v2

Unity Pixelation Package - Converted to PostProcessing v2 effect 🥂👓
C#
15
star
9

Unity-MenuStack

A way to track unity menu navigation that doesn't suck too much
C#
12
star
10

CppFactory

Modern c++ object factory implementation in <200 lines
C++
12
star
11

overlayed2

Better stream overlays, For you and your viewers. 📺🔴
TypeScript
8
star
12

vcpkg.nuget

vcpkg wrapped in nuget-y goodness 📦
C#
7
star
13

partially

Rust crate that provides the Partial trait, and an optional macro to mirror a struct, wrapping each field in an Option.
Rust
5
star
14

win_event_hook

A safe rust API for using SetWinEventHook, powered by the windows crate. 👀🪝👌
Rust
4
star
15

webrtc

Prebuilt WebRTC binaries for Windows, Mac, and Linux. 🏗️🪄
JavaScript
4
star
16

webrtc-signal-http-heartbeat

webrtc-signal-http heartbeat timeout extension
JavaScript
3
star
17

unity-2dcollectables

Simple collectables and collectors for 2d unity games
C#
3
star
18

oauth24d

OAuth2 for Devices (OAuth24D) spec and implementations
3
star
19

coding.watch

Discover coding streams, live, right now 📺🔴
JavaScript
3
star
20

sgx-lkl-turtles

Docker-in-docker SGX-LKL sample of a Node hello world app. 🧙‍📦⚡
Dockerfile
2
star
21

trpc-webrtc

A set of TRPC adapters for communication via RTCDataChannel in the browser.
TypeScript
2
star
22

docker-mon

Docker container monitor and micro-orchestrator 🩺📦
Go
1
star
23

rust-templates

Templates for creating rust projects with a GitHub-managed lifecycle with cargo-generate 🏗️📃
Rust
1
star
24

node-closest-azure

finds the closest azure region
JavaScript
1
star
25

odbc-cli

A small ODBC driver test program 🐛💻
C#
1
star
26

visualized-crypto

interact with a variety of cryptographic hashing and encrypting methods
C#
1
star
27

az-visuals

A collection of web-based tools for visualizing Azure resources. ☁🔎🎁
TypeScript
1
star
28

webrtc-signal-http-capacity

webrtc-signal-http capacity management extension
JavaScript
1
star
29

napi-audio

A native audio decoder for NAPI-compatible JS runtimes 🔉🚂
Rust
1
star
30

react-user-media

A collection of hooks and components for easier access to getUserMedia, getDisplayMedia, and enumerateDevices in React.
TypeScript
1
star