using System; using System.Collections.Generic; using System.Linq; using Unity.RenderStreaming.Signaling; using UnityEngine; namespace Unity.RenderStreaming { /// /// /// [Serializable] public class FurioosSignalingSettings : SignalingSettings { /// /// /// public override Type signalingClass => typeof(FurioosSignaling); /// /// /// public override IReadOnlyCollection iceServers => m_iceServers; /// /// /// public string url => m_url; [SerializeField] protected string m_url; [SerializeField] protected IceServer[] m_iceServers; /// /// /// /// /// public FurioosSignalingSettings(string url, IceServer[] iceServers = null) { if (url == null) throw new ArgumentNullException("url"); if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)) throw new ArgumentException("url is not well formed Uri"); m_url = url; m_iceServers = iceServers == null ? Array.Empty() : iceServers.Select(server => server.Clone()).ToArray(); } /// /// /// public FurioosSignalingSettings() { m_url = "http://127.0.0.1"; m_iceServers = new[] { new IceServer (urls: new[] {"stun:stun.l.google.com:19302"}) }; } /// /// /// /// /// public override bool ParseArguments(string[] arguments) { return true; } } }