Exemplo n.º 1
0
        async void OnSignallingMessageFromPeer(object peerId, string message)
        {
            var numericalPeerId = (int)peerId;

            var jsonObject = JsonObject.Parse(message);

            switch (SignallerMessagingExtensions.GetMessageType(jsonObject))
            {
            case SignallerMessagingExtensions.MessageType.Offer:
                await this.OnOfferMessageFromPeerAsync(numericalPeerId, jsonObject);

                break;

            case SignallerMessagingExtensions.MessageType.Answer:
                await this.OnAnswerMessageFromPeerAsync(numericalPeerId, jsonObject);

                break;

            case SignallerMessagingExtensions.MessageType.Ice:
                await this.OnIceMessageFromPeerAsync(numericalPeerId, jsonObject);

                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        async Task OnIceMessageFromPeerAsync(int peerId, JsonObject message)
        {
            var candidate = SignallerMessagingExtensions.IceCandidateFromJsonMessage(message);

            await this.peerManager.AddIceCandidateAsync(candidate);
        }
Exemplo n.º 3
0
        async Task OnAnswerMessageFromPeerAsync(int peerId, JsonObject message)
        {
            var sdp = SignallerMessagingExtensions.SdpFromJsonMessage(message);

            await this.peerManager.AcceptRemoteAnswerAsync(sdp);
        }
Exemplo n.º 4
0
        async Task OnOfferMessageFromPeerAsync(int peerId, JsonObject message)
        {
            var sdp = SignallerMessagingExtensions.SdpFromJsonMessage(message);

            await this.AcceptRemotePeerOfferAsync(peerId, sdp);
        }