← All demos

WHIP publish

Send your camera or screen to any WHIP ingest server (Meshcast, Cloudflare Stream, Twitch) with the standalone whip-client.js. No VDO.Ninja room is involved; viewers watch through the service's WHEP endpoint or player.

  1. Pick a service. Meshcast works with no account; the others need your own URL or key.
  2. Start the preview of your camera or screen.
  3. Publish. It worked when the status turns green ("ICE connected") and the bitrate keeps rising.
  4. Open the viewer link in another tab or on another device to watch over WHEP.

Service and settings

Preview and publish

Not publishing
Local preview

Log

Key WHIP client calls in this demo
const client = new WHIPClient('https://cae1.meshcast.io/whip/' + streamId, {
    authToken,           // optional; sent as "Authorization: Bearer ..."
    videoCodec: 'h264',  // optional codec preference
    videoBitrate: 2500   // kbps
});
client.addEventListener('icestate', (e) => console.log('ICE', e.detail.state));

const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
await client.publish(stream);   // POSTs the SDP offer, applies the answer

// Viewers: new WHEPClient('https://cae1.meshcast.io/whep/' + streamId)
await client.stop();            // DELETEs the session and closes the connection