WHIP (Web API)
Browser (WASM)
whipOutputExample.tsx
An output that sends the output stream via WHIP protocol.
Usage
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
- Type:
RTCConfiguration['iceServers]
- Defaults to:
[{ urls: 'stun:stun.l.google.com:19302' }]
video
Parameters of an output video.
- Type:
WhipOutputVideo
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 }