Skip to content

WHIP (Web API)

Browser (WASM)

An output that sends the output stream via WHIP protocol.

Usage

whipOutputExample.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.registerOutput('example', <View />, {
type: 'whip',
endpointUrl: 'https://example.com/whip',
video: {
resolution: { width: 1920, height: 1080 },
},
audio: true;
});
}
void run()

Reference

Type definitions

type RegisterWhipOutput = {
type: "whip";
endpointUrl: string;
bearerToken?: string;
iceServers?: RTCConfiguration['iceServers'];
video: WhipOutputVideo;
audio?: boolean;
};

Properties

endpointUrl

Url of a WHIP endpoint.

  • Type: string

bearerToken

Bearer token for a WHIP connection.

  • Type: string

iceServers

List of ICE servers that should be added to RTCPeerConnection


video

Parameters of an output video.


audio

If true MediaStream returned from a register call will include audio track.

  • Type: boolean
  • Defaults to: false

WhipOutputVideo

Type definitions

type RegisterCanvasOutput = {
resolution: { width: number; height: number; }
maxBitrate?: number;
};

Properties

maxBitrate

Max bitrate of a stream.

  • Type: number

resolution

Resolution of an output video

  • Type: { width: number; height: number }