Table of Contents

VAST.Web Library

The VAST.Web library provides low-latency media streaming to browser clients over WebTransport (HTTP/3) with automatic WebSocket fallback. It is an ASP.NET Core extension that integrates with the VAST.Network.StreamingServer infrastructure.

Important

The WebTransport-based streaming protocol is a custom VASTreaming protocol and requires both a VASTreaming server and the VASTreaming JavaScript player on the client side. When the IETF Media over QUIC Transport (MoQ) specification becomes a standard, the library will provide a full MoQ implementation.

Overview

Feature Description
WebTransport Low-latency streaming over HTTP/3 QUIC
WebSocket Fallback Automatic fallback for browsers without WebTransport support; such as Apple devices
Transcoding On-the-fly video and audio transcoding for browser compatibility
Interactive Playback Seek, pause, resume, and playback rate control for VOD streams
Keyframe-only Decoding Client-requested keyframe-only mode for reduced bandwidth

Requirements

  • .NET: .NET 9.0 or later
  • Dependencies: VAST.Common
  • ASP.NET Core: Microsoft.AspNetCore.App framework reference

Supported Codecs

The WebTransport server automatically transcodes media to browser-compatible formats when needed.

Video

Codec Description
H.264 Default output codec (Baseline profile)
H.265 Fallback if the client supports it

Audio

Codec Description
AAC Default output codec (ADTS format, 44.1 kHz stereo)

WebTransport Server

The WebTransportServer handles incoming WebTransport and WebSocket connections from browser clients.

Architecture

Note

WebTransportServer is not available as a standalone server. It operates as part of the VAST.Network.StreamingServer infrastructure and is instantiated by the StreamingServer automatically when enabled.

The diagrams below illustrate the media data flow inside the StreamingServer for the WebTransportServer server.

Live Streams

┌─────────────────────────────────────────────────────────────┐
│                 VAST.Network.StreamingServer                │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │               VAST.Network.PublishingPoint              │ │
│ │                   /hls/stream1 (Live)                   │ │
│ │ ┌─────────────────────────────────────────────────────┐ │ │
│ │ │                  Live Media Source                  │ │ │
│ │ │           (Camera, File, Network Stream)            │ │ │
│ │ └─────────────────────────────────────────────────────┘ │ │
│ │                            ↓                            │ │
│ │ ┌─────────────────────────────────────────────────────┐ │ │
│ │ │       IWebTransportClientSink (internal class)      │ │ │
│ │ │          (Receives media, transcodes data)          │ │ │
│ │ └─────────────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────────┘ │
│                             ↓                               │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │           WebTransportServer (internal class)           │ │
│ │              (client context management)                │ │
│ └─────────────────────────────────────────────────────────┘ │
│                             ↓                               │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │                       HttpServer                        │ │
│ │            (HTTP request/response management,           │ │
│ │                 based on ASP.NET Core)                  │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
                              ↓
                Single HTTP Client (browser)

StreamingServer manages multiple live PublishingPoint instances. Each PublishingPoint has a single source object (IMediaSource) and a single IWebTransportClientSink (when WebTransport streaming is enabled). IWebTransportClientSink transcodes if necessary and prepares data for the connected client. The data prepared by IWebTransportClientSink is then served by WebTransportServer to the client via the HTTP server (ASP.NET Core).

VOD Streams

┌─────────────────────────────────────────────────────────────┐
│                 VAST.Network.StreamingServer                │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │               VAST.Network.PublishingPoint              │ │
│ │                    /hls/movie1 (VOD)                    │ │
│ │ ┌─────────────────────────────────────────────────────┐ │ │
│ │ │                   VOD Media Source                  │ │ │
│ │ │                (File, Memory Stream)                │ │ │
│ │ └─────────────────────────────────────────────────────┘ │ │
│ │                            ↓                            │ │
│ │ ┌─────────────────────────────────────────────────────┐ │ │
│ │ │       IWebTransportClientSink (internal class)      │ │ │
│ │ │          (Receives media, transcodes data)          │ │ │
│ │ └─────────────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────────┘ │
│                             ↓                               │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │           WebTransportServer (internal class)           │ │
│ │              (client context management)                │ │
│ └─────────────────────────────────────────────────────────┘ │
│                             ↓                               │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │                       HttpServer                        │ │
│ │            (HTTP request/response management,           │ │
│ │                 based on ASP.NET Core)                  │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
                              ↓
             Single HTTP Client (browser, player)

StreamingServer manages multiple VOD PublishingPoint instances. Each PublishingPoint has a single source object (IMediaSource) and a single IWebTransportClientSink, and handles exactly one client because the source must maintain the current playback context (position, speed, etc.), which is unique to each connected client. IWebTransportClientSink transcodes if necessary and prepares data for the connected client. The data prepared by IWebTransportClientSink is then served by WebTransportServer to the client via the HTTP server (ASP.NET Core).

The VOD media source, typically IsoSource, uses shared metadata and indices cached in memory to skip parsing the file structure and perform only media read operations from disk.

Integration with StreamingServer

When used as part of StreamingServer, the WebTransport server shares the HTTP endpoints with other HTTP-based protocols:

var server = new VAST.Network.StreamingServer();

// Enable HTTP (required for WebTransport)
server.EnableHttp = true;

// Enable WebTransport
server.EnableWebTransport = true;
server.WebTransportServerParameters = new VAST.HTTP.WebTransportServerParameters
{
    HlsPath = "/wt",
};

server.Start();

Server Parameters

Configure server behavior using WebTransportServerParameters:

Parameter Default Description
WebTransportPath null Path relative to the root HTTP server path for resolving WebTransport requests; null means the root path is used

Transport Selection

The server automatically selects the transport based on the client request:

Transport Protocol Description
WebTransport HTTP/3 (QUIC) Primary transport; lowest latency via QUIC datagrams and streams; requires HTTPS
WebSocket HTTP/1.1 or HTTP/2 Automatic fallback for browsers without WebTransport support

WebTransport is only available over HTTPS because TLS is a mandatory requirement of the HTTP/3 protocol. WebSocket connections can work over both HTTP and HTTPS.

WebTransport connections use the HTTP CONNECT method. WebSocket connections use the standard WebSocket upgrade handshake. Both transports use the same binary protocol and share the same publishing point infrastructure.

Troubleshooting

Common Issues

Issue Cause Solution
WebTransport not available .NET version below 9.0 Upgrade to .NET 9.0 or later
Client falls back to WebSocket Browser doesn't support WebTransport or HTTP/3 not configured Ensure HTTP/3 is enabled on the server; check browser compatibility
Transcoding failure Missing codec support on server Verify encoder/decoder availability on the platform
Client timeout No activity within 30 seconds Ensure client sends keep-alive (Noop) packets
Negotiation timeout Client didn't respond to media descriptor offer Check client-side JavaScript player initialization

See Also