Webrtc Unity Plugin  v01
Cross-platform Webrtc support for Unity apps ☁🎲
UnityWebrtc.Webrtc Class Reference

High-level wrapper for Unity Webrtc functionality More...

Inheritance diagram for UnityWebrtc.Webrtc:

Classes

struct  ConfigurableIceServer
 Represents an Ice server in a simple way that allows configuration from the unity inspector More...
 
class  WebrtcErrorEvent
 A UnityEvent that represents error events More...
 

Public Types

enum  IceType { IceType.None = 0, IceType.Stun, IceType.Turn }
 Different Ice server types More...
 

Public Member Functions

void InitializeAsync ()
 Initialize the underlying Webrtc libraries More...
 
void Uninitialize ()
 Uninitialize the underlying webrtc libraries, effectively cleaning up the allocated peer More...
 

Public Attributes

bool AutoInitialize = true
 Flag to initialize Webrtc on Start More...
 
bool AutoLogErrors = true
 Flag to log all errors to the Unity console automatically More...
 
List< ConfigurableIceServerIceServers
 Set of ice servers More...
 
string IceUsername
 
string IceCredential
 
UnityEvent OnInitialized = new UnityEvent()
 Event that occurs when Webrtc is fully initialized More...
 
WebrtcErrorEvent OnError = new WebrtcErrorEvent()
 Event that occurs when a Webrtc error occurs More...
 

Properties

IPeer Peer [get, protected set]
 Retrieves the underlying peer More...
 

Detailed Description

High-level wrapper for Unity Webrtc functionality

Member Enumeration Documentation

◆ IceType

Different Ice server types

Enumerator
None 

Indicates there is no Ice information

Under normal use, this should not be used

Stun 

Indicates Ice information is of type STUN

https://en.wikipedia.org/wiki/STUN

Turn 

Indicates Ice information is of type TURN

https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT

Member Function Documentation

◆ InitializeAsync()

void UnityWebrtc.Webrtc.InitializeAsync ( )

Initialize the underlying Webrtc libraries

This function is asynchronous, to monitor it's status bind a handler to OnInitialized and OnError

◆ Uninitialize()

void UnityWebrtc.Webrtc.Uninitialize ( )

Uninitialize the underlying webrtc libraries, effectively cleaning up the allocated peer

Peer will be null afterward

Member Data Documentation

◆ AutoInitialize

bool UnityWebrtc.Webrtc.AutoInitialize = true

Flag to initialize Webrtc on Start

◆ AutoLogErrors

bool UnityWebrtc.Webrtc.AutoLogErrors = true

Flag to log all errors to the Unity console automatically

◆ IceServers

List<ConfigurableIceServer> UnityWebrtc.Webrtc.IceServers
Initial value:
= new List<ConfigurableIceServer>()
{
new ConfigurableIceServer()
{
Type = IceType.Stun,
Uri = "stun.l.google.com:19302"
}
}

Set of ice servers

◆ OnError

WebrtcErrorEvent UnityWebrtc.Webrtc.OnError = new WebrtcErrorEvent()

Event that occurs when a Webrtc error occurs

◆ OnInitialized

UnityEvent UnityWebrtc.Webrtc.OnInitialized = new UnityEvent()

Event that occurs when Webrtc is fully initialized

Property Documentation

◆ Peer

IPeer UnityWebrtc.Webrtc.Peer
getprotected set

Retrieves the underlying peer

If OnInitialized has not fired, this will be null


The documentation for this class was generated from the following file: