public async Task RequestSdpOffer(SdpOfferRequestArgs args) { Console.WriteLine("RequestSdpOffer"); var output = GetOutput(args.EndPointId); if (output is null) { throw new InvalidOperationException($"Output with ID {args.EndPointId} and ConnectionType 'WebRTC' does not exist."); } var connectionDataKind = args.DataKind & output.DataKind; if (connectionDataKind == DataKind.Nothing) { throw new InvalidOperationException($"DataKinds to not match."); } bool supportsInsertableStreams = await jsRuntime.InvokeAsync <bool>("WebRtcHandlerManager.areInsertableStreamsSupported", handlerId); var sdpOffer = await jsRuntime.InvokeAsync <string>("WebRtcHandlerManager.getSdpOffer", handlerId, args.ConnectionId, (int)connectionDataKind, objRef); var connection = new Connection { Id = args.ConnectionId, Endpoint = output, DataKind = connectionDataKind, State = ConnectionState.Disconnected }; connections.Add(connection); await virtualStudioConnection.SendSdpOffer(new SdpOfferResponseArgs { ConnectionId = args.ConnectionId, SdpOffer = sdpOffer, SupportsInsertableStreams = supportsInsertableStreams }); }
public Task RequestSdpOffer(SdpOfferRequestArgs args) { connectionId = args.ConnectionId; webRtcClient.Connect(args.ConnectionId, (sdpOffer, error) => { virtualStudioConnection.SendSdpOffer(new SdpOfferResponseArgs { ConnectionId = args.ConnectionId, SdpOffer = sdpOffer.Description, SupportsInsertableStreams = false }); }); return(Task.CompletedTask); }
private async Task RequestSdpOffer(SdpOfferRequestArgs args) { await InvokeOnClients(webRtcClient => webRtcClient.RequestSdpOffer(args)); SdpOfferRequestReceived?.Invoke(this, args); }
public Task RequestSdpOffer(SdpOfferRequestArgs args) { throw new NotImplementedException(); }