public void StartConnect(string ipAddress) { #if UNITY_EDITOR #elif UNITY_ANDROID AndroidJavaClass playerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject activity = playerClass.GetStatic <AndroidJavaObject>("currentActivity"); AndroidJavaClass utilityClass = new AndroidJavaClass("org.webrtc.UnityUtility"); utilityClass.CallStatic("InitializePeerConncectionFactory", new object[1] { activity }); #endif Observable.Timer(TimeSpan.FromSeconds(1)).Subscribe(_ => Join()); Debug.Log("start"); ws = new WebSocket("ws://" + ipAddress + ":8080"); ws.OnMessage += (_, e) => OnMessage(e.Data); ws.Connect(); signaling = new Signaling(ipAddress); signaling.OnConnectMethod += OnConnet; signaling.OnDataMethod += OnData; signaling.OnSdpMethod += OnSdp; signaling.OnRemoteVideo += OnI420RemoteFrameReady; }
public void StartConnect(string ipAddress) { var s = Scheduler.MainThread; #if UNITY_EDITOR #elif UNITY_ANDROID AndroidJavaClass playerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject activity = playerClass.GetStatic <AndroidJavaObject>("currentActivity"); AndroidJavaClass utilityClass = new AndroidJavaClass("org.webrtc.UnityUtility"); utilityClass.CallStatic("InitializePeerConncectionFactory", new object[1] { activity }); #endif Debug.Log("start"); signaling = new Signaling(ipAddress); signaling.OnConnectMethod += OnConnet; signaling.OnDataMethod += OnData; signaling.OnSdpMethod += OnSdp; signaling.OnRemoteVideo += OnI420RemoteFrameReady; baseAddress = ipAddress; Join(); }
static void Main(string[] args) { ExclusiveLocking.RunTest(); NonExclusiveLocking.RunTest(); Signaling.RunTest(); SignalingWithReset.RunTest(); AbortCondition.RunTest(); Console.ReadLine(); }
internal void InstantSignaling() { Signaling?.Invoke(); }