Exemple #1
0
    void SendSDP(RTCSessionDescription session, NCMBStateData.MyNCMBstate state)
    {
        bool isoffer    = (session.type == RTCSdpType.Offer);
        var  type       = (isoffer) ? RTCSendData.DATATYPE.OFFERE : RTCSendData.DATATYPE.ANSWER;
        var  data       = new RTCSendData(type, session.sdp);
        var  json       = JsonConverter.ToJson(data);
        var  json_state = JsonConverter.ToJson(new NCMBStateData(state));

        _signalingNCMB.FetchObject((NCMBObject obj) => {
            var saveobj = NCMB_RTC.SetJson_SDPData(obj, isoffer, json);
            saveobj     = NCMB_RTC.SetJson_connectState(saveobj, json_state);
            _signalingNCMB.UpdateObject(saveobj);
        });
    }
Exemple #2
0
    void SendIceCandidata(List <string> jsonlist)
    {
        _signalingNCMB.FetchObject((obj) =>
        {
            var json           = NCMB_RTC.GetJson_SDPData(obj, _IsOffer);
            var data           = JsonConverter.FromJson <RTCSendData>(json);
            data.candidateJson = jsonlist;
            json           = JsonConverter.ToJson(data);
            var json_state = (_IsOffer) ? JsonConverter.ToJson(new NCMBStateData(NCMBStateData.MyNCMBstate.CONNECTED_sdp))
                                        : JsonConverter.ToJson(new NCMBStateData(NCMBStateData.MyNCMBstate.SENDED_ice));
            var saveobj = NCMB_RTC.SetJson_SDPData(obj, _IsOffer, json);
            saveobj     = NCMB_RTC.SetJson_connectState(saveobj, json_state);

            _signalingNCMB.UpdateObject(saveobj);
            Debug.Log($"sendJson");
        });
    }