A customer opens a link in Chrome, and a moment later they are talking face to face with your app: the help desk on a Windows PC, the kiosk running on a Mac, the field technician's iPhone. No Zoom, no Teams, no media server in the middle, no plug-in in the browser.
That is a 1:1 WebRTC video call between a .NET application and a browser. This post builds one in C# with .NET MAUI, and the same code runs on Windows, macOS and iOS: camera and microphone both ways, echo cancellation, mute and camera off, and a call page the application serves itself.
| Approach | What you run | What the caller needs |
|---|---|---|
| A video-call SaaS embedded in your app | Their SDK, their cloud, a monthly bill | An account or a meeting link |
| A WebRTC media server (Janus, mediasoup, LiveKit) | A server next to your app | A page that talks to that server |
| Peer to peer from the app | Nothing extra: the app is the signalling server | A browser and a link |
For one caller at a time, the third row is enough, and it is the shortest path.
What we build
A .NET MAUI app that:
- shows your camera and sends it with your microphone to the browser;
- shows and plays the caller's camera and microphone;
- cancels the echo of the caller's voice from your speakers;
- has Mute and Camera off buttons that work during the call;
- serves the call page; the caller opens it, presses Call, hangs up, and can call again.
Everything below comes from the WebRTC Video Call demo for MAUI, so you can open the finished project next to this post. A WPF twin of the same demo is in the same repository.
Packages
<PackageReference Include="VisioForge.DotNet.MediaBlocks" Version="2026.12.2" /> plus the redist of each platform; the .Adds packages carry the WebRTC and echo cancellation plugins:
| Platform | Redist packages |
|---|---|
| Windows x64 | VisioForge.CrossPlatform.Core.Windows.x64, VisioForge.CrossPlatform.Core.Windows.Adds.x64 |
| macOS (Mac Catalyst) | VisioForge.CrossPlatform.Core.macOS, VisioForge.CrossPlatform.Core.macOS.Adds |
| iOS | VisioForge.CrossPlatform.Core.iOS |
Android is not there yet: its redist has no WebRTC plugins, and WebRTCSinkBlock.IsAvailable() returns false. Check IsAvailable() on all three blocks at start.
Three blocks, two sessions
your app browser camera + mic ─► EchoCancellationBlock ─► WebRTCSinkBlock ══► call page VideoView + speakers ◄─ WebRTCSourceBlock ◄═══════════════ camera + mic -
WebRTCSinkBlocksends your side. It also runs a WebSocket signalling server (port 8443) and a small web server for the call page. -
WebRTCSourceBlockreceives the caller's side, decoded: video for aVideoRendererBlock, audio for the speakers. -
EchoCancellationBlockremoves the caller's voice that your speakers play and your microphone picks up again. Without it the caller hears their own voice come back.
Each direction is its own WebRTC session, negotiated separately, and the sink adapts its bitrate to the caller's network.
How the browser finds the application
The signalling server speaks the protocol of GStreamer's webrtcsink: JSON over a WebSocket. Three peers register on it:
-
WebRTCSinkBlockregisters as a producer. Anyone can ask for its stream. -
WebRTCSourceBlock, created with neitherProducerPeerIdnorConnectToFirstProducer, registers as a consumer that waits to be called. - The call page registers as a producer and a listener, asks for the sink's stream, and calls the waiting source with its own camera and microphone.
The application never needs to know the browser's peer ID.
The pipeline
var pipeline = new MediaBlocksPipeline(); // Your side: camera and microphone to the browser. The sink serves the call page from webRoot. var sink = new WebRTCSinkBlock(new WebRTCSinkSettings { SignallingServerHost = "127.0.0.1", SignallingServerPort = 8443, WebServerDirectory = webRoot, WebServerAddress = "http://127.0.0.1:8090/", }); var camera = new SystemVideoSourceBlock(new VideoCaptureDeviceSourceSettings(videoDevice)); var microphone = new SystemAudioSourceBlock(audioDevice.CreateSourceSettings()); var echoCancellation = new EchoCancellationBlock(new EchoCancellationSettings()); pipeline.Connect(camera.Output, sink.CreateNewInput(MediaBlockPadMediaType.Video)); pipeline.Connect(microphone.Output, echoCancellation.Input); pipeline.Connect(echoCancellation.Output, sink.CreateNewInput(MediaBlockPadMediaType.Audio)); // The caller's side: the renderers wait for the call. The caller's voice passes the echo canceller // on its way to the speakers, so the canceller knows what to remove from the microphone. var remoteVideo = new VideoRendererBlock(pipeline, remoteView.GetVideoView()) { IsSync = false }; pipeline.AddBlock(remoteVideo); pipeline.Connect(echoCancellation.PlaybackOutput, new AudioRendererBlock().Input); await pipeline.StartAsync(); // The source joins the sink's signalling server once it runs, and waits for the call page to call it. var source = new WebRTCSourceBlock(new WebRTCSourceSettings { SignallingServer = "ws://127.0.0.1:8443" }); source.VideoOutput.OnDemandConnect = true; source.AudioOutput.OnDemandConnect = true; pipeline.AddBlockLive(source); pipeline.ConnectLive(source.VideoOutput, remoteVideo.Input); pipeline.ConnectLive(source.AudioOutput, echoCancellation.PlaybackInput); pipeline.SyncBlockStateLive(source); Two details that are easy to miss:
- The source is added after
StartAsync. Its signalling client connects the moment it starts, and the sink's server listens only once the pipeline runs.OnDemandConnect = truekeeps its outputs open forConnectLive. - The caller's audio goes through the echo canceller (
PlaybackInput→PlaybackOutput) on its way to the speakers. Leave that path unconnected and nothing is cancelled.
The web server port is yours to choose: the demo uses 8090, because 8080 is often taken on Windows by IIS or HTTP.sys. When the caller hangs up and calls again, the same WebRTCSourceBlock takes the new call. Nothing is rebuilt.
What changes in MAUI
Two things. The renderer takes the IVideoView of a VisioForge.Core.UI.MAUI.VideoView (remoteView.GetVideoView() above), and the call page ships as an app asset (Resources/Raw/wwwroot/index.html), which is not a folder on disk on every platform. Copy it out before the sink starts:
var webRoot = Path.Combine(FileSystem.CacheDirectory, "wwwroot"); Directory.CreateDirectory(webRoot); using (var asset = await FileSystem.OpenAppPackageFileAsync("wwwroot/index.html")) using (var file = File.Create(Path.Combine(webRoot, "index.html"))) { await asset.CopyToAsync(file); } On Windows and macOS the caller's browser can run on the same computer: http://127.0.0.1:8090/?signalling=8443.
Calling an iPhone
On iOS the browser runs on another computer, so the app listens on every interface and shows the device's address:
var sink = new WebRTCSinkBlock(new WebRTCSinkSettings { SignallingServerHost = "0.0.0.0", SignallingServerPort = 8443, WebServerDirectory = webRoot, WebServerAddress = "http://0.0.0.0:8090/", }); The caller opens http://<device address>:8090/?signalling=8443; the app's own WebRTCSourceBlock still connects to ws://127.0.0.1:8443 on the device. The app needs NSCameraUsageDescription, NSMicrophoneUsageDescription and NSLocalNetworkUsageDescription in Info.plist. And since a browser gives a page its camera only on https:// or localhost, a quick LAN test needs Chrome's --unsafely-treat-insecure-origin-as-secure=http://<device address>:8090; real callers get the page from an https:// site (see the limits below).
Mute and camera off, without renegotiation
// Mute: a VolumeBlock before the echo canceller. The audio track stays, the caller hears silence. volume.Mute = true; // Camera off: a VideoBalanceBlock after the camera. The video track stays, the caller sees black. cameraBalance.Settings.Contrast = 0; cameraBalance.Settings.Saturation = 0; cameraBalance.Settings.Brightness = -1; Both change a live element; the WebRTC sessions do not notice, so turning the camera back on is instant.
The call page: one file of plain JavaScript
The page in wwwroot/index.html has no framework and no SDK. It opens one WebSocket and two RTCPeerConnections:
send({ type: 'setPeerStatus', roles: ['producer', 'listener'], meta: { callPage: true } }); send({ type: 'list' }); // the app's sink → startSession: the sink offers, we answer send({ type: 'listConsumers' }); // the app's waiting source → startSession: we offer our camera Every peer message (SDP and ICE) is routed to the right connection by its sessionId. Copy the file as is, or use it as a reference for your own page.
Limits worth knowing before you ship
- HTTPS outside localhost.
getUserMediaworks onhttps://and onlocalhostonly, and the sink's built-in web server ishttp://. For a caller on another machine, host the page on your own HTTPS site and give the sinkSignallingServerCertificate/SignallingServerKeyso the page connects overwss://; then connect the source towss://127.0.0.1:<port>. - TURN for the internet. On a LAN the peers connect directly. Behind NAT, run coturn and set it in
WebRTCSinkSettings.TurnServers,WebRTCSourceSettings.TurnServers(turn://user:password@host:3478) and the page'siceServers. - 1:1.
WebRTCSourceBlocktakes one call at a time. For many viewers of one stream,WebRTCSinkBlockalone serves each browser its own session. - Platforms. Windows, macOS (Mac Catalyst) and iOS today; Android once its redist carries the WebRTC plugins.
FAQ
Do I need a media server for a WebRTC call from .NET? No. The sink runs the signalling inside your application, media flows peer to peer, and only TURN is needed when the peers cannot reach each other.
Can a .NET MAUI app make a WebRTC video call with a browser? Yes: the same three-block pipeline on Windows, macOS and iOS; only the call page is copied out of the app package first.
Which codecs does the call use? Negotiated per session: VP8, H.264, VP9, H.265 or AV1 for video, Opus for audio. The source outputs decoded video and audio in the format the browser sends.
Wrapping up
A browser-to-app video call is three blocks and one page: WebRTCSinkBlock for your side and the signalling, WebRTCSourceBlock waiting for the caller, EchoCancellationBlock between the microphone and the speakers — and with MAUI the same code runs on Windows, macOS and iOS.
- Runnable project: WebRTC Video Call demo for MAUI on GitHub
- Reference and the latest version of this guide: Two-way WebRTC video call with a browser in C#
SDK: VisioForge.DotNet.MediaBlocks 2026.12.2 on NuGet.




