Skip to content

WHEP client (Web API)

Browser (WASM)

An input that lets you connect to a WHEP server endpoint to receive a live media stream from it.

Usage

whepClientInputExample.tsx
import Smelter from "@swmansion/smelter-web-wasm";
import { View } from "@swmansion/smelter";
async function run() {
const smelter = new Smelter();
await smelter.init();
await smelter.registerInput('example', <View />, {
type: 'whep_client',
endpointUrl: 'https://example.com/whep',
bearerToken: 'example_token'
});
}
void run()

Reference

Type definitions

type RegisterWhepClientInput = {
type: "whep_client";
endpointUrl: string;
bearerToken?: string;
};

Properties

endpointUrl

Url of a WHEP endpoint.

  • Type: string

bearerToken

Bearer token for a WHEP connection.

  • Type: string