예제 #1
0
    public override void ReceivedMessage(string description, string message)
    {
        if (description == "offer")
        {
            peer.SetRemoteDescription("offer", message);
            peer.CreateAnswer();
        }

        if (description == "answer")
        {
            peer.SetRemoteDescription("answer", message);
        }

        if (description == "ice")
        {
            //            peer.AddIceCandidate(message, 0, "video");
        }

        if (description == "iceJson")
        {
            IceJson iceJson = JsonUtility.FromJson(message, typeof(IceJson)) as IceJson;
            peer.AddIceCandidate(iceJson.Ice, iceJson.Index, iceJson.Mid);
            Debug.Log("WebRtcCtr, " + description + ", " + iceJson.Ice + iceJson.Index + iceJson.Mid);
        }
    }
예제 #2
0
    public void OnIceCandiateReadytoSend(int id, string candidate, int sdpMlineIndex, string sdpMid)
    {
        MsgExchanger.RequiredSendingMessage("ice", candidate);

        IceJson iceJson = new IceJson(candidate, sdpMlineIndex, sdpMid);
        string  jonStr  = JsonUtility.ToJson(iceJson);

        MsgExchanger.RequiredSendingMessage("iceJson", jonStr);
    }
예제 #3
0
    public void OnIceCandiateReadytoSend(int id, string candidate, int sdpMlineIndex, string sdpMid)
    {
//        Debug.Log("WebRTC OnIceCandiateReadytoSend called. id=" + id + " candidate=" + candidate + " sdpMid=" + sdpMid + " sdpMlineIndex=" + sdpMlineIndex);
        MsgExchanger.RequiredSendingMessage("ice", candidate);


        IceJson iceJson = new IceJson(candidate, sdpMlineIndex, sdpMid);
        string  jonStr  = JsonUtility.ToJson(iceJson);

        Debug.Log("WebRTC ice json : " + jonStr);

        MsgExchanger.RequiredSendingMessage("iceJson", jonStr);
    }