INTEGRITY Cloudflare Docs

Media Transport Adapters

Media Transport Adapters bridge WebRTC and other transport protocols. Adapters handle protocol conversion, codec transcoding, and bidirectional media flow between WebRTC sessions and external endpoints.

What adapters do

Adapters extend Realtime beyond WebRTC-to-WebRTC communication:

Available adapters

WebSocket adapter (beta)

Stream audio and video between WebRTC tracks and WebSocket endpoints. Video is egress-only and is converted to JPEG. Currently in beta; the API may change.

Learn more

Architecture

Media Transport Adapters operate as intermediaries between Cloudflare Realtime SFU sessions and external endpoints:

graph LR
    A[WebRTC Client] <--> B[Realtime SFU Session]
    B <--> C[Media Transport Adapter]
    C <--> D[External Endpoint]

Key concepts

Adapter instance: Each connection creates a unique instance with an adapterId to manage its lifecycle.

Location types:

Codec support: Adapters convert between WebRTC and external system formats.

Common use cases

AI processing

Media recording

Legacy integration

API overview

Media Transport Adapters are managed through the Realtime SFU API:

POST /v1/apps/{appId}/adapters/{adapterType}/new
POST /v1/apps/{appId}/adapters/{adapterType}/close

Each adapter type has specific configuration requirements and capabilities. Refer to individual adapter documentation for detailed API specifications.

Best practices

Limitations

Get started

WebSocket adapter (beta) - Stream audio and video between WebRTC and WebSocket endpoints (video egress to JPEG)