Ejemplo n.º 1
0
    private void OnIceGatheringStateChange(RTCIceGatheringState state)
    {
        if (state != RTCIceGatheringState.Complete)
        {
            return;
        }

        string     elapsed      = (Time.realtimeSinceStartup - beginTime).ToString("F");
        GameObject newCandidate = Instantiate(candidateElement, candidateParent);

        Text[] texts = newCandidate.GetComponentsInChildren <Text>();
        foreach (Text text in texts)
        {
            switch (text.name)
            {
            case "Time":
                text.text = (Time.realtimeSinceStartup - beginTime).ToString("F");
                break;

            case "Priority":
                text.text = "Done";
                break;

            default:
                text.text = string.Empty;
                break;
            }
        }

        _transceiver.Dispose();
        _pc1.Close();
        _pc1 = null;
        gatherCandidatesButton.interactable = true;
    }
 static void PCOnIceGatheringChange(IntPtr ptr, RTCIceGatheringState state)
 {
     WebRTC.Sync(ptr, () =>
     {
         if (WebRTC.Table[ptr] is RTCPeerConnection connection)
         {
             connection.OnIceGatheringStateChange?.Invoke(state);
         }
     });
 }
 public override void DidChangeIceGatheringState(RTCPeerConnection peerConnection, RTCIceGatheringState newState)
 {
     _listener?.OnIceGatheringChange(newState.ToNet());
 }
 public static IceGatheringState ToNativePort(this RTCIceGatheringState platformNative) => (IceGatheringState)platformNative;
Ejemplo n.º 5
0
 protected virtual void onIceGatheringStateEvent(object sender, RTCIceGatheringState e)
 {
 }
 public void DidChangeIceGatheringState(RTCPeerConnection peerConnection, RTCIceGatheringState newState)
 {
     Console.WriteLine("ICE gathering state changed:{0} ({1})", newState, (int)newState);
 }
        static void IceGatheringStateChangedCallback(IntPtr userData, RTCIceGatheringState state)
        {
            var source = GCHandleHelper.FromIntPtr <PeerConnectionObserver>(userData);

            source?.IceGatheringStateChanged?.Invoke(source, new EventArgs <RTCIceGatheringState>(state));
        }
 public static IceGatheringState ToNet(this RTCIceGatheringState self)
 {
     return((IceGatheringState)self);
 }