|
Webrtc Unity Plugin
v01
Cross-platform Webrtc support for Unity apps ☁🎲
|
Peer event frontend More...
Classes | |
| class | WebrtcPeerString2Event |
| Represents a peer event composed of two string-literals More... | |
| class | WebrtcPeerStringEvent |
| Represents a peer event composed of a single string-literal More... | |
| class | WebrtcPeerStringIntStringEvent |
| Represents a peer event composed of a string-literal, an int, and another string-literal More... | |
Public Member Functions | |
| void | OnInitialized () |
| Initialization handler More... | |
| void | AddDataChannel () |
| we front the IPeer interface for the underlying peer so that UnityEvents and engine code have something they can bind to to trigger the actual calls More... | |
| void | AddIceCandidate (string candidate, int sdpMlineindex, string sdpMid) |
| Add an ice candidate More... | |
| void | AddStream (bool audioOnly) |
| Add a stream More... | |
| void | ClosePeerConnection () |
| Close the peer connection More... | |
| void | CreateAnswer () |
| Create an sdp answer More... | |
| void | CreateOffer () |
| Create an sdp offer More... | |
| int | GetUniqueId () |
| Get the unique id More... | |
| void | SendDataViaDataChannel (string data) |
| Send data via the created data channel More... | |
| void | SetAudioControl (bool isMute, bool isRecord) |
| Adjust audio controls More... | |
| void | SetRemoteDescription (string type, string sdp) |
| Set the remote stream description More... | |
| void | Log () |
We provide a function Log() that matches the params of all exposed events so that one may easily wire UnityEvents to Log calls using this.Log() as a reference in editor More... | |
| void | Log (string arg1) |
| void | Log (string arg1, string arg2) |
| void | Log (string arg1, int arg2, string arg3) |
Public Attributes | |
| bool | AutoLogErrors = true |
| Flag to log all errors to the Unity console automatically More... | |
| UnityEvent | OnPeerReady = new UnityEvent() |
| Event that occurs when the peer is ready More... | |
| WebrtcPeerStringEvent | OnDataFromDataChannelReady = new WebrtcPeerStringEvent() |
| Event that occurs when data is ready from the data channel More... | |
| WebrtcPeerStringEvent | OnFailure = new WebrtcPeerStringEvent() |
| Event that occurs when a peer-specific failure happens More... | |
| WebrtcPeerStringIntStringEvent | OnIceCandiateReadyToSend = new WebrtcPeerStringIntStringEvent() |
| Event that occurs when an ice candidate is prepared More... | |
| UnityEvent | OnLocalDataChannelReady = new UnityEvent() |
| Event that occurs when the data channel is ready More... | |
| WebrtcPeerString2Event | OnLocalSdpReadyToSend = new WebrtcPeerString2Event() |
| Event that occurs when an sdp message is prepared More... | |
| WebrtcPeerStringEvent | OnSdpOfferReadyToSend = new WebrtcPeerStringEvent() |
| Event that occurs when an sdp offer is prepared More... | |
| WebrtcPeerStringEvent | OnSdpAnswerReadyToSend = new WebrtcPeerStringEvent() |
| Event that occurs when an sdp answer is prepared More... | |
Peer event frontend
| void UnityWebrtc.WebrtcPeerEvents.AddDataChannel | ( | ) |
we front the IPeer interface for the underlying peer so that UnityEvents and engine code have something they can bind to to trigger the actual calls
Implements UnityWebrtc.IPeerImpl.
| void UnityWebrtc.WebrtcPeerEvents.AddIceCandidate | ( | string | candidate, |
| int | sdpMlineindex, | ||
| string | sdpMid | ||
| ) |
Add an ice candidate
| candidate | sdp candidate data |
| sdpMlineindex | sdp mline index |
| sdpMid | sdp mid |
Implements UnityWebrtc.IPeerImpl.
| void UnityWebrtc.WebrtcPeerEvents.AddStream | ( | bool | audioOnly | ) |
Add a stream
| audioOnly | flag indicating if the stream should only contain audio |
Implements UnityWebrtc.IPeerImpl.
| void UnityWebrtc.WebrtcPeerEvents.ClosePeerConnection | ( | ) |
Close the peer connection
Implements UnityWebrtc.IPeerImpl.
| void UnityWebrtc.WebrtcPeerEvents.CreateAnswer | ( | ) |
Create an sdp answer
Implements UnityWebrtc.IPeerImpl.
| void UnityWebrtc.WebrtcPeerEvents.CreateOffer | ( | ) |
Create an sdp offer
Implements UnityWebrtc.IPeerImpl.
| int UnityWebrtc.WebrtcPeerEvents.GetUniqueId | ( | ) |
| void UnityWebrtc.WebrtcPeerEvents.Log | ( | ) |
We provide a function Log() that matches the params of all exposed events so that one may easily wire UnityEvents to Log calls using this.Log() as a reference in editor
| void UnityWebrtc.WebrtcPeerEvents.OnInitialized | ( | ) |
Initialization handler
TODO(bengreenier): This could be auto-bound with editor script
This is expected to be bound to Webrtc.OnInitialized via the UnityEditor
| void UnityWebrtc.WebrtcPeerEvents.SendDataViaDataChannel | ( | string | data | ) |
Send data via the created data channel
Must call AddDataChannel first
| data | data to send |
Implements UnityWebrtc.IPeerImpl.
| void UnityWebrtc.WebrtcPeerEvents.SetAudioControl | ( | bool | isMute, |
| bool | isRecord | ||
| ) |
Adjust audio controls
| isMute | is the stream muted |
| isRecord | is the stream recording data |
Implements UnityWebrtc.IPeerImpl.
| void UnityWebrtc.WebrtcPeerEvents.SetRemoteDescription | ( | string | type, |
| string | sdp | ||
| ) |
Set the remote stream description
Known valid types are "answer" and "offer"
| type | description type |
| sdp | sdp data |
Implements UnityWebrtc.IPeerImpl.
| bool UnityWebrtc.WebrtcPeerEvents.AutoLogErrors = true |
Flag to log all errors to the Unity console automatically
| WebrtcPeerStringEvent UnityWebrtc.WebrtcPeerEvents.OnDataFromDataChannelReady = new WebrtcPeerStringEvent() |
Event that occurs when data is ready from the data channel
| WebrtcPeerStringEvent UnityWebrtc.WebrtcPeerEvents.OnFailure = new WebrtcPeerStringEvent() |
Event that occurs when a peer-specific failure happens
| WebrtcPeerStringIntStringEvent UnityWebrtc.WebrtcPeerEvents.OnIceCandiateReadyToSend = new WebrtcPeerStringIntStringEvent() |
Event that occurs when an ice candidate is prepared
| UnityEvent UnityWebrtc.WebrtcPeerEvents.OnLocalDataChannelReady = new UnityEvent() |
Event that occurs when the data channel is ready
| WebrtcPeerString2Event UnityWebrtc.WebrtcPeerEvents.OnLocalSdpReadyToSend = new WebrtcPeerString2Event() |
Event that occurs when an sdp message is prepared
| UnityEvent UnityWebrtc.WebrtcPeerEvents.OnPeerReady = new UnityEvent() |
Event that occurs when the peer is ready
This is the same as Webrtc.OnInitialized but is included here for convienience
| WebrtcPeerStringEvent UnityWebrtc.WebrtcPeerEvents.OnSdpAnswerReadyToSend = new WebrtcPeerStringEvent() |
Event that occurs when an sdp answer is prepared
| WebrtcPeerStringEvent UnityWebrtc.WebrtcPeerEvents.OnSdpOfferReadyToSend = new WebrtcPeerStringEvent() |
Event that occurs when an sdp offer is prepared