Class SignalingManager
Manages the signaling process for Unity RenderStreaming.
Inherited Members
Namespace: Unity.RenderStreaming
Assembly: Unity.RenderStreaming.dll
Syntax
[AddComponentMenu("Render Streaming/Signaling Manager")]
public sealed class SignalingManager : MonoBehaviour
Fields
evaluateCommandlineArguments
Indicates whether to evaluate command line arguments if launching runtime on the command line.
Declaration
[SerializeField]
[Tooltip("Evaluate commandline arguments if launching runtime on the command line.")]
public bool evaluateCommandlineArguments
Field Value
Type | Description |
---|---|
bool |
See Also
runOnAwake
Indicates whether the signaling process should automatically start when the Awake method is called.
Declaration
[SerializeField]
[Tooltip("Automatically started when called Awake method.")]
public bool runOnAwake
Field Value
Type | Description |
---|---|
bool |
See Also
Properties
Running
Gets a value indicating whether the signaling process is running.
Declaration
public bool Running { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
useDefaultSettings
Use settings in Project Settings.
Declaration
public bool useDefaultSettings { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
Methods
AddSignalingHandler(SignalingHandlerBase)
Declaration
public void AddSignalingHandler(SignalingHandlerBase handlerBase)
Parameters
Type | Name | Description |
---|---|---|
SignalingHandlerBase | handlerBase |
See Also
GetSignalingSettings()
Gets the signaling settings.
Declaration
public SignalingSettings GetSignalingSettings()
Returns
Type | Description |
---|---|
SignalingSettings | The signaling settings. |
Examples
var settings = signalingManager.GetSignalingSettings();
if (settings is WebSocketSignalingSettings webSocketSettings)
{
Debug.Log($"WebSocket URL: {webSocketSettings.url}");
}
See Also
RemoveSignalingHandler(SignalingHandlerBase)
Declaration
public void RemoveSignalingHandler(SignalingHandlerBase handlerBase)
Parameters
Type | Name | Description |
---|---|---|
SignalingHandlerBase | handlerBase |
See Also
Run(RTCConfiguration, ISignaling, SignalingHandlerBase[])
Runs the signaling process with the specified RTC configuration.
Declaration
public void Run(RTCConfiguration conf, ISignaling signaling = null, SignalingHandlerBase[] handlers = null)
Parameters
Type | Name | Description |
---|---|---|
RTCConfiguration | conf | The RTC configuration. |
ISignaling | signaling | The signaling instance to use. If null, a new instance will be created. |
SignalingHandlerBase[] | handlers | The signaling handlers to use. If null, the existing handlers will be used. |
Remarks
To use this method, the WebRTC package is required.
Examples
var rtcConfig = new RTCConfiguration
{
iceServers = new[] { new RTCIceServer { urls = new[] { "stun:stun.l.google.com:19302" } } }
};
signalingManager.Run(rtcConfig);
See Also
Run(ISignaling, SignalingHandlerBase[])
Runs the signaling process.
Declaration
public void Run(ISignaling signaling = null, SignalingHandlerBase[] handlers = null)
Parameters
Type | Name | Description |
---|---|---|
ISignaling | signaling | The signaling instance to use. If null, a new instance will be created. |
SignalingHandlerBase[] | handlers | The signaling handlers to use. If null, the existing handlers will be used. |
Examples
signalingManager.Run();
See Also
SetSignalingSettings(SignalingSettings)
Sets the signaling settings.
Declaration
public void SetSignalingSettings(SignalingSettings settings)
Parameters
Type | Name | Description |
---|---|---|
SignalingSettings | settings | The signaling settings. |
Examples
var settings = new WebSocketSignalingSettings("ws://example.com", new[]
{
new IceServer (urls: new[] {"stun:stun.l.google.com:19302"})
});
signalingManager.SetSignalingSettings(settings);
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the signaling process has already started. |
ArgumentNullException | Thrown when the settings are null. |
See Also
Stop()
Stops the signaling process.
Declaration
public void Stop()
Examples
signalingManager.Stop();