public async Task ConnectAsync()
        {
            _connection = await SignalRVirtualStudioConnection.CreateAsync("localhost", 5001, true);

            _connection.AddListener(this);

            await _connection.JoinVirtualStudio("vs", new StudioComponentDto
            {
                Name          = "Receiver",
                IsPlaceholder = false,
                Inputs        = new List <StudioComponentEndpointDto>
                {
                    new StudioComponentEndpointDto()
                    {
                        IOType = EndpointIOType.Input, ConnectionType = "WebRTC", DataKind = DataKind.Video, Id = 1, Name = "VideoInput"
                    }
                }
            });
        }
Esempio n. 2
0
        async Task ConnectToServer()
        {
            virtualStudioConnection = await SignalRVirtualStudioConnection.CreateAsync("192.168.2.109", 5001, true);

            virtualStudioConnection.AddListener(this);

            StudioComponentDto studioComponentDto = new StudioComponentDto
            {
                Name          = "AR Camera",
                IsPlaceholder = false,
                Inputs        = new List <StudioComponentEndpointDto>
                {
                    new StudioComponentEndpointDto()
                    {
                        IOType = EndpointIOType.Input, ConnectionType = "WebRTC", DataKind = DataKind.Video, Id = 2, Name = "Feedback"
                    }
                },
                Outputs = new List <StudioComponentEndpointDto>
                {
                    new StudioComponentEndpointDto()
                    {
                        IOType = EndpointIOType.Output, ConnectionType = "WebRTC", DataKind = DataKind.VideoAudio, Id = 1, Name = "Video"
                    }
                }
            };

            bool success = await virtualStudioConnection.JoinVirtualStudio(virtualStudioName, studioComponentDto);

            if (success)
            {
                Console.WriteLine($"Joined '{virtualStudioName}' successfully.");
            }
            else
            {
                Console.WriteLine($"Joining '{virtualStudioName}' failed.");
            }
        }